MCPcopy Create free account
hub / github.com/Kitware/VTK / asString

Method asString

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:3066–3090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3064}
3065
3066String Value::asString() const {
3067 switch (type()) {
3068 case nullValue:
3069 return "";
3070 case stringValue: {
3071 if (value_.string_ == nullptr)
3072 return "";
3073 unsigned this_len;
3074 char const* this_str;
3075 decodePrefixedString(this->isAllocated(), this->value_.string_, &this_len,
3076 &this_str);
3077 return String(this_str, this_len);
3078 }
3079 case booleanValue:
3080 return value_.bool_ ? "true" : "false";
3081 case intValue:
3082 return valueToString(value_.int_);
3083 case uintValue:
3084 return valueToString(value_.uint_);
3085 case realValue:
3086 return valueToString(value_.real_);
3087 default:
3088 JSON_FAIL_MESSAGE("Type is not convertible to string");
3089 }
3090}
3091
3092Value::Int Value::asInt() const {
3093 switch (type()) {

Callers 15

ProcessJSONMethod · 0.80
GetStringValueFunction · 0.80
ProcessElementFunction · 0.80
ParseRootMethod · 0.80
ExtractGeoJSONFeatureMethod · 0.80
SetByteOrderMethod · 0.80
SetLanguageMethod · 0.80
SetFormatMethod · 0.80
SetFileNamesMethod · 0.80
SetFunctionNamesMethod · 0.80

Calls 4

decodePrefixedStringFunction · 0.85
StringFunction · 0.85
valueToStringFunction · 0.85
typeEnum · 0.50

Tested by

no test coverage detected