MCPcopy Create free account
hub / github.com/catboost/catboost / UnpackArchive

Function UnpackArchive

tools/archiver/main.cpp:438–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436};
437
438static void UnpackArchive(const TString& archive, const TFsPath& dir = TFsPath()) {
439 TMappingReader mappingReader(archive);
440 const TArchiveReader& reader = mappingReader.Reader;
441 const size_t count = reader.Count();
442 for (size_t i = 0; i < count; ++i) {
443 const TString key = reader.KeyByIndex(i);
444 const TString fileName = CutFirstSlash(key);
445 if (!Quiet) {
446 Cerr << archive << " --> " << fileName << Endl;
447 }
448 const TFsPath path(dir / fileName);
449 path.Parent().MkDirs();
450 TAutoPtr<IInputStream> in = reader.ObjectByKey(key);
451 TFixedBufferFileOutput out(path);
452 TransferData(in.Get(), &out);
453 out.Finish();
454 }
455}
456
457static void ListArchive(const TString& archive, bool cutSlash) {
458 TMappingReader mappingReader(archive);

Callers 1

mainFunction · 0.85

Calls 10

CutFirstSlashFunction · 0.85
TransferDataFunction · 0.85
MkDirsMethod · 0.80
ParentMethod · 0.80
TFsPathClass · 0.50
CountMethod · 0.45
KeyByIndexMethod · 0.45
ObjectByKeyMethod · 0.45
GetMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected