MCPcopy Create free account
hub / github.com/SOUI2/soui / asString

Method asString

third-part/jsoncpp/src/lib_json/json_value.cpp:697–720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

695}
696
697JSONCPP_STRING Value::asString() const {
698 switch (type_) {
699 case nullValue:
700 return "";
701 case stringValue:
702 {
703 if (value_.string_ == 0) return "";
704 unsigned this_len;
705 char const* this_str;
706 decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
707 return JSONCPP_STRING(this_str, this_len);
708 }
709 case booleanValue:
710 return value_.bool_ ? "true" : "false";
711 case intValue:
712 return valueToString(value_.int_);
713 case uintValue:
714 return valueToString(value_.uint_);
715 case realValue:
716 return valueToString(value_.real_);
717 default:
718 JSON_FAIL_MESSAGE("Type is not convertible to string");
719 }
720}
721
722#ifdef JSON_USE_CPPTL
723CppTL::ConstString Value::asConstString() const {

Callers 4

readObjectMethod · 0.80
newStreamWriterMethod · 0.80
printValueTreeFunction · 0.80
JSONTEST_FIXTUREFunction · 0.80

Calls 2

decodePrefixedStringFunction · 0.85
valueToStringFunction · 0.85

Tested by

no test coverage detected