diff options
author | Alexis211 <alexis211@gmail.com> | 2009-10-20 19:21:34 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-10-20 19:21:34 +0200 |
commit | 9836acd720988af30250c2c1ec18d618664dea4e (patch) | |
tree | 9e26d7d65e1693d1a7f9fd93c9fd33b41d175464 /Source/Library/Userland | |
parent | 90b49b6f171108f272ff529f7546bd9625ca7d17 (diff) | |
download | Melon-9836acd720988af30250c2c1ec18d618664dea4e.tar.gz Melon-9836acd720988af30250c2c1ec18d618664dea4e.zip |
Started working on a userland shell
This means I'll have to do syscalls for everything I need.
Diffstat (limited to 'Source/Library/Userland')
-rw-r--r-- | Source/Library/Userland/Binding/FSNode.class.h | 23 | ||||
-rw-r--r-- | Source/Library/Userland/Binding/VirtualTerminal.class.h | 6 |
2 files changed, 28 insertions, 1 deletions
diff --git a/Source/Library/Userland/Binding/FSNode.class.h b/Source/Library/Userland/Binding/FSNode.class.h new file mode 100644 index 0000000..eb25782 --- /dev/null +++ b/Source/Library/Userland/Binding/FSNode.class.h @@ -0,0 +1,23 @@ +#include <Syscall/RessourceCaller.class.h> +#include <FSNode.iface.h> + +class FSNode : public RessourceCaller { + public: + static FSNode getRoot() { + return FSNode(RessourceCaller::sCall(FNIF_OBJTYPE, FNIF_SGETRFN)); + } + FSNode(u32int id) : RessourceCaller(id, FNIF_OBJTYPE) {} + + String getName() { + return String::unserialize(doCall(FNIF_GETNAME)); + } + u8int type() { + return doCall(FNIF_TYPE); + } + FSNode getParent() { + return FSNode(doCall(FNIF_GETPARENT)); + } + u64int getLength() { + return *((u64int*)doCall(FNIF_GETLENGTH)); + } +}; diff --git a/Source/Library/Userland/Binding/VirtualTerminal.class.h b/Source/Library/Userland/Binding/VirtualTerminal.class.h index 0da1be4..9d438c6 100644 --- a/Source/Library/Userland/Binding/VirtualTerminal.class.h +++ b/Source/Library/Userland/Binding/VirtualTerminal.class.h @@ -37,8 +37,12 @@ class VirtualTerminal : public RessourceCaller { bool isBoxed() { return doCall(VTIF_ISBOXED) != 0; } - void put(WChar c) { doCall(VTIF_PUT, c); } + + inline VirtualTerminal& operator<<(const String& s) { write(s); return *this; } + inline VirtualTerminal& operator<<(s32int i) { writeDec(i); return *this; } + inline VirtualTerminal& operator<<(s64int i) { writeDec(i); return *this; } + inline VirtualTerminal& operator<<(u32int i) { writeHex(i); return *this; } }; |