diff options
author | Alexis211 <alexis211@gmail.com> | 2009-12-20 16:13:44 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-12-20 16:13:44 +0100 |
commit | 2d3c5a9c47d99c8f4f5561f9eae16497c1cde63a (patch) | |
tree | a3f800e17a34a16a00b6dc0b980e2f6cfed22dd5 /Source/Library/Common/FileStream.class.h | |
parent | cab353cbb21c142ac1e227d42338fa587e1a7f24 (diff) | |
download | Melon-2d3c5a9c47d99c8f4f5561f9eae16497c1cde63a.tar.gz Melon-2d3c5a9c47d99c8f4f5561f9eae16497c1cde63a.zip |
Added file streams and string streams
Diffstat (limited to 'Source/Library/Common/FileStream.class.h')
-rw-r--r-- | Source/Library/Common/FileStream.class.h | 41 |
1 files changed, 41 insertions, 0 deletions
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 <IStream.proto.h> +#include <OStream.proto.h> + +#ifdef THIS_IS_MELON_KERNEL +#include <VFS/File.class.h> +#else +#include <Binding/File.class.h> +#endif + +class FileIStream : public IStream { + private: + String read(); + + SimpleList<String> *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 |