diff options
author | vng <viktor.govako@gmail.com> | 2013-03-07 14:48:30 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:51:35 +0300 |
commit | 548926936703ed87ad839a78beb310c7f1ecb3de (patch) | |
tree | 510cac0049b9276b3094b0bda9561bc086f1d87b /coding/zip_creator.cpp | |
parent | b95ca9f18e29f4ee2c9b8b90bffbc04daf0611b5 (diff) |
Fix formatting according to code review.
Diffstat (limited to 'coding/zip_creator.cpp')
-rw-r--r-- | coding/zip_creator.cpp | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/coding/zip_creator.cpp b/coding/zip_creator.cpp index 557b6905f3..a9a8928906 100644 --- a/coding/zip_creator.cpp +++ b/coding/zip_creator.cpp @@ -13,33 +13,35 @@ namespace { - struct ZipHandle + +struct ZipHandle +{ + zipFile m_zipFile; + ZipHandle(string const & filePath) { - zipFile m_zipFile; - ZipHandle(string const & filePath) - { - m_zipFile = zipOpen(filePath.c_str(), 0); - } - ~ZipHandle() - { - if (m_zipFile) - zipClose(m_zipFile, NULL); - } - }; - - void CreateTMZip(tm_zip & res) + m_zipFile = zipOpen(filePath.c_str(), 0); + } + ~ZipHandle() { - time_t rawtime; - struct tm * timeinfo; - time ( &rawtime ); - timeinfo = localtime ( &rawtime ); - res.tm_sec = timeinfo->tm_sec; - res.tm_min = timeinfo->tm_min; - res.tm_hour = timeinfo->tm_hour; - res.tm_mday = timeinfo->tm_mday; - res.tm_mon = timeinfo->tm_mon; - res.tm_year = timeinfo->tm_year; + if (m_zipFile) + zipClose(m_zipFile, NULL); } +}; + +void CreateTMZip(tm_zip & res) +{ + time_t rawtime; + struct tm * timeinfo; + time ( &rawtime ); + timeinfo = localtime ( &rawtime ); + res.tm_sec = timeinfo->tm_sec; + res.tm_min = timeinfo->tm_min; + res.tm_hour = timeinfo->tm_hour; + res.tm_mday = timeinfo->tm_mday; + res.tm_mon = timeinfo->tm_mon; + res.tm_year = timeinfo->tm_year; +} + } bool CreateZipFromPathDeflatedAndDefaultCompression(string const & filePath, string const & zipFilePath) |