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

Method placeItem

Fleece/Core/Encoder.cc:201–211  ·  view source on GitHub ↗

Adds an empty Value to the current collection's item list and returns a pointer to it. Caller is responsible for initializing the Value.

Source from the content-addressed store, hash-verified

199 // Adds an empty Value to the current collection's item list and returns a pointer to it.
200 // Caller is responsible for initializing the Value.
201 uint8_t* Encoder::placeItem() {
202 throwIf(_blockedOnKey, EncodeError, "need a key before this value");
203 if (_writingKey) {
204 _writingKey = false;
205 } else {
206 if (_items->tag == kDictTag)
207 _blockedOnKey = _writingKey = true;
208 }
209
210 return (uint8_t*) _items->push_back_new();
211 }
212
213 // Writes blank space for a Value of the given size and returns a pointer to it.
214 template <bool canInline>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected