Conscience Core
Classes | Functions | Variables
conscience_utils::JSON Namespace Reference

Classes

class  CscJsonObject
 
class  CscJsonObjectReader
 
class  CscJsonParser
 
struct  JsonSerializableData
 
class  MissingRequiredPropertyException
 

Functions

string toJsonPointer (const string &propertyPath)
 
string mapToJson (const map< string, JsonSerializableData > &map, bool noNewLines)
 
template<typename T , typename... Ts>
bool holds_alternative (const boost::variant< Ts... > &v) noexcept
 
string stringToJsonString (const string &s)
 
string jsonSerializableDataToString (JsonSerializableData data)
 
string vectorToJson (const vector< JsonSerializableData > &list, bool noNewLines)
 
string pairsToJson (const vector< pair< string, JsonSerializableData >> &entries, bool noNewLines)
 
template<class TValue >
vector< JsonSerializableDatavectorToJsonSerializable (const vector< TValue > &theVector)
 
template<class TValue >
map< string, JsonSerializableDatamapToJsonSerializable (const map< string, TValue > &map)
 
template<class T >
getNumericValueFromJson (yyjson_val *jsonValue)
 
template<IsString T>
yyjson_mut_val * toJsonValue (const T &value, yyjson_mut_doc *doc)
 
yyjson_mut_val * mapToJsonObject (const map< string, string > &map, yyjson_mut_doc *doc)
 
template<IsNotString T>
yyjson_mut_val * toJsonValue (T &value, yyjson_mut_doc *doc)
 
template<class T >
yyjson_mut_val * toJsonValue (const vector< T > &valueList, yyjson_mut_doc *doc, bool clone=false)
 

Variables

template<class T >
concept IsString = std::is_same_v<T, string>
 
template<class T >
concept IsNotString = !IsString<T>
 

Function Documentation

◆ getNumericValueFromJson()

template<class T >
T conscience_utils::JSON::getNumericValueFromJson ( yyjson_val *  jsonValue)

◆ holds_alternative()

template<typename T , typename... Ts>
bool conscience_utils::JSON::holds_alternative ( const boost::variant< Ts... > &  v)
noexcept

◆ jsonSerializableDataToString()

string conscience_utils::JSON::jsonSerializableDataToString ( JsonSerializableData  data)

◆ mapToJson()

string conscience_utils::JSON::mapToJson ( const map< string, JsonSerializableData > &  map,
bool  noNewLines 
)

◆ mapToJsonObject()

yyjson_mut_val* conscience_utils::JSON::mapToJsonObject ( const map< string, string > &  map,
yyjson_mut_doc *  doc 
)
inline

◆ mapToJsonSerializable()

template<class TValue >
map<string, JsonSerializableData> conscience_utils::JSON::mapToJsonSerializable ( const map< string, TValue > &  map)

◆ pairsToJson()

string conscience_utils::JSON::pairsToJson ( const vector< pair< string, JsonSerializableData >> &  entries,
bool  noNewLines 
)

◆ stringToJsonString()

string conscience_utils::JSON::stringToJsonString ( const string &  s)
inline

◆ toJsonPointer()

string conscience_utils::JSON::toJsonPointer ( const string &  propertyPath)
inline

◆ toJsonValue() [1/3]

template<IsString T>
yyjson_mut_val * conscience_utils::JSON::toJsonValue ( const T &  value,
yyjson_mut_doc *  doc 
)

◆ toJsonValue() [2/3]

template<class T >
yyjson_mut_val* conscience_utils::JSON::toJsonValue ( const vector< T > &  valueList,
yyjson_mut_doc *  doc,
bool  clone = false 
)

◆ toJsonValue() [3/3]

template<IsNotString T>
yyjson_mut_val* conscience_utils::JSON::toJsonValue ( T &  value,
yyjson_mut_doc *  doc 
)

◆ vectorToJson()

string conscience_utils::JSON::vectorToJson ( const vector< JsonSerializableData > &  list,
bool  noNewLines 
)

◆ vectorToJsonSerializable()

template<class TValue >
vector<JsonSerializableData> conscience_utils::JSON::vectorToJsonSerializable ( const vector< TValue > &  theVector)

Variable Documentation

◆ IsNotString

template<class T >
concept conscience_utils::JSON::IsNotString = !IsString<T>

◆ IsString

template<class T >
concept conscience_utils::JSON::IsString = std::is_same_v<T, string>