MCPcopy Create free account
hub / github.com/ComodoSecurity/openedr / asString

Method asString

edrav2/eprj/jsoncpp/src/lib_json/json_value.cpp:682–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680}
681
682JSONCPP_STRING Value::asString() const {
683 switch (type_) {
684 case nullValue:
685 return "";
686 case stringValue: {
687 if (value_.string_ == nullptr)
688 return "";
689 unsigned this_len;
690 char const* this_str;
691 decodePrefixedString(this->allocated_, this->value_.string_, &this_len,
692 &this_str);
693 return JSONCPP_STRING(this_str, this_len);
694 }
695 case booleanValue:
696 return value_.bool_ ? "true" : "false";
697 case intValue:
698 return valueToString(value_.int_);
699 case uintValue:
700 return valueToString(value_.uint_);
701 case realValue:
702 return valueToString(value_.real_);
703 default:
704 JSON_FAIL_MESSAGE("Type is not convertible to string");
705 }
706}
707
708#ifdef JSON_USE_CPPTL
709CppTL::ConstString Value::asConstString() const {

Callers 15

readObjectMethod · 0.80
newStreamWriterMethod · 0.80
printValueTreeFunction · 0.80
JSONTEST_FIXTUREFunction · 0.80
test_server.cppFile · 0.80
test_client.cppFile · 0.80
test_common.cppFile · 0.80
sayHelloMethod · 0.80
getErrorMessageMethod · 0.80
throwErrorExceptionMethod · 0.80

Calls 2

decodePrefixedStringFunction · 0.85
valueToStringFunction · 0.85

Tested by 2

sayHelloMethod · 0.64
GetProcedureNameMethod · 0.64