MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / saveIndex

Function saveIndex

src/OpenLoco/src/Objects/ObjectIndex.cpp:318–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316 }
317
318 static void saveIndex(const IndexHeader& header)
319 {
320 Core::Timer saveTimer;
321
322 FileStream stream;
323 const auto indexPath = Environment::getPathNoWarning(Environment::PathId::plugin1);
324 stream.open(indexPath, StreamMode::write);
325 if (!stream.isOpen())
326 {
327 Logging::error("Unable to save object index.");
328 return;
329 }
330 serialiseIndex(stream, header, _installedObjectList);
331
332 Logging::verbose("Saved object index in {} milliseconds.", saveTimer.elapsed());
333 }
334
335 static ObjectIndexEntry createPartialNewEntry(const ObjectHeader& objHeader, const fs::path filepath)
336 {

Callers 1

createIndexFunction · 0.70

Calls 7

getPathNoWarningFunction · 0.85
errorFunction · 0.85
serialiseIndexFunction · 0.85
verboseFunction · 0.85
openMethod · 0.80
isOpenMethod · 0.80
elapsedMethod · 0.80

Tested by

no test coverage detected