diff options
Diffstat (limited to 'zen/file_io.h')
-rw-r--r-- | zen/file_io.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/zen/file_io.h b/zen/file_io.h index 33074d7e..b134e47a 100644 --- a/zen/file_io.h +++ b/zen/file_io.h @@ -19,6 +19,12 @@ namespace zen { +#ifdef FFS_WIN +static const char LINE_BREAK[] = "\r\n"; +#elif defined FFS_LINUX +static const char LINE_BREAK[] = "\n"; +#endif + //file IO optimized for sequential read/write accesses + better error reporting + long path support (following symlinks) #ifdef FFS_WIN @@ -37,6 +43,8 @@ public: size_t read(void* buffer, size_t bytesToRead); //throw FileError; returns actual number of bytes read bool eof() { return eofReached; } //end of file reached + const Zstring& getFilename() const { return filename_; } + private: FileInput(const FileInput&); FileInput& operator=(const FileInput&); @@ -61,6 +69,8 @@ public: void write(const void* buffer, size_t bytesToWrite); //throw FileError + const Zstring& getFilename() const { return filename_; } + private: FileOutput(const FileOutput&); FileOutput& operator=(const FileOutput&); |