summaryrefslogtreecommitdiff
path: root/Source/Library/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Library/Userland')
-rw-r--r--Source/Library/Userland/Binding/FSNode.class.h23
-rw-r--r--Source/Library/Userland/Binding/VirtualTerminal.class.h6
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; }
};