| 18 | } |
| 19 | |
| 20 | std::string to_string(node_type type) |
| 21 | { |
| 22 | if (type == node_type::null) |
| 23 | return null_type.data(); |
| 24 | if (type == node_type::integer) |
| 25 | return int_type.data(); |
| 26 | if (type == node_type::number) |
| 27 | return float_type.data(); |
| 28 | if (type == node_type::string) |
| 29 | return string_type.data(); |
| 30 | if (type == node_type::boolean) |
| 31 | return bool_type.data(); |
| 32 | if (type == node_type::array) |
| 33 | return array_type.data(); |
| 34 | if (type == node_type::object) |
| 35 | return object_type.data(); |
| 36 | return ""; |
| 37 | } |
| 38 | |
| 39 | std::ostream& operator<<(std::ostream& os, const node_type& m) |
| 40 | { |