MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / confirmLocalHeaders

Method confirmLocalHeaders

src/Base/ZipHeader.cpp:175–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175bool ZipHeader::confirmLocalHeaders(std::istream& _zipfile)
176{
177 zipios::Entries::const_iterator it;
178 zipios::ZipCDirEntry* ent {};
179 int inconsistencies = 0;
180 zipios::ZipLocalEntry zlh;
181 for (it = _entries.begin(); it != _entries.end(); ++it) {
182 ent = static_cast<zipios::ZipCDirEntry*>((*it).get());
183 _vs.vseekg(_zipfile, ent->getLocalHeaderOffset(), std::ios::beg);
184 _zipfile >> zlh;
185 if (!_zipfile || zlh != *ent) {
186 inconsistencies++;
187 _zipfile.clear();
188 }
189 }
190 return !inconsistencies;
191}
192
193void ZipHeader::setError(std::string /*error_str*/)
194{

Callers

nothing calls this directly

Calls 6

vseekgMethod · 0.80
getLocalHeaderOffsetMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected