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

Function extractOptions

pdal/PipelineReaderJSON.cpp:237–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237Options extractOptions(NL::json& node)
238{
239 Options options;
240
241 for (auto& it : node.items())
242 {
243 NL::json& subnode = it.value();
244 const std::string& name = it.key();
245
246 if (name == "plugin")
247 {
248 PluginManager<Stage>::loadPlugin(subnode.get<std::string>());
249
250 // Don't actually put a "plugin" option on
251 // any stage
252 continue;
253 }
254
255 if (subnode.is_array())
256 {
257 for (const NL::json& val : subnode)
258 if (val.is_object())
259 options.add(name, val);
260 else if (!extractOption(options, name, val))
261 throw pdal_error("JSON pipeline: Invalid value type for "
262 "option list '" + name + "'.");
263 }
264 else if (subnode.is_object())
265 options.add(name, subnode);
266 else if (!extractOption(options, name, subnode))
267 throw pdal_error("JSON pipeline: Value of stage option '" +
268 name + "' cannot be converted.");
269 }
270 node.clear();
271 return options;
272}
273
274std::string extractType(NL::json& node)
275{

Callers 1

parsePipelineFunction · 0.85

Calls 6

extractOptionFunction · 0.85
itemsMethod · 0.80
valueMethod · 0.45
keyMethod · 0.45
addMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected