MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / CollectPboEntry

Function CollectPboEntry

apps/tools/Tools/commands/ScanCommand.cpp:468–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466};
467
468static void CollectPboEntry(const FileInfoO& fi, const FileBankType*, void* ctx)
469{
470 auto* c = static_cast<PboCollectorCtx*>(ctx);
471 std::string name = (const char*)fi.name;
472 auto dot = name.find_last_of('.');
473 std::string ext;
474 if (dot != std::string::npos)
475 {
476 ext = name.substr(dot);
477 for (auto& ch : ext)
478 ch = static_cast<char>(tolower(static_cast<unsigned char>(ch)));
479 }
480 if (ext == ".pbo")
481 return;
482
483 ScanItem item;
484 item.path = c->pboPath + "#" + name;
485 item.pboPath = c->pboPath;
486 item.entryName = name;
487 item.extension = ext;
488 item.size = fi.length;
489 item.category = CategorizeByExtension(ext);
490 c->items->push_back(std::move(item));
491}
492
493static std::string JsonEscape(const std::string& s)
494{

Callers

nothing calls this directly

Calls 1

CategorizeByExtensionFunction · 0.85

Tested by

no test coverage detected