From 2d3c5a9c47d99c8f4f5561f9eae16497c1cde63a Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sun, 20 Dec 2009 16:13:44 +0100 Subject: Added file streams and string streams --- Source/Library/Common/FileStream.class.h | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Source/Library/Common/FileStream.class.h (limited to 'Source/Library/Common/FileStream.class.h') diff --git a/Source/Library/Common/FileStream.class.h b/Source/Library/Common/FileStream.class.h new file mode 100644 index 0000000..d0fb971 --- /dev/null +++ b/Source/Library/Common/FileStream.class.h @@ -0,0 +1,41 @@ +#ifndef DEF_FILESTREAM_CLASS_H +#define DEF_FILESTREAM_CLASS_H + +#include +#include + +#ifdef THIS_IS_MELON_KERNEL +#include +#else +#include +#endif + +class FileIStream : public IStream { + private: + String read(); + + SimpleList *m_filenames; + + File *m_file; + u8int m_encoding; + + public: + FileIStream(const String &filename, u8int encoding = UE_UTF8, FSNode start = FSNode(0)); + ~FileIStream(); + + void appendFile(const String &filename); +}; + +class FileOStream : public OStream { + private: + File *m_file; + u8int m_encoding; + + public: + FileOStream(const String &filename, u8int mode, u8int encoding = UE_UTF8, FSNode start = FSNode(0)); + ~FileOStream(); + + void write(const String &s); +}; + +#endif -- cgit v1.2.3 From 13d720389a01161a327a30918ad7ac9eec4a3d6c Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sun, 20 Dec 2009 16:30:30 +0100 Subject: [not tested] Introduced StreamApp.class --- Source/Library/Common/FileStream.class.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Source/Library/Common/FileStream.class.h') diff --git a/Source/Library/Common/FileStream.class.h b/Source/Library/Common/FileStream.class.h index d0fb971..99bf0e8 100644 --- a/Source/Library/Common/FileStream.class.h +++ b/Source/Library/Common/FileStream.class.h @@ -18,9 +18,11 @@ class FileIStream : public IStream { File *m_file; u8int m_encoding; + FSNode m_start; public: FileIStream(const String &filename, u8int encoding = UE_UTF8, FSNode start = FSNode(0)); + FileIStream(u8int encoding = UE_UTF8, FSNode start = FSNode(0)); ~FileIStream(); void appendFile(const String &filename); -- cgit v1.2.3