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

Function get

pdal/util/Extractor.hpp:111–125  ·  view source on GitHub ↗

Extract a string of a particular size from the buffer. Trim trailing null bytes. \param s String to extract to. \param size Number of bytes to extract from buffer into string. */

Source from the content-addressed store, hash-verified

109 \param size Number of bytes to extract from buffer into string.
110 */
111 void get(std::string& s, size_t size)
112 {
113 s = std::string(m_gptr, size);
114 m_gptr += size;
115 while (size)
116 {
117 size--;
118 if (s[size] != '\0')
119 {
120 s.resize(size + 1);
121 return;
122 }
123 }
124 s.clear();
125 }
126
127 /**
128 Extract data to char vector. Vector must be sized to indicate

Callers

nothing calls this directly

Calls 4

resizeMethod · 0.80
clearMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected