Private method used to build a list of files and folders.
| 130 | |
| 131 | // Private method used to build a list of files and folders. |
| 132 | void unzipper::readEntries() |
| 133 | { |
| 134 | files_.clear(); |
| 135 | folders_.clear(); |
| 136 | |
| 137 | if (isOpen()) |
| 138 | { |
| 139 | unz_global_info64 oGlobalInfo; |
| 140 | int err = unzGetGlobalInfo64(zipFile_, &oGlobalInfo); |
| 141 | for (unsigned long i = 0; |
| 142 | i < oGlobalInfo.number_entry && err == UNZ_OK; i++) |
| 143 | { |
| 144 | char filename[FILENAME_MAX]; |
| 145 | unz_file_info64 oFileInfo; |
| 146 | |
| 147 | err = unzGetCurrentFileInfo64(zipFile_, &oFileInfo, filename, |
| 148 | sizeof(filename), nullptr, 0, nullptr, 0); |
| 149 | if (err == UNZ_OK) |
| 150 | { |
| 151 | char nLast = filename[oFileInfo.size_filename - 1]; |
| 152 | if (nLast == '/' || nLast == '\\') |
| 153 | { |
| 154 | folders_.push_back(filename); |
| 155 | } |
| 156 | else |
| 157 | { |
| 158 | files_.push_back(filename); |
| 159 | } |
| 160 | |
| 161 | err = unzGoToNextFile(zipFile_); |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | // Dump the currently open entry to the uotput stream |
| 168 | unzipper& unzipper::operator>>(std::ostream& os) |
nothing calls this directly
no test coverage detected