diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:11:56 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:11:56 +0200 |
commit | 98ecf620f7de377dc8ae9ad7fbd1e3b24477e138 (patch) | |
tree | faadc6d8822c20cd3bc6f50b2a98e6c580585949 /shared/file_io.h | |
parent | 3.16 (diff) | |
download | FreeFileSync-98ecf620f7de377dc8ae9ad7fbd1e3b24477e138.tar.gz FreeFileSync-98ecf620f7de377dc8ae9ad7fbd1e3b24477e138.tar.bz2 FreeFileSync-98ecf620f7de377dc8ae9ad7fbd1e3b24477e138.zip |
3.17
Diffstat (limited to 'shared/file_io.h')
-rw-r--r-- | shared/file_io.h | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/shared/file_io.h b/shared/file_io.h index a1460f53..d311346a 100644 --- a/shared/file_io.h +++ b/shared/file_io.h @@ -7,8 +7,6 @@ #ifndef FILEIO_H_INCLUDED #define FILEIO_H_INCLUDED -#include <wx/stream.h> - #ifdef FFS_WIN #include <wx/msw/wrapwin.h> //includes "windows.h" #elif defined FFS_LINUX @@ -18,7 +16,7 @@ #include "zstring.h" #include "file_error.h" -namespace ffs3 +namespace zen { //file IO optimized for sequential read/write accesses + better error reporting + long path support (following symlinks) @@ -39,9 +37,7 @@ public: bool eof(); //end of file reached private: -#ifdef FFS_WIN bool eofReached; -#endif FileHandle fileHandle; const Zstring filename_; }; @@ -66,40 +62,6 @@ private: const Zstring filename_; }; - -//############# wxWidgets stream adapter ############# -// can be used as base classes (have virtual destructors) -class FileInputStream : public wxInputStream -{ -public: - FileInputStream(const Zstring& filename) : //throw (FileError) - fileObj(filename) {} - -private: - virtual size_t OnSysRead(void* buffer, size_t bufsize) //throw (FileError) - { - return fileObj.read(buffer, bufsize); - } - - FileInput fileObj; -}; - - -class FileOutputStream : public wxOutputStream -{ -public: - FileOutputStream(const Zstring& filename) : //throw (FileError) - fileObj(filename, FileOutput::ACC_OVERWRITE) {} - -private: - virtual size_t OnSysWrite(const void* buffer, size_t bufsize) //throw (FileError) - { - fileObj.write(buffer, bufsize); - return bufsize; - } - - FileOutput fileObj; -}; } #endif // FILEIO_H_INCLUDED |