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

Function extractTag

pdal/PipelineReaderJSON.cpp:162–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162std::string extractTag(NL::json& node, TagMap& tags)
163{
164 std::string tag;
165
166 auto it = node.find("tag");
167 if (it != node.end())
168 {
169 NL::json& val = *it;
170 if (!val.is_null())
171 {
172 if (val.is_string())
173 {
174 tag = val.get<std::string>();
175 if (tags.find(tag) != tags.end())
176 throw pdal_error("JSON pipeline: duplicate tag '" +
177 tag + "'.");
178 }
179 else
180 throw pdal_error("JSON pipeline: tag must be "
181 "specified as a string.");
182 }
183 node.erase(it);
184 std::string::size_type pos = 0;
185 if (!Stage::parseTagName(tag, pos) || pos != tag.size())
186 throw pdal_error("JSON pipeline: Invalid tag name '" + tag + "'. "
187 "Must start with letter. Remainder can be letters, "
188 "digits or underscores.");
189 }
190 return tag;
191}
192
193FileSpec extractFilename(NL::json& node)
194{

Callers 1

parsePipelineFunction · 0.85

Calls 4

findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected