Couchbase Lite C
Couchbase Lite C API
Loading...
Searching...
No Matches
FLMutable.h File Reference
#include "FLValue.h"
#include <stdarg.h>

Go to the source code of this file.

Macros

#define _FLMUTABLE_H

Enumerations

enum  FLCopyFlags { kFLDefaultCopy = 0 , kFLDeepCopy = 1 , kFLCopyImmutables = 2 , kFLDeepCopyImmutables = (kFLDeepCopy | kFLCopyImmutables) }
 Option flags for making mutable copies of values. More...

Functions

NODISCARD FLEECE_PUBLIC FLSlot FLMutableArray_Set (FLMutableArray, uint32_t index)
 Returns an FLSlot that refers to the given index of the given array.
NODISCARD FLEECE_PUBLIC FLSlot FLMutableArray_Append (FLMutableArray)
 Appends a null value to the array and returns an FLSlot that refers to that position.
NODISCARD FLEECE_PUBLIC FLSlot FLMutableDict_Set (FLMutableDict, FLString key)
 Returns an FLSlot that refers to the given key/value pair of the given dictionary.
FLEECE_PUBLIC void FLSlot_SetNull (FLSlot)
 Stores a JSON null into a slot.
FLEECE_PUBLIC void FLSlot_SetBool (FLSlot, bool)
 Stores a boolean into a slot.
FLEECE_PUBLIC void FLSlot_SetInt (FLSlot, int64_t)
 Stores an integer into a slot.
FLEECE_PUBLIC void FLSlot_SetUInt (FLSlot, uint64_t)
 Stores an unsigned int into a slot.
FLEECE_PUBLIC void FLSlot_SetFloat (FLSlot, float)
 Stores a float into a slot.
FLEECE_PUBLIC void FLSlot_SetDouble (FLSlot, double)
 Stores a double into a slot.
FLEECE_PUBLIC void FLSlot_SetString (FLSlot, FLString)
 Stores a UTF-8 string into a slot.
FLEECE_PUBLIC void FLSlot_SetData (FLSlot, FLSlice)
 Stores a data blob into a slot.
FLEECE_PUBLIC void FLSlot_SetValue (FLSlot, FLValue)
 Stores an FLValue into a slot.
