| 91 | } |
| 92 | |
| 93 | void ZipArchive::close() |
| 94 | { |
| 95 | // Flush new files. |
| 96 | if (!m_newFiles.empty()) |
| 97 | { |
| 98 | const size_t fileCount = m_newFiles.size(); |
| 99 | std::vector<const char*> filePaths; |
| 100 | for (size_t i = 0; i < fileCount; i++) |
| 101 | { |
| 102 | filePaths.push_back(m_newFiles[i].path.c_str()); |
| 103 | } |
| 104 | zip_create(m_archivePath, filePaths.data(), fileCount); |
| 105 | m_newFiles.clear(); |
| 106 | } |
| 107 | |
| 108 | closeFile(); |
| 109 | |
| 110 | delete[] m_entries; |
| 111 | m_entries = nullptr; |
| 112 | m_curFile = INVALID_FILE; |
| 113 | } |
| 114 | |
| 115 | // File Access |
| 116 | bool ZipArchive::openFile(const char *file) |
no test coverage detected