summaryrefslogtreecommitdiff
path: root/Source/Library/Common/IStream.proto.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Library/Common/IStream.proto.h')
-rw-r--r--Source/Library/Common/IStream.proto.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/Library/Common/IStream.proto.h b/Source/Library/Common/IStream.proto.h
new file mode 100644
index 0000000..e844726
--- /dev/null
+++ b/Source/Library/Common/IStream.proto.h
@@ -0,0 +1,32 @@
+#ifndef DEF_ISTREAM_PROTO_h
+#define DEF_ISTREAM_PROTO_h
+
+#include <String.class.h>
+#include <SimpleList.class.h>
+#include <Mutex.class.h>
+
+class IStream : private Mutex {
+ private:
+ SimpleList<String> *m_buffer;
+ int m_ptr;
+ void operator =(IStream& other);
+ bool m_eof;
+
+ bool populate();
+
+ protected:
+ virtual String read() = 0;
+
+ public:
+ IStream();
+ IStream(const IStream& other);
+ virtual ~IStream();
+
+ bool eof() const { return m_eof && (m_buffer == NULL); }
+
+ WChar getChar();
+ String get(WChar delimiter = "\n");
+ String getWord() { return get(" "); }
+};
+
+#endif