MCPcopy Create free account
hub / github.com/OSGeo/gdal / ToString

Method ToString

port/cpl_json.cpp:1054–1069  ·  view source on GitHub ↗

* Get value. * @param osDefault Default value. * @return String value. * */

Source from the content-addressed store, hash-verified

1052 *
1053 */
1054std::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.

Callers 15

TEST_FFunction · 0.45
SerializeJSONFunction · 0.45
MainMethod · 0.45
MainMethod · 0.45
MainMethod · 0.45
MainMethod · 0.45
SaveBitmapBufferedMethod · 0.45
ReportFeatureMethod · 0.45
MainMethod · 0.45
GDALInfoGetPositionMethod · 0.45
MainMethod · 0.45
GetFileMetadataMethod · 0.45

Calls 2

json_object_get_stringFunction · 0.85
emptyMethod · 0.45

Tested by 1

TEST_FFunction · 0.36