diff options
author | Alexis211 <alexis211@gmail.com> | 2009-12-20 20:03:22 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-12-20 20:03:22 +0100 |
commit | 09353da6e91a0968ae24d4b4d97ed434520e6217 (patch) | |
tree | 016694d12e9dfebc773cef629eb56556d0024b22 /Source/Library/Common/FileStream.class.h | |
parent | 247070cc7e5ae117fd0d1b551fafdf5c13f0dd6b (diff) | |
parent | 18454dc8be12827a84c2ebc58aa5d31bb44e1e6a (diff) | |
download | Melon-09353da6e91a0968ae24d4b4d97ed434520e6217.tar.gz Melon-09353da6e91a0968ae24d4b4d97ed434520e6217.zip |
Merge branch 'framework'
Conflicts:
.gitignore
Diffstat (limited to 'Source/Library/Common/FileStream.class.h')
-rw-r--r-- | Source/Library/Common/FileStream.class.h | 43 |
1 files changed, 43 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..99bf0e8 --- /dev/null +++ b/Source/Library/Common/FileStream.class.h @@ -0,0 +1,43 @@ +#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; + 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); +}; + +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 |