! @brief return the type as string Returns the type name as string to be used in error messages - usually to indicate that a function was called on a wrong JSON type. @return a string representation of a the @a m_type member: Value type | return value ----------- | ------------- null | `"null"`
| 23408 | since 3.0.0 |
| 23409 | */ |
| 23410 | JSON_HEDLEY_RETURNS_NON_NULL |
| 23411 | const char* type_name() const noexcept |
| 23412 | { |
| 23413 | { |
| 23414 | switch (m_type) |
| 23415 | { |
| 23416 | case value_t::null: |
| 23417 | return "null"; |
| 23418 | case value_t::object: |
| 23419 | return "object"; |
| 23420 | case value_t::array: |
| 23421 | return "array"; |
| 23422 | case value_t::string: |
| 23423 | return "string"; |
| 23424 | case value_t::boolean: |
| 23425 | return "boolean"; |
| 23426 | case value_t::binary: |
| 23427 | return "binary"; |
| 23428 | case value_t::discarded: |
| 23429 | return "discarded"; |
| 23430 | default: |
| 23431 | return "number"; |
| 23432 | } |
| 23433 | } |
| 23434 | } |
| 23435 | |
| 23436 | |
| 23437 | private: |
no outgoing calls
no test coverage detected