| 137 | } |
| 138 | |
| 139 | std::unordered_map<std::string, InfoNode> InfoNode::AsMap() const { |
| 140 | std::unordered_map<std::string, InfoNode> umap; |
| 141 | if (_index < _tree->_nodeOrInfos.size()) { |
| 142 | auto &node = _tree->_nodeOrInfos[_index]; |
| 143 | if (node.Kind == InfoKind::Object) { |
| 144 | auto &innerUmap = _tree->_mapChildren[node.Data.ChildIndex]; |
| 145 | for (auto &p: innerUmap) { |
| 146 | umap.insert({p.first, InfoNode(p.second, _tree)}); |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | return umap; |
| 151 | } |
| 152 | |
| 153 | InfoNode InfoNode::GetValue(std::string_view key) const { |
| 154 | if (_index < _tree->_nodeOrInfos.size()) { |
no test coverage detected