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

Method encodeTo

Fleece/Integration/MArray.hh:138–153  ·  view source on GitHub ↗

Writes the array to an Encoder as a single Value. */

Source from the content-addressed store, hash-verified

136
137 /** Writes the array to an Encoder as a single Value. */
138 void encodeTo(Encoder &enc) const {
139 if (!MCollection::isMutated()) {
140 enc << _array;
141 } else {
142 enc.beginArray(count());
143 uint32_t i = 0;
144 for (auto &v : _vec) {
145 if (v.isEmpty())
146 enc.writeValue(_array[i]);
147 else
148 v.encodeTo(enc);
149 ++i;
150 }
151 enc.endArray();
152 }
153 }
154
155 private:
156 /** Loads the Fleece Values of all items into _array.

Callers

nothing calls this directly

Calls 4

beginArrayMethod · 0.45
isEmptyMethod · 0.45
writeValueMethod · 0.45
endArrayMethod · 0.45

Tested by

no test coverage detected