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

Method placeValue

Fleece/Core/Encoder.cc:215–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213 // Writes blank space for a Value of the given size and returns a pointer to it.
214 template <bool canInline>
215 uint8_t* Encoder::placeValue(size_t size) {
216 byte *buf;
217 if (canInline && size <= 4) {
218 buf = placeItem();
219 if (size < 4)
220 buf[2] = buf[3] = 0;
221 if (size > 2)
222 _items->wide = true;
223 return buf;
224 } else {
225 writePointer(nextWritePos());
226 bool pad = (size & 1);
227 buf = _out.reserveSpace<byte>(size + pad);
228 if (pad)
229 buf[size] = 0;
230 }
231 return buf;
232 }
233
234 template <bool canInline>
235 uint8_t* Encoder::placeValue(tags tag, byte param, size_t size) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected