diff options
Diffstat (limited to 'CPP/Windows/FileIO.h')
-rw-r--r-- | CPP/Windows/FileIO.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CPP/Windows/FileIO.h b/CPP/Windows/FileIO.h index 276e595e..85cae631 100644 --- a/CPP/Windows/FileIO.h +++ b/CPP/Windows/FileIO.h @@ -244,6 +244,7 @@ public: bool SetMTime(const FILETIME *mTime) throw(); bool WritePart(const void *data, UInt32 size, UInt32 &processedSize) throw(); bool Write(const void *data, UInt32 size, UInt32 &processedSize) throw(); + bool WriteFull(const void *data, size_t size) throw(); bool SetEndOfFile() throw(); bool SetLength(UInt64 length) throw(); }; @@ -315,6 +316,16 @@ public: bool Create(const char *name, bool createAlways); bool Open(const char *name, DWORD creationDisposition); ssize_t write_full(const void *data, size_t size, size_t &processed) throw(); + + bool WriteFull(const void *data, size_t size) throw() + { + size_t processed; + ssize_t res = write_full(data, size, processed); + if (res == -1) + return false; + return processed == size; + } + bool SetLength(UInt64 length) throw(); bool SetTime(const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime) throw(); bool SetMTime(const FILETIME *mTime) throw(); |