MCPcopy Create free account
hub / github.com/couchbase/fleece / pathString

Method pathString

Fleece/Core/DeepIterator.cc:106–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105
106 std::string DeepIterator::pathString() const {
107 std::stringstream s;
108 for (auto &component : _path) {
109 if (component.key) {
110 bool quote = false;
111 for (auto c : component.key) {
112 if (!isalnum(c) && c != '_') {
113 quote = true;
114 break;
115 }
116 }
117 s << (quote ? "[\"" : ".");
118 s.write((char*)component.key.buf, component.key.size);
119 if (quote)
120 s << "\"]";
121 } else {
122 s << '[' << component.index << ']';
123 }
124 }
125 return s.str();
126 }
127
128
129 std::string DeepIterator::jsonPointer() const {

Callers 1

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected