diff options
Diffstat (limited to 'comm/OLD/TextStream.cc')
-rw-r--r-- | comm/OLD/TextStream.cc | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/comm/OLD/TextStream.cc b/comm/OLD/TextStream.cc index 445add6..790a03e 100644 --- a/comm/OLD/TextStream.cc +++ b/comm/OLD/TextStream.cc @@ -248,78 +248,87 @@ UchTextStream :: Quit () void -UchTextStream :: Emit (lword l) +UchTextStream :: WriteLong (lword l) { - char c [1]; + char c [64]; sprintf (c, "%d", l); OutBuffer << c; } void -UchTextStream :: Emit (sword s) +UchTextStream :: WriteShort (sword s) { - char c [1]; + char c [64]; sprintf (c, "%d", s); OutBuffer << c; } void -UchTextStream :: Emit (byte b) +UchTextStream :: WriteByte (byte b) { - char c [1]; + char c [8]; sprintf (c, "%d", b); OutBuffer << c; } void -UchTextStream :: Emit (char c) +UchTextStream :: WriteChar (char c) { OutBuffer << c; } void -UchTextStream :: Emit (const char* s) +UchTextStream :: WriteString (const char* s) { OutBuffer << s; } -void -UchTextStream :: Receive (lword& l) +bool +UchTextStream :: ReadLong (lword& l) { - InBuffer >> l; + char c [64]; + InBuffer.ReadString (c, 64); + l = (lword) atol (c); + return true; } -void -UchTextStream :: Receive (sword& s) +bool +UchTextStream :: ReadShort (sword& s) { - InBuffer >> s; + char c [64]; + InBuffer.ReadString (c, 64); + s = (sword) atoi (c); + return true; } -void -UchTextStream :: Receive (byte& b) +bool +UchTextStream :: ReadByte (byte& b) { - InBuffer >> b; + char c [8]; + InBuffer.ReadString (c, 8); + b = (byte) atoi (c); + return true; } -void -UchTextStream :: Receive (char& c) +bool +UchTextStream :: ReadChar (char& c) { - InBuffer >> c; + return InBuffer.ReadChar (c); } -void -UchTextStream :: Receive (char* s) +int +UchTextStream :: ReadString (char* s, int n) { - InBuffer >> s; + return InBuffer.ReadString (s, n); } -void -UchTextStream :: Receive (CcuString& s) +int +UchTextStream :: ReadString (CcuString& s) { - InBuffer >> s; + return InBuffer.ReadString (s); } |