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

Method writeTo

Fleece/Tree/HashTree.cc:55–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 slice Leaf::keyString() const {return derefValue(_keyOffset).asString();}
54
55 uint32_t Leaf::writeTo(Encoder &enc, bool writeKey) const {
56 if (enc.base().containsAddress(this)) {
57 auto pos = int32_t((char*)this - (char*)enc.base().end());
58 return pos - (writeKey ? _keyOffset : _valueOffset);
59 } else {
60 if (writeKey)
61 enc.writeValue(key());
62 else
63 enc.writeValue(value());
64 return (uint32_t)enc.finishItem();
65 }
66 }
67
68 void Leaf::dump(std::ostream &out, unsigned indent) const {
69 char hashStr[30];

Callers

nothing calls this directly

Calls 11

keyClass · 0.85
containsAddressMethod · 0.80
InteriorClass · 0.70
baseMethod · 0.45
endMethod · 0.45
writeValueMethod · 0.45
finishItemMethod · 0.45
isLeafMethod · 0.45
nextWritePosMethod · 0.45
makeRelativeToMethod · 0.45
writeRawMethod · 0.45

Tested by

no test coverage detected