From cab353cbb21c142ac1e227d42338fa587e1a7f24 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sun, 20 Dec 2009 15:21:26 +0100 Subject: Worked on IStream. Seems to work --- Source/Library/Userland/Binding/Process.class.h | 4 ++-- Source/Library/Userland/Binding/VirtualTerminal.class.h | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'Source/Library/Userland/Binding') diff --git a/Source/Library/Userland/Binding/Process.class.h b/Source/Library/Userland/Binding/Process.class.h index 2200f59..e94084b 100644 --- a/Source/Library/Userland/Binding/Process.class.h +++ b/Source/Library/Userland/Binding/Process.class.h @@ -54,10 +54,10 @@ class Process : public RessourceCaller { void pushArg(const String& arg) { doCall(PRIF_PUSHARG, (u32int)&arg); } - void setInVT(VirtualTerminal vt) { + void setInVT(const VirtualTerminal& vt) { doCall(PRIF_SETINVT, vt.resId()); } - void setOutVT(VirtualTerminal vt) { + void setOutVT(const VirtualTerminal& vt) { doCall(PRIF_SETOUTVT, vt.resId()); } bool authenticatePW(String user, String pw) { diff --git a/Source/Library/Userland/Binding/VirtualTerminal.class.h b/Source/Library/Userland/Binding/VirtualTerminal.class.h index df44124..6576c1c 100644 --- a/Source/Library/Userland/Binding/VirtualTerminal.class.h +++ b/Source/Library/Userland/Binding/VirtualTerminal.class.h @@ -7,9 +7,10 @@ #include #include +#include #include -class VirtualTerminal : public RessourceCaller, public OStream { +class VirtualTerminal : public RessourceCaller, public OStream, public IStream { public: static VirtualTerminal getIn() { u32int id = RessourceCaller::sCall(VTIF_OBJTYPE, VTIF_SGETPRINVT); @@ -30,6 +31,9 @@ class VirtualTerminal : public RessourceCaller, public OStream { void write(const String &s) { doCall(VTIF_WRITE, (u32int)&s); } + String read() { + return String::unserialize(doCall(VTIF_READLINE, 1)) += "\n"; + } keypress_t getKeypress(bool show = true, bool block = true) { keypress_t* ptr = (keypress_t*)doCall(VTIF_GETKEYPRESS, (show ? 1 : 0) | (block ? 2 : 0)); return *ptr; -- cgit v1.2.3