MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / OpenFile

Method OpenFile

Sources/Shared/IO/PakFile.cpp:504–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502 }
503
504 std::unique_ptr<Stream> PakFile::OpenFile(std::uint64_t hashedPath, std::int32_t bufferSize)
505 {
506 DEATH_ASSERT(_useHashIndex, "Hashed path can only be used with hash-indexed .pak files", nullptr);
507
508 Item* foundItem = FindItemByHash(hashedPath);
509 if DEATH_UNLIKELY(foundItem == nullptr || (foundItem->Flags & ItemFlags::Directory) == ItemFlags::Directory) {
510 return nullptr;
511 }
512
513 PakPreferredCompression compression = PakPreferredCompression(std::uint32_t(foundItem->Flags & ItemFlags::CompressionFlags) >> CompressionFlagsShift);
514 switch (compression) {

Callers 2

ExtractPakFileMethod · 0.80
OpenContentFileMethod · 0.80

Calls 2

DEATH_ASSERTFunction · 0.85
DEATH_UNLIKELYFunction · 0.70

Tested by

no test coverage detected