Couchbase Lite C
Couchbase Lite C API
|
An FLSlot is a temporary reference to an element of a mutable Array/Dict; its only purpose is to let you store a value into it, using the FLSlot_...
functions.
More...
Functions | |
MUST_USE_RESULT FLEECE_PUBLIC FLSlot | FLMutableArray_Set (FLMutableArray, uint32_t index) |
Returns an FLSlot that refers to the given index of the given array. More... | |
MUST_USE_RESULT FLEECE_PUBLIC FLSlot | FLMutableArray_Append (FLMutableArray) |
Appends a null value to the array and returns an FLSlot that refers to that position. More... | |
MUST_USE_RESULT FLEECE_PUBLIC FLSlot | FLMutableDict_Set (FLMutableDict, FLString key) |
Returns an FLSlot that refers to the given key/value pair of the given dictionary. More... | |
FLEECE_PUBLIC void | FLSlot_SetNull (FLSlot) |
Stores a JSON null into a slot. More... | |
FLEECE_PUBLIC void | FLSlot_SetBool (FLSlot, bool) |
Stores a boolean into a slot. More... | |
FLEECE_PUBLIC void | FLSlot_SetInt (FLSlot, int64_t) |
Stores an integer into a slot. More... | |
FLEECE_PUBLIC void | FLSlot_SetUInt (FLSlot, uint64_t) |
Stores an unsigned int into a slot. More... | |
FLEECE_PUBLIC void | FLSlot_SetFloat (FLSlot, float) |
Stores a float into a slot. More... | |
FLEECE_PUBLIC void | FLSlot_SetDouble (FLSlot, double) |
Stores a double into a slot. More... | |
FLEECE_PUBLIC void | FLSlot_SetString (FLSlot, FLString) |
Stores a UTF-8 string into a slot. More... | |
FLEECE_PUBLIC void | FLSlot_SetData (FLSlot, FLSlice) |
Stores a data blob into a slot. More... | |
FLEECE_PUBLIC void | FLSlot_SetValue (FLSlot, FLValue) |
Stores an FLValue into a slot. More... | |
static void | FLSlot_SetArray (FLSlot slot, FLArray array) |
static void | FLSlot_SetDict (FLSlot slot, FLDict dict) |
An FLSlot is a temporary reference to an element of a mutable Array/Dict; its only purpose is to let you store a value into it, using the FLSlot_...
functions.
Since there are three ways to store a value into a collection (array set, array append, dict set) and nine types of values that can be stored, that makes 27 setter functions. For efficiency, these are declared as inlines that call one of three functions to acquire a slot, and one of nine functions to store a value into it.
It's usually more convenient to use the typed functions like FLMutableArray_SetInt, but you might drop down to the lower level ones if you're creating an adapter between Fleece and a different data model, such as Apple's Foundation classes.
MUST_USE_RESULT FLEECE_PUBLIC FLSlot FLMutableArray_Append | ( | FLMutableArray | ) |
Appends a null value to the array and returns an FLSlot that refers to that position.
You store a value to it by calling one of the nine FLSlot_Set...
functions.
FLSlot
. Do not keep it around; any changes to the array invalidate it. MUST_USE_RESULT FLEECE_PUBLIC FLSlot FLMutableArray_Set | ( | FLMutableArray | , |
uint32_t | index | ||
) |
Returns an FLSlot that refers to the given index of the given array.
You store a value to it by calling one of the nine FLSlot_Set...
functions.
FLSlot
. Do not keep it around; any changes to the array invalidate it. MUST_USE_RESULT FLEECE_PUBLIC FLSlot FLMutableDict_Set | ( | FLMutableDict | , |
FLString | key | ||
) |
Returns an FLSlot that refers to the given key/value pair of the given dictionary.
You store a value to it by calling one of the nine FLSlot_Set...
functions.
FLSlot
. Do not keep it around; any changes to the dictionary invalidate it. FLEECE_PUBLIC void FLSlot_SetBool | ( | FLSlot | , |
bool | |||
) |
Stores a boolean into a slot.
FLEECE_PUBLIC void FLSlot_SetData | ( | FLSlot | , |
FLSlice | |||
) |
Stores a data blob into a slot.
FLEECE_PUBLIC void FLSlot_SetDouble | ( | FLSlot | , |
double | |||
) |
Stores a double
into a slot.
FLEECE_PUBLIC void FLSlot_SetFloat | ( | FLSlot | , |
float | |||
) |
Stores a float
into a slot.
FLEECE_PUBLIC void FLSlot_SetInt | ( | FLSlot | , |
int64_t | |||
) |
Stores an integer into a slot.
FLEECE_PUBLIC void FLSlot_SetNull | ( | FLSlot | ) |
Stores a JSON null into a slot.
FLEECE_PUBLIC void FLSlot_SetString | ( | FLSlot | , |
FLString | |||
) |
Stores a UTF-8 string into a slot.
FLEECE_PUBLIC void FLSlot_SetUInt | ( | FLSlot | , |
uint64_t | |||
) |
Stores an unsigned int into a slot.
FLEECE_PUBLIC void FLSlot_SetValue | ( | FLSlot | , |
FLValue | |||
) |
Stores an FLValue into a slot.