summaryrefslogtreecommitdiff
path: root/Source/Library/Common
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-12-20 16:30:30 +0100
committerAlexis211 <alexis211@gmail.com>2009-12-20 16:30:30 +0100
commit13d720389a01161a327a30918ad7ac9eec4a3d6c (patch)
treee1b6ebb12f00e476284684c8deb4a513c4960e2a /Source/Library/Common
parent2d3c5a9c47d99c8f4f5561f9eae16497c1cde63a (diff)
downloadMelon-13d720389a01161a327a30918ad7ac9eec4a3d6c.tar.gz
Melon-13d720389a01161a327a30918ad7ac9eec4a3d6c.zip
[not tested] Introduced StreamApp.class
Diffstat (limited to 'Source/Library/Common')
-rw-r--r--Source/Library/Common/FileStream.class.cpp13
-rw-r--r--Source/Library/Common/FileStream.class.h2
2 files changed, 9 insertions, 6 deletions
diff --git a/Source/Library/Common/FileStream.class.cpp b/Source/Library/Common/FileStream.class.cpp
index 6154b2f..322e9aa 100644
--- a/Source/Library/Common/FileStream.class.cpp
+++ b/Source/Library/Common/FileStream.class.cpp
@@ -4,11 +4,16 @@
// INPUT FILE STREAM
// ********************
-FileIStream::FileIStream(const String &filename, u8int encoding, FSNode start) {
+FileIStream::FileIStream(const String &filename, u8int encoding, FSNode start) : m_start(start) {
m_file = new File(filename, FM_READ, start);
m_encoding = encoding;
}
+FileIStream::FileIStream(u8int encoding, FSNode start) : m_start(start) {
+ m_file = 0;
+ m_encoding = encoding;
+}
+
FileIStream::~FileIStream() {
if (m_file != 0) {
m_file->close();
@@ -33,11 +38,7 @@ String FileIStream::read() {
if (m_filenames == 0) {
return "";
} else {
-#ifdef THIS_IS_MELON_KERNEL
- m_file = new File(m_filenames->v(), FM_READ);
-#else
- m_file = new File(m_filenames->v(), FM_READ, FS::cwdNode());
-#endif
+ m_file = new File(m_filenames->v(), FM_READ, m_start);
m_filenames = m_filenames->delThis();
}
}
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);