MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / nodeToString

Method nodeToString

src/common/types/value/value.cpp:1108–1128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1106}
1107
1108std::string Value::nodeToString() const {
1109 if (children[0]->isNull_) {
1110 // NODE is represented as STRUCT. We don't have a way to represent STRUCT as null.
1111 // Instead, we check the internal ID entry to decide if a NODE is NULL.
1112 return "";
1113 }
1114 std::string result = "{";
1115 auto fieldNames = StructType::getFieldNames(dataType);
1116 for (auto i = 0u; i < childrenSize; ++i) {
1117 if (children[i]->isNull_) {
1118 // Avoid printing null key value pair.
1119 continue;
1120 }
1121 if (i != 0) {
1122 result += ", ";
1123 }
1124 result += fieldNames[i] + ": " + children[i]->toString();
1125 }
1126 result += "}";
1127 return result;
1128}
1129
1130std::string Value::relToString() const {
1131 if (children[3]->isNull_) {

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected