diff options
Diffstat (limited to 'Source/Library/Userland')
-rw-r--r-- | Source/Library/Userland/Binding/VirtualTerminal.class.h | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Source/Library/Userland/Binding/VirtualTerminal.class.h b/Source/Library/Userland/Binding/VirtualTerminal.class.h index 70c6b23..df44124 100644 --- a/Source/Library/Userland/Binding/VirtualTerminal.class.h +++ b/Source/Library/Userland/Binding/VirtualTerminal.class.h @@ -6,10 +6,10 @@ #include <VirtualTerminal.iface.h> #include <Kbd.iface.h> -#include <String.class.h> +#include <OStream.proto.h> #include <WChar.class.h> -class VirtualTerminal : public RessourceCaller { +class VirtualTerminal : public RessourceCaller, public OStream { public: static VirtualTerminal getIn() { u32int id = RessourceCaller::sCall(VTIF_OBJTYPE, VTIF_SGETPRINVT); @@ -21,13 +21,13 @@ class VirtualTerminal : public RessourceCaller { } VirtualTerminal(u32int id) : RessourceCaller(id, VTIF_OBJTYPE) {} - void writeHex(u32int number) { + /*void writeHex(u32int number) { doCall(VTIF_WRITEHEX, number); } void writeDec(s64int number) { doCall(VTIF_WRITEDEC, (number >> 32), number); - } - void write(String s) { + }*/ + void write(const String &s) { doCall(VTIF_WRITE, (u32int)&s); } keypress_t getKeypress(bool show = true, bool block = true) { @@ -35,6 +35,7 @@ class VirtualTerminal : public RessourceCaller { return *ptr; } String readLine(bool show = true) { + flush(); return String::unserialize(doCall(VTIF_READLINE, (show ? 1 : 0))); } void setColor(u8int fg, u8int bg = 0xFF) { @@ -64,11 +65,6 @@ class VirtualTerminal : public RessourceCaller { void put(u8int line, u8int col, WChar c) { moveCursor(line, col); 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; } }; #endif |