diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-01 19:00:28 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-01 19:00:28 +0200 |
| commit | 9805813dea123dcf4293e4f4b28152a10604fef7 (patch) | |
| tree | 5b5a39d385a100730c99be91a8012dd4cf5c4314 /Private/Source/NewFS+FileManager.cxx | |
| parent | 3c4efadf68e2071429925ea7f90f73341200a42f (diff) | |
NewKernel: v412024
- ke_bug_check returns true by default now. BugFix.
- Document file manager. - Improv
- Add \r\n instead of \n endings - Improv.
Diffstat (limited to 'Private/Source/NewFS+FileManager.cxx')
| -rw-r--r-- | Private/Source/NewFS+FileManager.cxx | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/Private/Source/NewFS+FileManager.cxx b/Private/Source/NewFS+FileManager.cxx index 171f0c6f..4ba95d89 100644 --- a/Private/Source/NewFS+FileManager.cxx +++ b/Private/Source/NewFS+FileManager.cxx @@ -12,35 +12,54 @@ /// BUGS: 0 namespace NewOS { +/// @brief C++ constructor NewFilesystemManager::NewFilesystemManager() = default; NewFilesystemManager::~NewFilesystemManager() = default; -bool NewFilesystemManager::Remove(const char* node_name) { - if (node_name == nullptr || *node_name == 0) return false; +/// @brief Removes a node from the filesystem. +/// @param fileName The filename +/// @return If it was deleted or not. +bool NewFilesystemManager::Remove(const char* fileName) { + if (fileName == nullptr || *fileName == 0) return false; - if (auto catalog = fImpl->GetCatalog(node_name); catalog) + if (auto catalog = fImpl->GetCatalog(fileName); catalog) return fImpl->RemoveCatalog(catalog); return false; } +/// @brief Creates a node with the specified. +/// @param path The filename path. +/// @return The Node pointer. NodePtr NewFilesystemManager::Create(const char* path) { return node_cast(fImpl->CreateCatalog(path, 0, kNewFSCatalogKindFile)); } +/// @brief Creates a node with is a directory. +/// @param path The filename path. +/// @return The Node pointer. NodePtr NewFilesystemManager::CreateDirectory(const char* path) { return node_cast(fImpl->CreateCatalog(path, 0, kNewFSCatalogKindDir)); } +/// @brief Creates a node with is a alias. +/// @param path The filename path. +/// @return The Node pointer. NodePtr NewFilesystemManager::CreateAlias(const char* path) { return node_cast(fImpl->CreateCatalog(path, 0, kNewFSCatalogKindAlias)); } +/// @brief Gets the root directory. +/// @return const char* NewFilesystemHelper::Root() { return kNewFSRoot; } +/// @brief Gets the up-dir directory. +/// @return const char* NewFilesystemHelper::UpDir() { return kNewFSUpDir; } +/// @brief Gets the separator character. +/// @return const char NewFilesystemHelper::Separator() { return kNewFSSeparator; } } // namespace NewOS |
