diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-15 08:03:35 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-15 08:03:35 +0100 |
| commit | b3e76bf866b4223390585589786600475c9fdcae (patch) | |
| tree | 7b10c496e94aa98dedf441f67fb39d0aaa7fbda9 /Public | |
| parent | 159d312c0dd3c02995950270e173cc10ade273cf (diff) | |
API: Inconsitency fix.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public')
| -rw-r--r-- | Public/Kits/System.Core/FileAPI.hxx | 14 | ||||
| -rw-r--r-- | Public/Kits/System.Core/HeapAPI.cxx | 13 | ||||
| -rw-r--r-- | Public/Kits/System.Core/HeapAPI.hxx | 34 | ||||
| -rw-r--r-- | Public/Kits/System.Graphics/Core.hxx | 8 | ||||
| -rw-r--r-- | Public/Kits/System.Graphics/Dim2d.cxx | 4 | ||||
| -rw-r--r-- | Public/Kits/System.Graphics/Dim2d.hxx | 4 | ||||
| -rw-r--r-- | Public/Kits/System.Graphics/Frame.cxx | 4 | ||||
| -rw-r--r-- | Public/Kits/System.Graphics/Frame.hxx | 4 | ||||
| -rw-r--r-- | Public/Kits/System.Zip/Zip.cxx | 10 | ||||
| -rw-r--r-- | Public/Kits/System.Zip/Zip.hpp | 4 |
10 files changed, 52 insertions, 47 deletions
diff --git a/Public/Kits/System.Core/FileAPI.hxx b/Public/Kits/System.Core/FileAPI.hxx index 66ecef22..2f799330 100644 --- a/Public/Kits/System.Core/FileAPI.hxx +++ b/Public/Kits/System.Core/FileAPI.hxx @@ -7,20 +7,21 @@ #ifndef _SYSTEM_KIT_HCORE_FILE_HPP #define _SYSTEM_KIT_HCORE_FILE_HPP -#include <CompilerKit/CompilerKit.hpp> +#include <CompilerKit/CompilerKit.hxx> #include <NewKit/Defines.hpp> using namespace HCore; /// @brief SOM class, translated to C++ -class HFile final { +namespace System { +class File final { public: - explicit HFile(const char *path); - ~HFile(); + explicit File(const char *path); + ~File(); public: - HCORE_COPY_DEFAULT(HFile); + HCORE_COPY_DEFAULT(File); public: voidPtr Read(SizeT off, SizeT sz); @@ -35,6 +36,7 @@ class HFile final { void MIME(const char *mime); }; -typedef HFile *HFilePtr; +typedef File *FilePtr; +} // namespace System #endif // ifndef _SYSTEM_KIT_HCORE_FILE_HPP diff --git a/Public/Kits/System.Core/HeapAPI.cxx b/Public/Kits/System.Core/HeapAPI.cxx index 2dc7338b..232b4927 100644 --- a/Public/Kits/System.Core/HeapAPI.cxx +++ b/Public/Kits/System.Core/HeapAPI.cxx @@ -8,28 +8,29 @@ #include <System.Core/hcore.h> using namespace HCore; +using namespace System; STATIC HcObjectPtr kObjectHeap; -HHeap* HHeap::Shared() noexcept { - static HHeap* heap = nullptr; +Heap* Heap::Shared() noexcept { + static Heap* heap = nullptr; if (!heap) { - heap = new HHeap(); + heap = new Heap(); kObjectHeap = HcGetProcessHeap(); } return heap; } -void HHeap::Delete(HHeapPtr me) noexcept { HcFreeProcessHeap(kObjectHeap, me); } +void Heap::Delete(HeapPtr me) noexcept { HcFreeProcessHeap(kObjectHeap, me); } -SizeT HHeap::Size(HHeapPtr me) noexcept { +SizeT Heap::Size(HeapPtr me) noexcept { CA_MUST_PASS(me); return HcProcessHeapSize(kObjectHeap, me); } -HHeapPtr HHeap::New(const SizeT &sz, const Int32 flags) { +HeapPtr Heap::New(const SizeT &sz, const Int32 flags) { SizeT _sz = sz; if (!_sz) ++_sz; diff --git a/Public/Kits/System.Core/HeapAPI.hxx b/Public/Kits/System.Core/HeapAPI.hxx index 9391bc4f..f50ff6f7 100644 --- a/Public/Kits/System.Core/HeapAPI.hxx +++ b/Public/Kits/System.Core/HeapAPI.hxx @@ -6,16 +6,17 @@ #pragma once -#include <CompilerKit/CompilerKit.hpp> +#include <CompilerKit/CompilerKit.hxx> #include <NewKit/Defines.hpp> /// @brief SOM class, translated to C++ using namespace HCore; -class HMemoryException; +namespace System { +class MemoryException; -typedef VoidPtr HHeapPtr; +typedef VoidPtr HeapPtr; enum { kHeapExpandable = 2, @@ -25,32 +26,32 @@ enum { kHeapNoFlags = 0 }; -class HHeap final { +class Heap final { private: - explicit HHeap(); + explicit Heap(); public: - ~HHeap(); + ~Heap(); public: - HCORE_COPY_DEFAULT(HHeap); + HCORE_COPY_DEFAULT(Heap); public: - static HHeap *Shared() noexcept; + static Heap *Shared() noexcept; public: - void Delete(HHeapPtr me) noexcept; - SizeT Size(HHeapPtr me) noexcept; - HHeapPtr New(const SizeT &sz, const Int32 flags = kHeapNoFlags); + void Delete(HeapPtr me) noexcept; + SizeT Size(HeapPtr me) noexcept; + HeapPtr New(const SizeT &sz, const Int32 flags = kHeapNoFlags); }; -class HMemoryException final { +class MemoryException final { public: - explicit HMemoryException() = default; - ~HMemoryException() = default; + explicit MemoryException() = default; + ~MemoryException() = default; public: - HCORE_COPY_DEFAULT(HMemoryException); + HCORE_COPY_DEFAULT(MemoryException); public: const char *Name(); @@ -60,5 +61,6 @@ class HMemoryException final { const char *mReason{"HeapAPI: Memory Exception!"}; private: - friend HHeap; + friend Heap; }; +} // namespace System
\ No newline at end of file diff --git a/Public/Kits/System.Graphics/Core.hxx b/Public/Kits/System.Graphics/Core.hxx index db9aa36f..d0f62418 100644 --- a/Public/Kits/System.Graphics/Core.hxx +++ b/Public/Kits/System.Graphics/Core.hxx @@ -14,7 +14,7 @@ #pragma once -#include <CompilerKit/CompilerKit.hpp> +#include <CompilerKit/CompilerKit.hxx> #include <NewKit/Array.hpp> #include <NewKit/Defines.hpp> #include <NewKit/Ref.hpp> @@ -28,7 +28,7 @@ #define G_API __attribute__((pef_container(".EXPORT"))) #endif // ifdef __EXPORT_LIB -namespace HCore { +namespace System::Graphics { template <typename... T> class GAction; @@ -143,7 +143,7 @@ class G_API GApplication final { class G_API GDocument final { public: - explicit GDocument(StringView& sv) : mString(GString::Construct(sv)) {} + explicit GDocument(HCore::StringView& sv) : mString(GString::Construct(sv)) {} ~GDocument() = default; HCORE_COPY_DEFAULT(GDocument); @@ -182,4 +182,4 @@ inline GFrameType* frame_cast(GFrameBase* Frame) { return dynamic_cast<GFrameType*>(Frame); } -} // namespace HCore +} // namespace System::Graphics diff --git a/Public/Kits/System.Graphics/Dim2d.cxx b/Public/Kits/System.Graphics/Dim2d.cxx index 8623a0e1..5925660d 100644 --- a/Public/Kits/System.Graphics/Dim2d.cxx +++ b/Public/Kits/System.Graphics/Dim2d.cxx @@ -13,8 +13,8 @@ #include <System.Graphics/Dim2d.hxx> -namespace HCore { +namespace System::Graphics { HCore::UInt& Dim2d::X() { return m_X; } HCore::UInt& Dim2d::Y() { return m_Y; } -} // namespace HCore +} // namespace System::Graphics diff --git a/Public/Kits/System.Graphics/Dim2d.hxx b/Public/Kits/System.Graphics/Dim2d.hxx index a4f5fa8d..77d42c90 100644 --- a/Public/Kits/System.Graphics/Dim2d.hxx +++ b/Public/Kits/System.Graphics/Dim2d.hxx @@ -17,7 +17,7 @@ #include <System.Graphics/Core.hxx> -namespace HCore { +namespace System::Graphics { class G_API Dim2d final { public: explicit Dim2d() = delete; @@ -33,6 +33,6 @@ class G_API Dim2d final { HCore::UInt m_X{0}; HCore::UInt m_Y{0}; }; -} // namespace HCore +} // namespace System::Graphics #endif /* ifndef __DIM2D__ */ diff --git a/Public/Kits/System.Graphics/Frame.cxx b/Public/Kits/System.Graphics/Frame.cxx index 10726b57..ddb7b5ce 100644 --- a/Public/Kits/System.Graphics/Frame.cxx +++ b/Public/Kits/System.Graphics/Frame.cxx @@ -13,6 +13,6 @@ #include <System.Graphics/Frame.hxx> -namespace HCore { +namespace System::Graphics { -} // namespace HCore +} // namespace System::Graphics diff --git a/Public/Kits/System.Graphics/Frame.hxx b/Public/Kits/System.Graphics/Frame.hxx index e0d52a4c..6c305cd3 100644 --- a/Public/Kits/System.Graphics/Frame.hxx +++ b/Public/Kits/System.Graphics/Frame.hxx @@ -17,7 +17,7 @@ #include <System.Graphics/Dim2d.hxx> #include <NewKit/MutableArray.hpp> -namespace HCore { +namespace System::Graphics { class G_API GFrame { public: explicit GFrame(GFrame* parent = nullptr) : m_ParentFrame(parent) {} @@ -56,4 +56,4 @@ class G_API GFrame { HCore::MutableArray<GFrame*> m_Frames; GFrame* m_ParentFrame{nullptr}; }; -} // namespace HCore +} // namespace System::Graphics diff --git a/Public/Kits/System.Zip/Zip.cxx b/Public/Kits/System.Zip/Zip.cxx index 81a39a18..39818da7 100644 --- a/Public/Kits/System.Zip/Zip.cxx +++ b/Public/Kits/System.Zip/Zip.cxx @@ -14,18 +14,18 @@ namespace System::Zip { ZipStream::ZipStream() - : fSharedData(HHeap::Shared()->New(kInitialSz, kHeapExpandable)), + : fSharedData(System::Heap::Shared()->New(kInitialSz, kHeapExpandable)), fSharedSz(kInitialSz) {} ZipStream::~ZipStream() noexcept { - if (fSharedData) HHeap::Shared()->Delete(fSharedData); + if (fSharedData) System::Heap::Shared()->Delete(fSharedData); } -HFilePtr ZipStream::FlushToFile(const char *name) { - HFilePtr fp = new HFile(name); +FilePtr ZipStream::FlushToFile(const char *name) { + FilePtr fp = new File(name); CA_MUST_PASS(fp); - this->fSharedSz = HHeap::Shared()->Size(this->fSharedData); + this->fSharedSz = System::Heap::Shared()->Size(this->fSharedData); fp->MIME(kZipKitMime); fp->Write(this->fSharedData, this->fSharedSz); diff --git a/Public/Kits/System.Zip/Zip.hpp b/Public/Kits/System.Zip/Zip.hpp index 490fb27c..7affe917 100644 --- a/Public/Kits/System.Zip/Zip.hpp +++ b/Public/Kits/System.Zip/Zip.hpp @@ -11,7 +11,7 @@ #define Z_SOLO 1 -#include <CompilerKit/CompilerKit.hpp> +#include <CompilerKit/CompilerKit.hxx> #include <System.Zip/Defines.hpp> #include <System.Zip/zlib.hpp> @@ -27,7 +27,7 @@ class ZipStream final { HCORE_COPY_DEFAULT(ZipStream); public: - HFilePtr FlushToFile(const char *name); + FilePtr FlushToFile(const char *name); void *Deflate(const char *name); void Inflate(const char *name, void *data); |
