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

Method List

apps/tools/Tools/commands/PboCommand.cpp:276–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274 QFBank bank;
275 bool bankReady = false;
276 if (verbose)
277 {
278 std::string bankName = StripPboExtension(pboPath);
279 if (bank.open(RString(bankName.c_str())))
280 {
281 bank.Lock();
282 bankReady = !bank.error();
283 }
284 }
285
286 for (const auto& e : info.entries)
287 {
288 long displaySize = e.compressed ? e.uncompressedSize : e.length;
289
290 std::cout << e.name;
291 int pad = 40 - static_cast<int>(e.name.size());
292 if (pad > 0)
293 std::cout << std::string(pad, ' ');
294 else
295 std::cout << " ";
296
297 std::cout << Poseidon::FormatSize(displaySize);
298 std::cout << " " << Poseidon::FormatTime(e.time);
299
300 if (e.compressed)
301 std::cout << " [compressed]";
302
303 if (verbose && e.compressed)
304 std::cout << " (" << Poseidon::FormatSize(e.length) << " stored)";
305
306 if (verbose && bankReady)
307 {
308 Ref<IFileBuffer> data = bank.Read(e.name.c_str());
309 if (data)
310 std::cout << " md5: " << Md5Hex(*data);
311 }
312
313 std::cout << std::endl;
314 }
315
316 if (verbose && bankReady)
317 bank.Unlock();
318
319 std::cout << "---" << std::endl;
320 std::cout << info.entries.size() << " files, " << Poseidon::FormatSize(info.totalSize) << " total";
321 if (verbose && info.totalStored != info.totalSize)
322 std::cout << " (" << Poseidon::FormatSize(info.totalStored) << " stored)";
323 std::cout << std::endl;
324
325 return 0;
326}
327
328int PboCommand::Show(const std::string& pboPath, const std::string& filePath)
329{
330 std::string bankName = StripPboExtension(pboPath);
331 QFBank bank;
332 if (!bank.open(RString(bankName.c_str())))
333 {

Callers

nothing calls this directly

Calls 12

InspectPboFunction · 0.85
FormatSizeFunction · 0.85
FormatTimeFunction · 0.85
Md5HexFunction · 0.85
sizeMethod · 0.80
StripPboExtensionFunction · 0.70
RStringClass · 0.50
openMethod · 0.45
LockMethod · 0.45
errorMethod · 0.45
ReadMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected