MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetData

Method GetData

src/openrct2/object/Object.cpp:346–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344 }
345
346 std::vector<uint8_t> ObjectAsset::GetData() const
347 {
348 if (_zipPath.empty())
349 {
350 return File::ReadAllBytes(_path);
351 }
352
353 auto zipArchive = Zip::TryOpen(_zipPath, ZipAccess::read);
354 if (zipArchive != nullptr)
355 {
356 return zipArchive->GetFileData(_path);
357 }
358 return {};
359 }
360
361 std::unique_ptr<IStream> ObjectAsset::GetStream() const
362 {

Callers 13

TestEncodeDecodeMethod · 0.45
TestDecodeMethod · 0.45
LogActionFinishFunction · 0.45
SaveForNetworkMethod · 0.45
PacketClass · 0.45
LoadFromStreamMethod · 0.45
SaveTrackMethod · 0.45
LoadFromStreamMethod · 0.45
ExportPackedObjectMethod · 0.45
ParseImagesMethod · 0.45

Calls 4

ReadAllBytesFunction · 0.85
TryOpenFunction · 0.50
emptyMethod · 0.45
GetFileDataMethod · 0.45

Tested by 2

TestEncodeDecodeMethod · 0.36
TestDecodeMethod · 0.36