diff options
Diffstat (limited to 'Source/Library/Userland/Binding/FSNode.class.h')
-rw-r--r-- | Source/Library/Userland/Binding/FSNode.class.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Source/Library/Userland/Binding/FSNode.class.h b/Source/Library/Userland/Binding/FSNode.class.h index 95802a4..61ac991 100644 --- a/Source/Library/Userland/Binding/FSNode.class.h +++ b/Source/Library/Userland/Binding/FSNode.class.h @@ -4,7 +4,13 @@ class FSNode : public RessourceCaller { public: static FSNode getRoot() { - return FSNode(RessourceCaller::sCall(FNIF_OBJTYPE, FNIF_SGETRFN)); + return FSNode(sCall(FNIF_OBJTYPE, FNIF_SGETRFN)); + } + static FSNode getCwd() { + return FSNode(sCall(FNIF_OBJTYPE, FNIF_SGETCWD)); + } + static FSNode find(String path) { //Finds a node starting from root node + return FSNode(sCall(FNIF_OBJTYPE, FNIF_SFIND, (u32int)&path, 0)); } FSNode(u32int id) : RessourceCaller(id, FNIF_OBJTYPE) {} @@ -32,4 +38,16 @@ class FSNode : public RessourceCaller { String path() { return String::unserialize(doCall(FNIF_GETPATH)); } + void setCwd() { + doCall(FNIF_SETCWD); + } + FSNode getChild(u32int idx) { + return FSNode(doCall(FNIF_GETIDXCHILD, idx)); + } + FSNode getChild(String name) { + return FSNode(doCall(FNIF_GETNAMECHILD, (u32int)&name)); + } + FSNode findFrom(String path) { //Search a filesystem node starting from here + return FSNode(sCall(FNIF_OBJTYPE, FNIF_SFIND, (u32int)&path, resId())); + } }; |