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/Kits/System.Core | |
| parent | 159d312c0dd3c02995950270e173cc10ade273cf (diff) | |
API: Inconsitency fix.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public/Kits/System.Core')
| -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 |
3 files changed, 33 insertions, 28 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 |
