summaryrefslogtreecommitdiff
path: root/comm
diff options
context:
space:
mode:
authorchatty1995-02-13 16:55:31 +0000
committerchatty1995-02-13 16:55:31 +0000
commit5b5dea3e38bccca25e5efd315186869b9918aa7d (patch)
tree52b38255e9ba8b659eb475fdf4af652c93f247c0 /comm
parentfc323560826ac24b7a66b5cd0a5621963b9d1677 (diff)
downloadivy-league-5b5dea3e38bccca25e5efd315186869b9918aa7d.zip
ivy-league-5b5dea3e38bccca25e5efd315186869b9918aa7d.tar.gz
ivy-league-5b5dea3e38bccca25e5efd315186869b9918aa7d.tar.bz2
ivy-league-5b5dea3e38bccca25e5efd315186869b9918aa7d.tar.xz
Receive -> Read*
Emit -> Write*
Diffstat (limited to 'comm')
-rw-r--r--comm/OLD/TextStream.cc61
-rw-r--r--comm/OLD/TextStream.h22
2 files changed, 46 insertions, 37 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);
}
diff --git a/comm/OLD/TextStream.h b/comm/OLD/TextStream.h
index 3c919f7..59a0162 100644
--- a/comm/OLD/TextStream.h
+++ b/comm/OLD/TextStream.h
@@ -47,18 +47,18 @@ protected:
cmd_res TryPredefined (const UchTextLine&);
virtual cmd_res Execute (const UchTextLine&) = 0;
- void Emit (lword);
- void Emit (sword);
- void Emit (byte);
- void Emit (char);
- void Emit (const char*);
+ void WriteLong (lword);
+ void WriteShort (sword);
+ void WriteByte (byte);
+ void WriteChar (char);
+ void WriteString (const char*);
- void Receive (lword&);
- void Receive (sword&);
- void Receive (byte&);
- void Receive (char&);
- void Receive (char*);
- void Receive (CcuString&);
+ bool ReadLong (lword&);
+ bool ReadShort (sword&);
+ bool ReadByte (byte&);
+ bool ReadChar (char&);
+ int ReadString (char*, int);
+ int ReadString (CcuString&);
public: