summaryrefslogtreecommitdiff
path: root/zen/file_io.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:20:29 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:20:29 +0200
commitb8f13e45be884dc12884ebe8f3dcd9eecb23a106 (patch)
tree22a6d8b96815d626061ff3e2d432c13078fca5c4 /zen/file_io.h
parent5.4 (diff)
downloadFreeFileSync-b8f13e45be884dc12884ebe8f3dcd9eecb23a106.tar.gz
FreeFileSync-b8f13e45be884dc12884ebe8f3dcd9eecb23a106.tar.bz2
FreeFileSync-b8f13e45be884dc12884ebe8f3dcd9eecb23a106.zip
5.5
Diffstat (limited to 'zen/file_io.h')
-rw-r--r--zen/file_io.h10
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&);
bgstack15