MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / read

Method read

source/base/StarPackedAssetSource.cpp:159–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159ByteArray PackedAssetSource::read(String const& path) {
160 auto p = m_index.ptr(path);
161 if (!p)
162 throw AssetSourceException::format("Requested file '{}' does not exist in the packed assets file", path);
163
164 ByteArray data(p->second, 0);
165 m_packedFile->readFullAbsolute(p->first, data.ptr(), p->second);
166 return data;
167}
168
169}

Callers 2

buildMethod · 0.45
PackedAssetSourceMethod · 0.45

Calls 3

readFullAbsoluteMethod · 0.80
formatFunction · 0.50
ptrMethod · 0.45

Tested by

no test coverage detected