MCPcopy Create free account
hub / github.com/ValveSoftware/Proton / asString

Method asString

vrclient_x64/jsoncpp.cpp:3061–3087  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3059}
3060
3061std::string Value::asString() const {
3062 switch (type_) {
3063 case nullValue:
3064 return "";
3065 case stringValue:
3066 {
3067 if (value_.string_ == 0) return "";
3068 unsigned this_len;
3069 char const* this_str;
3070 decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
3071 return std::string(this_str, this_len);
3072 }
3073 case booleanValue:
3074 return value_.bool_ ? "true" : "false";
3075 case intValue:
3076 return valueToString(value_.int_);
3077 case uintValue:
3078 return valueToString(value_.uint_);
3079 case realValue:
3080 return valueToString(value_.real_);
3081 default:
3082 if ( default_value_ )
3083 return default_value_->asString();
3084 else
3085 return "";
3086 }
3087}
3088
3089#ifdef JSON_USE_CPPTL
3090CppTL::ConstString Value::asConstString() const {

Callers 4

json_convert_pathsFunction · 0.80
readObjectMethod · 0.80
newStreamWriterMethod · 0.80

Calls 2

decodePrefixedStringFunction · 0.85
valueToStringFunction · 0.85

Tested by

no test coverage detected