blob: e40e98aa5797995f30c12a932b5bbe080758bf72 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
/* -------------------------------------------
Copyright ZKA Technologies.
------------------------------------------- */
#include <KernelKit/FileManager.hxx>
#include <KernelKit/Heap.hxx>
#ifdef __FSKIT_USE_NEWFS__
/// @brief NewFS File manager.
/// BUGS: 0
namespace Kernel
{
/// @brief C++ constructor
NewFilesystemManager::NewFilesystemManager()
{
MUST_PASS(Detail::fs_init_newfs());
fImpl = new NewFSParser();
kcout << "newoskrnl: We are done here... (NewFilesystemManager).\r";
}
NewFilesystemManager::~NewFilesystemManager()
{
kcout << "newoskrnl: Destroying it...\r";
if (fImpl)
{
delete fImpl;
}
}
/// @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;
return fImpl->RemoveCatalog(fileName);
}
/// @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));
}
/// @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;
}
/// @brief Gets the metafile character.
/// @return
const Char NewFilesystemHelper::MetaFile()
{
return kNewFSMetaFilePrefix;
}
} // namespace Kernel
#endif // ifdef __FSKIT_USE_NEWFS__
|