* Get value. * @param osDefault Default value. * @return String value. * */
| 1052 | * |
| 1053 | */ |
| 1054 | std::string CPLJSONObject::ToString(const std::string &osDefault) const |
| 1055 | { |
| 1056 | if (!m_osKeyForSet.empty()) |
| 1057 | return osDefault; |
| 1058 | if( m_poJsonObject /*&& json_object_get_type( TO_JSONOBJ(m_poJsonObject) ) == |
| 1059 | json_type_string*/ ) |
| 1060 | { |
| 1061 | const char *pszString = |
| 1062 | json_object_get_string(TO_JSONOBJ(m_poJsonObject)); |
| 1063 | if (nullptr != pszString) |
| 1064 | { |
| 1065 | return pszString; |
| 1066 | } |
| 1067 | } |
| 1068 | return osDefault; |
| 1069 | } |
| 1070 | |
| 1071 | /** |
| 1072 | * Get value by key. |