| 243 | } |
| 244 | |
| 245 | node_type node::type() const |
| 246 | { |
| 247 | if (is_null()) |
| 248 | return node_type::null; |
| 249 | if (std::holds_alternative<integer>(m_data)) |
| 250 | return node_type::integer; |
| 251 | if (std::holds_alternative<number>(m_data)) |
| 252 | return node_type::number; |
| 253 | if (std::holds_alternative<boolean>(m_data)) |
| 254 | return node_type::boolean; |
| 255 | if (std::holds_alternative<string>(m_data)) |
| 256 | return node_type::string; |
| 257 | if (std::holds_alternative<object>(m_data)) |
| 258 | return node_type::object; |
| 259 | if (std::holds_alternative<array>(m_data)) |
| 260 | return node_type::array; |
| 261 | } |
| 262 | |
| 263 | std::string node::dump(bool root) const |
| 264 | { |