mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-25 22:14:37 +00:00
Refactor Node constructor
This commit is contained in:
parent
45406209d8
commit
84e5b2310e
@ -90,14 +90,13 @@ namespace vfs
|
||||
}
|
||||
|
||||
Node::Node(Node *Parent, const char *Name, NodeType Type,
|
||||
bool NoParent, Virtual *fs, int *Err)
|
||||
bool NoParent, Virtual *_fs, int *Err)
|
||||
{
|
||||
assert(Name != nullptr);
|
||||
assert(strlen(Name) != 0);
|
||||
assert((NoParent == false &&
|
||||
fs == nullptr) ||
|
||||
(NoParent == true &&
|
||||
fs != nullptr));
|
||||
|
||||
if (Parent && _fs == nullptr)
|
||||
_fs = Parent->vFS;
|
||||
|
||||
if (Err != nullptr)
|
||||
*Err = 0;
|
||||
@ -145,10 +144,10 @@ namespace vfs
|
||||
Parent = nullptr;
|
||||
const char *Path = Name;
|
||||
|
||||
Node *RootNode = fs->FileSystemRoot->Children[0];
|
||||
Node *CurrentParent = fs->GetParent(Path, Parent);
|
||||
Node *RootNode = _fs->FileSystemRoot->Children[0];
|
||||
Node *CurrentParent = _fs->GetParent(Path, Parent);
|
||||
|
||||
if (fs->PathExists(Path, CurrentParent))
|
||||
if (_fs->PathExists(Path, CurrentParent))
|
||||
{
|
||||
debug("Path \"%s\" already exists.", Path);
|
||||
delete[] Path;
|
||||
@ -158,7 +157,7 @@ namespace vfs
|
||||
return;
|
||||
}
|
||||
|
||||
const char *CleanPath = fs->NormalizePath(Path, CurrentParent);
|
||||
const char *CleanPath = _fs->NormalizePath(Path, CurrentParent);
|
||||
|
||||
cwk_segment segment;
|
||||
if (!cwk_path_get_first_segment(CleanPath, &segment))
|
||||
|
Loading…
x
Reference in New Issue
Block a user