diff options
author | vng <viktor.govako@gmail.com> | 2012-10-29 22:24:06 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:46:25 +0300 |
commit | 4ebdce7bb3b72f2d47a989b6e57908fc60a1fbc7 (patch) | |
tree | 52cfe1b1474a56ee9a864985ab72bd552ac72284 /coding/file_writer.cpp | |
parent | 2fe607e8d830945a3d05b64796e4b19bbdb68937 (diff) |
Add FileWriter::Reserve.
Diffstat (limited to 'coding/file_writer.cpp')
-rw-r--r-- | coding/file_writer.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/coding/file_writer.cpp b/coding/file_writer.cpp index 32ba752632..b5e4dd877f 100644 --- a/coding/file_writer.cpp +++ b/coding/file_writer.cpp @@ -55,6 +55,16 @@ void FileWriter::Flush() m_pFileData->Flush(); } +void FileWriter::Reserve(uint64_t size) +{ + if (size > 0) + { + m_pFileData->Seek(size-1); + uint8_t b = 0; + m_pFileData->Write(&b, 1); + } +} + void FileWriter::DeleteFileX(string const & fName) { (void)my::DeleteFileX(fName); |