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

Function arrayEltToJSON

pdal/PDALUtils.cpp:106–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void arrayEltToJSON(const MetadataNode& m, std::ostream& o, int level)
107{
108 std::string indent(level * 2, ' ');
109 std::string value = m.jsonValue();
110 bool children = m.hasChildren();
111
112 // This is a case from XML. In JSON, you can't have two values.
113 if (!value.empty() && children)
114 {
115 o << value << "," << std::endl;
116 subnodesToJSON(m, o, level);
117 }
118 else if (!value.empty())
119 o << indent << value;
120 else
121 subnodesToJSON(m, o, level);
122 // There is the case where we have a name and no value to handle. What
123 // should be done?
124}
125
126void toJSON(const MetadataNode& m, std::ostream& o, int level)
127{

Callers 1

arrayToJSONFunction · 0.85

Calls 2

subnodesToJSONFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected