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

Method fetchJson

io/SlpkReader.cpp:173–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171
172
173std::string SlpkInterface::fetchJson(std::string filepath)
174{
175 filepath += ".json.gz";
176 auto li = m_locMap.find(filepath);
177 if (li == m_locMap.end())
178 throw pdal_error("Couldn't find file '" + filepath + "' in SLPK file '" +
179 m_filename + "'.");
180
181 Location& loc = li->second;
182
183 std::string output;
184 const char *c = reinterpret_cast<const char *>(m_ctx.addr()) + loc.m_pos;
185 GzipDecompressor decomp(
186 [&output](char *buf, size_t bufsize){output.append(buf, buf + bufsize);});
187 decomp.decompress(c, loc.m_length);
188 decomp.done();
189 return output;
190}
191
192// fetch data using arbiter to get a char vector
193std::vector<char> SlpkInterface::fetchBinary(std::string url, std::string attNum,

Callers

nothing calls this directly

Calls 6

addrMethod · 0.80
findMethod · 0.45
endMethod · 0.45
appendMethod · 0.45
decompressMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected