MCPcopy Create free account
hub / github.com/PDAL/PDAL / fetchBinary

Method fetchBinary

io/SlpkReader.cpp:193–218  ·  view source on GitHub ↗

fetch data using arbiter to get a char vector

Source from the content-addressed store, hash-verified

191
192// fetch data using arbiter to get a char vector
193std::vector<char> SlpkInterface::fetchBinary(std::string url, std::string attNum,
194 std::string ext) const
195{
196 std::vector<char> output;
197
198 url += attNum + ext;
199
200 auto li = m_locMap.find(url);
201 if (li != m_locMap.end())
202 {
203 const Location& loc = li->second;
204
205 const char *c = reinterpret_cast<const char *>(m_ctx.addr()) + loc.m_pos;
206 if (FileUtils::extension(url) != ".gz")
207 output.assign(c, c + loc.m_length);
208 else
209 {
210 GzipDecompressor decomp(
211 [&output](char *buf, size_t bufsize)
212 {output.insert(output.end(), buf, buf + bufsize);});
213 decomp.decompress(c, loc.m_length);
214 decomp.done();
215 }
216 }
217 return output;
218}
219
220} //namespace pdal

Callers

nothing calls this directly

Calls 7

extensionFunction · 0.85
addrMethod · 0.80
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
decompressMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected