summaryrefslogtreecommitdiff
path: root/Source/Library/Common/StringStream.class.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Library/Common/StringStream.class.cpp')
-rw-r--r--Source/Library/Common/StringStream.class.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/Library/Common/StringStream.class.cpp b/Source/Library/Common/StringStream.class.cpp
new file mode 100644
index 0000000..c4377ce
--- /dev/null
+++ b/Source/Library/Common/StringStream.class.cpp
@@ -0,0 +1,28 @@
+#include "StringStream.class.h"
+
+StringIStream::StringIStream(const String &e) {
+ m_elements = new SimpleList<String>(e);
+}
+
+StringIStream::StringIStream() {
+ m_elements = 0;
+}
+
+StringIStream::~StringIStream() {
+ if (m_elements != 0) delete m_elements;
+}
+
+String StringIStream::read() {
+ if (m_elements == 0) return "";
+ String ret = m_elements->v();
+ m_elements = m_elements->delThis();
+ return ret;
+}
+
+void StringIStream::append(const String &e) {
+ if (m_elements == 0) {
+ m_elements = new SimpleList<String>(e);
+ } else {
+ m_elements->addAtEnd(e);
+ }
+}