void FLSlot_SetArray (FLSlot slot, FLArray array)
void FLSlot_SetDict (FLSlot slot, FLDict dict)
NODISCARD FLEECE_PUBLIC FLValue FLValue_NewWithFormat (const char *format,...) __printflike(1
 Translates the JSON-style format string into a tree of mutable Fleece objects, adding values from the following arguments wherever a printf-style % specifier appears.
NODISCARD FLEECE_PUBLIC FLValue NODISCARD FLEECE_PUBLIC FLValue FLValue_NewWithFormatV (const char *format, va_list args)
 Variant of FLValue_NewWithFormat that takes a pre-existing va_list.
FLEECE_PUBLIC void FLMutableArray_UpdateWithFormat (FLMutableArray, const char *format,...) __printflike(2
 Like FLValue_NewWithFormat, except it operates on an existing mutable array.
FLEECE_PUBLIC void FLEECE_PUBLIC void FLMutableDict_UpdateWithFormat (FLMutableDict, const char *format,...) __printflike(2
 Like FLValue_NewWithFormat, except it operates on an existing mutable dict.
FLEECE_PUBLIC void FLEECE_PUBLIC void FLEECE_PUBLIC void FLValue_UpdateWithFormatV (FLValue, const char *format, va_list args)
 Like FLMutableArray_UpdateWithFormat / FLMutableDict_UpdateWithFormat but takes a pre-existing va_list.
Mutable Arrays
NODISCARD FLEECE_PUBLIC FLMutableArray FL_NULLABLE FLArray_MutableCopy (FLArray FL_NULLABLE, FLCopyFlags)
 Creates a new mutable Array that's a copy of the source Array.
NODISCARD FLEECE_PUBLIC FLMutableArray FL_NULLABLE FLMutableArray_New (void)
 Creates a new empty mutable Array.
FLMutableArray FL_NULLABLE FLMutableArray_Retain (FLMutableArray FL_NULLABLE d)
 Increments the ref-count of a mutable Array.
void FLMutableArray_Release (FLMutableArray FL_NULLABLE d)
 Decrements the refcount of (and possibly frees) a mutable Array.
FLEECE_PUBLIC FLArray FL_NULLABLE FLMutableArray_GetSource (FLMutableArray FL_NULLABLE)
 If the Array was created by FLArray_MutableCopy, returns the original source Array.
FLEECE_PUBLIC bool FLMutableArray_IsChanged (FLMutableArray FL_NULLABLE)
 Returns true if the Array has been changed from the source it was copied from.
FLEECE_PUBLIC void FLMutableArray_SetChanged (FLMutableArray FL_NULLABLE, bool changed)
 Sets or clears the mutable Array's "changed" flag.
FLEECE_PUBLIC void FLMutableArray_Insert (FLMutableArray FL_NULLABLE array, uint32_t firstIndex, uint32_t count)
 Inserts a contiguous range of JSON null values into the array.
FLEECE_PUBLIC void FLMutableArray_Remove (FLMutableArray FL_NULLABLE array, uint32_t firstIndex, uint32_t count)
 Removes contiguous items from the array.
FLEECE_PUBLIC void FLMutableArray_Resize (FLMutableArray FL_NULLABLE array, uint32_t size)
 Changes the size of an array.
NODISCARD FLEECE_PUBLIC FLMutableArray FL_NULLABLE FLMutableArray_GetMutableArray (FLMutableArray FL_NULLABLE, uint32_t index)
 Convenience function for getting an array-valued property in mutable form.
NODISCARD FLEECE_PUBLIC FLMutableDict FL_NULLABLE FLMutableArray_GetMutableDict (FLMutableArray FL_NULLABLE, uint32_t index)
 Convenience function for getting an array-valued property in mutable form.
void FLMutableArray_SetNull (FLMutableArray, uint32_t index)
 Stores a JSON null value into an array.
void FLMutableArray_SetBool (FLMutableArray, uint32_t index, bool)
 Stores a boolean value into an array.
void FLMutableArray_SetInt (FLMutableArray, uint32_t index, int64_t)
 Stores an integer into an array.
void FLMutableArray_SetUInt (FLMutableArray, uint32_t index, uint64_t)
 Stores an unsigned integer into an array.
void FLMutableArray_SetFloat (FLMutableArray, uint32_t index, float)
 Stores a 32-bit floating-point number into an array.
void FLMutableArray_SetDouble (FLMutableArray, uint32_t index, double)
 Stores a 64-bit floating point number into an array.
void FLMutableArray_SetString (FLMutableArray, uint32_t index, FLString)
 Stores a UTF-8-encoded string into an array.
void FLMutableArray_SetData (FLMutableArray, uint32_t index, FLSlice)
 Stores a binary data blob into an array.
void FLMutableArray_SetValue (FLMutableArray, uint32_t index, FLValue)
 Stores a Fleece value into an array.
void FLMutableArray_SetArray (FLMutableArray, uint32_t index, FLArray)
 Stores a Fleece array into an array.
void FLMutableArray_SetDict (FLMutableArray, uint32_t index, FLDict)
 Stores a Fleece dictionary into an array.
void FLMutableArray_AppendNull (FLMutableArray)
 Appends a JSON null value to an array.
void FLMutableArray_AppendBool (FLMutableArray, bool)
 Appends a boolean value to an array.
void FLMutableArray_AppendInt (FLMutableArray, int64_t)
 Appends an integer to an array.
void FLMutableArray_AppendUInt (FLMutableArray, uint64_t)
 Appends an unsigned integer to an array.
void FLMutableArray_AppendFloat (FLMutableArray, float)
 Appends a 32-bit floating-point number to an array.
void FLMutableArray_AppendDouble (FLMutableArray, double)
 Appends a 64-bit floating point number to an array.
void FLMutableArray_AppendString (FLMutableArray, FLString)
 Appends a UTF-8-encoded string to an array.
void FLMutableArray_AppendData (FLMutableArray, FLSlice)
 Appends a binary data blob to an array.
void FLMutableArray_AppendValue (FLMutableArray, FLValue)
 Appends a Fleece value to an array.
void FLMutableArray_AppendArray (FLMutableArray, FLArray)
 Appends a Fleece array to an array.
void FLMutableArray_AppendDict (FLMutableArray, FLDict)
 Appends a Fleece dictionary to an array.
Mutable dictionaries
FLEECE_PUBLIC FLMutableDict FL_NULLABLE FLDict_MutableCopy (FLDict FL_NULLABLE source, FLCopyFlags)
 Creates a new mutable Dict that's a copy of the source Dict.
FLEECE_PUBLIC FLMutableDict FL_NULLABLE FLMutableDict_New (void)
 Creates a new empty mutable Dict.
FLMutableDict FL_NULLABLE FLMutableDict_Retain (FLMutableDict FL_NULLABLE d)
 Increments the ref-count of a mutable Dict.
void FLMutableDict_Release (FLMutableDict FL_NULLABLE d)
 Decrements the refcount of (and possibly frees) a mutable Dict.
FLEECE_PUBLIC FLDict FL_NULLABLE FLMutableDict_GetSource (FLMutableDict FL_NULLABLE)
 If the Dict was created by FLDict_MutableCopy, returns the original source Dict.
FLEECE_PUBLIC bool FLMutableDict_IsChanged (FLMutableDict FL_NULLABLE)
 Returns true if the Dict has been changed from the source it was copied from.
FLEECE_PUBLIC void FLMutableDict_SetChanged (FLMutableDict FL_NULLABLE, bool)
 Sets or clears the mutable Dict's "changed" flag.
FLEECE_PUBLIC void FLMutableDict_Remove (FLMutableDict FL_NULLABLE, FLString key)
 Removes the value for a key.
FLEECE_PUBLIC void FLMutableDict_RemoveAll (FLMutableDict FL_NULLABLE)
 Removes all keys and values.
FLEECE_PUBLIC FLMutableArray FL_NULLABLE FLMutableDict_GetMutableArray (FLMutableDict FL_NULLABLE, FLString key)
 Convenience function for getting an array-valued property in mutable form.
FLEECE_PUBLIC FLMutableDict FL_NULLABLE FLMutableDict_GetMutableDict (FLMutableDict FL_NULLABLE, FLString key)
 Convenience function for getting a dict-valued property in mutable form.
void FLMutableDict_SetNull (FLMutableDict, FLString key)
 Stores a JSON null value into a mutable dictionary.
void FLMutableDict_SetBool (FLMutableDict, FLString key, bool)
 Stores a boolean value into a mutable dictionary.
void FLMutableDict_SetInt (FLMutableDict, FLString key, int64_t)
 Stores an integer into a mutable dictionary.
void FLMutableDict_SetUInt (FLMutableDict, FLString key, uint64_t)
 Stores an unsigned integer into a mutable dictionary.
void FLMutableDict_SetFloat (FLMutableDict, FLString key, float)
 Stores a 32-bit floating-point number into a mutable dictionary.
void FLMutableDict_SetDouble (FLMutableDict, FLString key, double)
 Stores a 64-bit floating point number into a mutable dictionary.
void FLMutableDict_SetString (FLMutableDict, FLString key, FLString)
 Stores a UTF-8-encoded string into a mutable dictionary.
void FLMutableDict_SetData (FLMutableDict, FLString key, FLSlice)
 Stores a binary data blob into a mutable dictionary.
void FLMutableDict_SetValue (FLMutableDict, FLString key, FLValue)
 Stores a Fleece value into a mutable dictionary.
void FLMutableDict_SetArray (FLMutableDict, FLString key, FLArray)
 Stores a Fleece array into a mutable dictionary.
void FLMutableDict_SetDict (FLMutableDict, FLString key, FLDict)
 Stores a Fleece dictionary into a mutable dictionary.
Creating string and data values
FLEECE_PUBLIC FLValue FL_NULLABLE FLValue_NewString (FLString)
 Allocates a string value on the heap.
FLEECE_PUBLIC FLValue FL_NULLABLE FLValue_NewData (FLSlice)
 Allocates a data/blob value on the heap.

Macro Definition Documentation

◆ _FLMUTABLE_H

#define _FLMUTABLE_H