| 104 | } |
| 105 | |
| 106 | void 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 | |
| 126 | void toJSON(const MetadataNode& m, std::ostream& o, int level) |
| 127 | { |
no test coverage detected