MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / readEntries

Method readEntries

extlibs/elzip/src/unzipper.cpp:132–165  ·  view source on GitHub ↗

Private method used to build a list of files and folders.

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 5

unzGetGlobalInfo64Function · 0.85
unzGetCurrentFileInfo64Function · 0.85
unzGoToNextFileFunction · 0.85
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected