MCPcopy Index your code
hub / github.com/Kitware/CMake / asString

Method asString

Utilities/cmjsoncpp/src/lib_json/json_value.cpp:628–652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628String Value::asString() const {
629 switch (type()) {
630 case nullValue:
631 return "";
632 case stringValue: {
633 if (value_.string_ == nullptr)
634 return "";
635 unsigned this_len;
636 char const* this_str;
637 decodePrefixedString(this->isAllocated(), this->value_.string_, &this_len,
638 &this_str);
639 return String(this_str, this_len);
640 }
641 case booleanValue:
642 return value_.bool_ ? "true" : "false";
643 case intValue:
644 return valueToString(value_.int_);
645 case uintValue:
646 return valueToString(value_.uint_);
647 case realValue:
648 return valueToString(value_.real_);
649 default:
650 JSON_FAIL_MESSAGE("Type is not convertible to string");
651 }
652}
653
654Value::Int Value::asInt() const {
655 switch (type()) {

Callers 15

testSerializeSpdxJsonFunction · 0.80
ObjectPropsFilterFunction · 0.80
TraverseValueFunction · 0.80
readObjectMethod · 0.80
newStreamWriterMethod · 0.80
deserializeMethod · 0.80
ConditionHelperFunction · 0.80
EnvironmentHelperFunction · 0.80
PresetNameHelperFunction · 0.80
InitFromInfoMethod · 0.80
PackageResolveModeHelperFunction · 0.80

Calls 4

decodePrefixedStringFunction · 0.85
StringFunction · 0.85
valueToStringFunction · 0.85
typeClass · 0.50