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

Function get

pdal/util/IStream.hpp:213–224  ·  view source on GitHub ↗

Fetch data from the stream into a string. NOTE - Stops when a null byte is encountered. Use a buffer/vector reader to read data with embedded nulls. \param s String to fill. \param size Maximum number of bytes to extract. */

Source from the content-addressed store, hash-verified

211 \param size Maximum number of bytes to extract.
212 */
213 PDAL_EXPORT void get(std::string& s, size_t size)
214 {
215 // Could do this by appending to a string with a stream, but this
216 // is probably fast enough for now (there's only a simple increment
217 // to advance an istream iterator, which you'd have to call in a loop).
218
219 // Zero-fill for null termination and to avoid reading uninitiallized
220 // memory when, for example, trying to read an empty file.
221 std::vector<char> buf(size + 1, 0);
222 m_stream->read(buf.data(), size);
223 s = buf.data();
224 }
225
226 /**
227 Fetch data from the stream into a vector of char.

Callers 15

getJsonMethod · 0.50
checkInvariantMethod · 0.50
checkInvariantMethod · 0.50
E57_INTERNAL_ACCESSFunction · 0.50
setupFileHeaderMethod · 0.50
runMethod · 0.50
registerPluginFunction · 0.50
PluginManager.cppFile · 0.50
namesMethod · 0.50
setLogMethod · 0.50
loadAllMethod · 0.50
l_loadAllMethod · 0.50

Calls 3

readMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected