summaryrefslogtreecommitdiffhomepage
path: root/Private/Source/NewFS.cxx
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-29 18:17:47 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-29 18:18:59 +0100
commit65254486efff0fd1bb78a48ff90b7713a5ce539f (patch)
tree20ce02c12a74ba9e6cd382bf9c1f09a0c611cb4d /Private/Source/NewFS.cxx
parentf03986937db0b927da4b10554801e18e4dc7c43f (diff)
Kernel: Update TODO.
Src: Refactorings according to clang-format. Meta: Update specification. Public: Remove useless UIKit. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/Source/NewFS.cxx')
-rw-r--r--Private/Source/NewFS.cxx70
1 files changed, 31 insertions, 39 deletions
diff --git a/Private/Source/NewFS.cxx b/Private/Source/NewFS.cxx
index cd787e9b..2283e779 100644
--- a/Private/Source/NewFS.cxx
+++ b/Private/Source/NewFS.cxx
@@ -10,42 +10,34 @@
#include <FSKit/NewFS.hxx>
#include <KernelKit/FileManager.hpp>
-namespace hCore
-{
- NewFilesystemManager::NewFilesystemManager() = default;
-
- NewFilesystemManager::~NewFilesystemManager() = default;
-
- /**
- * Unallocates a file from disk.
- * @param node_name it's path.
- * @return operation status boolean.
- */
- bool NewFilesystemManager::Remove(const char* node_name)
- {
- if (node_name == nullptr ||
- *node_name == 0)
- return false;
-
- if (auto catalog = fIO->GetCatalog(node_name);
- catalog)
- return fIO->RemoveCatalog(*catalog);
-
- return false;
- }
-
- NodePtr NewFilesystemManager::Create(const char* path)
- {
- return node_cast(fIO->CreateCatalog(path, 0, kCatalogKindFile));
- }
-
- NodePtr NewFilesystemManager::CreateDirectory(const char *path)
- {
- return node_cast(fIO->CreateCatalog(path, 0, kCatalogKindDir));
- }
-
- NodePtr NewFilesystemManager::CreateAlias(const char *path)
- {
- return node_cast(fIO->CreateCatalog(path, 0, kCatalogKindAlias));
- }
-} // namespace hCore
+namespace hCore {
+NewFilesystemManager::NewFilesystemManager() = default;
+
+NewFilesystemManager::~NewFilesystemManager() = default;
+
+/**
+ * Unallocates a file from disk.
+ * @param node_name it's path.
+ * @return operation status boolean.
+ */
+bool NewFilesystemManager::Remove(const char* node_name) {
+ if (node_name == nullptr || *node_name == 0) return false;
+
+ if (auto catalog = fIO->GetCatalog(node_name); catalog)
+ return fIO->RemoveCatalog(*catalog);
+
+ return false;
+}
+
+NodePtr NewFilesystemManager::Create(const char* path) {
+ return node_cast(fIO->CreateCatalog(path, 0, kCatalogKindFile));
+}
+
+NodePtr NewFilesystemManager::CreateDirectory(const char* path) {
+ return node_cast(fIO->CreateCatalog(path, 0, kCatalogKindDir));
+}
+
+NodePtr NewFilesystemManager::CreateAlias(const char* path) {
+ return node_cast(fIO->CreateCatalog(path, 0, kCatalogKindAlias));
+}
+} // namespace hCore