28#define FLEECE_PUBLIC __declspec(dllexport)
30#define FLEECE_PUBLIC __declspec(dllimport)
51 typedef const struct _FLDict*
FLDict;
204 bool canonicalForm)
FLAPI;
274 #define FLTimestampNone INT64_MIN
685 uint32_t _private3, private4;
938 void *context)
FLAPI;
1020 bool uniqueStrings)
FLAPI;
1053 bool reuseStrings,
bool externPointers)
FLAPI;
#define FLPURE
Definition: Base.h:89
#define NONNULL
Definition: Base.h:68
#define MUST_USE_RESULT
Definition: Base.h:53
#define FLAPI
Definition: FLSlice.h:31
#define FLEECE_PUBLIC
Definition: Fleece.h:33
static void FLMutableArray_SetInt(FLMutableArray, uint32_t index, int64_t)
Stores an integer into an array.
Definition: Fleece.h:1358
bool FLMutableArray_IsChanged(FLMutableArray)
Returns true if the Array has been changed from the source it was copied from.
void FLMutableArray_Remove(FLMutableArray array, uint32_t firstIndex, uint32_t count)
Removes contiguous items from the array.
FLMutableDict FLMutableArray_GetMutableDict(FLMutableArray, uint32_t index)
Convenience function for getting an array-valued property in mutable form.
FLCopyFlags
Definition: Fleece.h:465
FLMutableArray FLMutableArray_GetMutableArray(FLMutableArray, uint32_t index)
Convenience function for getting an array-valued property in mutable form.
static void FLMutableArray_AppendDict(FLMutableArray, FLDict)
Appends a Fleece dictionary to an array.
Definition: Fleece.h:1416
static void FLMutableArray_SetArray(FLMutableArray, uint32_t index, FLArray)
Stores a Fleece array into an array.
Definition: Fleece.h:1379
bool FLArray_IsEmpty(FLArray) FLPURE
Returns true if an array is empty (or NULL).
static void FLMutableArray_AppendDouble(FLMutableArray, double)
Appends a 64-bit floating point number to an array.
Definition: Fleece.h:1401
static void FLMutableArray_SetUInt(FLMutableArray, uint32_t index, uint64_t)
Stores an unsigned integer into an array.
Definition: Fleece.h:1361
uint32_t FLArrayIterator_GetCount(const FLArrayIterator *) FLPURE
Returns the number of items remaining to be iterated, including the current one.
static void FLMutableArray_AppendUInt(FLMutableArray, uint64_t)
Appends an unsigned integer to an array.
Definition: Fleece.h:1395
FLMutableArray FLMutableArray_New(void)
Creates a new empty mutable Array.
void FLArrayIterator_Begin(FLArray, FLArrayIterator *)
Initializes a FLArrayIterator struct to iterate over an array.
static void FLMutableArray_SetFloat(FLMutableArray, uint32_t index, float)
Stores a 32-bit floating-point number into an array.
Definition: Fleece.h:1364
FLValue FLArrayIterator_GetValueAt(const FLArrayIterator *, uint32_t offset) FLPURE
Returns a value in the array at the given offset from the current value.
static void FLMutableArray_SetDict(FLMutableArray, uint32_t index, FLDict)
Stores a Fleece dictionary into an array.
Definition: Fleece.h:1382
static void FLMutableArray_AppendInt(FLMutableArray, int64_t)
Appends an integer to an array.
Definition: Fleece.h:1392
void FLMutableArray_SetChanged(FLMutableArray, bool)
Sets or clears the mutable Array's "changed" flag.
static void FLMutableArray_SetString(FLMutableArray, uint32_t index, FLString)
Stores a UTF-8-encoded string into an array.
Definition: Fleece.h:1370
static void FLMutableArray_AppendBool(FLMutableArray, bool)
Appends a boolean value to an array.
Definition: Fleece.h:1389
static void FLMutableArray_AppendString(FLMutableArray, FLString)
Appends a UTF-8-encoded string to an array.
Definition: Fleece.h:1404
FLMutableArray FLArray_AsMutable(FLArray) FLPURE
If the array is mutable, returns it cast to FLMutableArray, else NULL.
static void FLMutableArray_SetDouble(FLMutableArray, uint32_t index, double)
Stores a 64-bit floating point number into an array.
Definition: Fleece.h:1367
FLValue FLArray_Get(FLArray, uint32_t index) FLPURE
Returns an value at an array index, or NULL if the index is out of range.
static void FLMutableArray_AppendValue(FLMutableArray, FLValue)
Appends a Fleece value to an array.
Definition: Fleece.h:1410
static FLMutableArray FLMutableArray_Retain(FLMutableArray d)
Increments the ref-count of a mutable Array.
Definition: Fleece.h:495
void FLMutableArray_Insert(FLMutableArray array, uint32_t firstIndex, uint32_t count)
Inserts a contiguous range of JSON null values into the array.
static void FLMutableArray_SetData(FLMutableArray, uint32_t index, FLSlice)
Stores a binary data blob into an array.
Definition: Fleece.h:1373
FLEECE_PUBLIC const FLArray kFLEmptyArray
static void FLMutableArray_SetBool(FLMutableArray, uint32_t index, bool)
Stores a boolean value into an array.
Definition: Fleece.h:1355
static void FLMutableArray_Release(FLMutableArray d)
Decrements the refcount of (and possibly frees) a mutable Array.
Definition: Fleece.h:499
FLMutableArray FLMutableArray_NewFromJSON(FLString json, FLError *outError)
Creates a new mutable Array from JSON.
static void FLMutableArray_AppendNull(FLMutableArray)
Appends a JSON null value to an array.
Definition: Fleece.h:1386
bool FLArrayIterator_Next(FLArrayIterator *)
Advances the iterator to the next value, or returns false if at the end.
static void FLMutableArray_SetNull(FLMutableArray, uint32_t index)
Stores a JSON null value into an array.
Definition: Fleece.h:1352
static void FLMutableArray_AppendData(FLMutableArray, FLSlice)
Appends a binary data blob to an array.
Definition: Fleece.h:1407
FLMutableArray FLArray_MutableCopy(FLArray, FLCopyFlags)
Creates a new mutable Array that's a copy of the source Array.
FLValue FLArrayIterator_GetValue(const FLArrayIterator *) FLPURE
Returns the current value being iterated over.
uint32_t FLArray_Count(FLArray) FLPURE
Returns the number of items in an array, or 0 if the pointer is NULL.
static void FLMutableArray_AppendFloat(FLMutableArray, float)
Appends a 32-bit floating-point number to an array.
Definition: Fleece.h:1398
void FLMutableArray_Resize(FLMutableArray array, uint32_t size)
Changes the size of an array.
static void FLMutableArray_SetValue(FLMutableArray, uint32_t index, FLValue)
Stores a Fleece value into an array.
Definition: Fleece.h:1376
FLArray FLMutableArray_GetSource(FLMutableArray)
If the Array was created by FLArray_MutableCopy, returns the original source Array.
static void FLMutableArray_AppendArray(FLMutableArray, FLArray)
Appends a Fleece array to an array.
Definition: Fleece.h:1413
@ kFLDeepCopy
Definition: Fleece.h:467
@ kFLCopyImmutables
Definition: Fleece.h:468
@ kFLDefaultCopy
Definition: Fleece.h:466
@ kFLDeepCopyImmutables
Definition: Fleece.h:469
void FLDeepIterator_GetPath(FLDeepIterator, FLPathComponent **outPath, size_t *outDepth)
Returns the path as an array of FLPathComponents.
void FLDeepIterator_SkipChildren(FLDeepIterator)
Tells the iterator to skip the children of the current value.
size_t FLDeepIterator_GetDepth(FLDeepIterator)
Returns the current depth in the hierarchy, starting at 1 for the top-level children.
FLSlice FLDeepIterator_GetKey(FLDeepIterator)
Returns the key of the current value in its parent, or an empty slice if not in a dictionary.
struct _FLDeepIterator * FLDeepIterator
A reference to a deep iterator.
Definition: Fleece.h:811
FLValue FLDeepIterator_GetParent(FLDeepIterator)
Returns the parent/container of the current value, or NULL at the end of iteration.
void FLDeepIterator_Free(FLDeepIterator)
bool FLDeepIterator_Next(FLDeepIterator)
Advances the iterator to the next value, or returns false if at the end.
uint32_t FLDeepIterator_GetIndex(FLDeepIterator)
Returns the array index of the current value in its parent, or 0 if not in an array.
FLDeepIterator FLDeepIterator_New(FLValue)
Creates a FLDeepIterator to iterate over a dictionary.
FLValue FLDeepIterator_GetValue(FLDeepIterator)
Returns the current value being iterated over.
FLSliceResult FLDeepIterator_GetJSONPointer(FLDeepIterator)
Returns the current path in JSONPointer format (RFC 6901).
FLSliceResult FLDeepIterator_GetPathString(FLDeepIterator)
Returns the current path in JavaScript format.
void FLDictIterator_Begin(FLDict, FLDictIterator *)
Initializes a FLDictIterator struct to iterate over a dictionary.
bool FLMutableDict_IsChanged(FLMutableDict)
Returns true if the Dict has been changed from the source it was copied from.
FLString FLDictKey_GetString(const FLDictKey *)
Returns the string value of the key (which it was initialized with.)
static void FLMutableDict_SetDict(FLMutableDict, FLString key, FLDict)
Stores a Fleece dictionary into a mutable dictionary.
Definition: Fleece.h:1450
static void FLMutableDict_SetNull(FLMutableDict, FLString key)
Stores a JSON null value into a mutable dictionary.
Definition: Fleece.h:1420
FLMutableDict FLMutableDict_New(void)
Creates a new empty mutable Dict.
static FLMutableDict FLMutableDict_Retain(FLMutableDict d)
Increments the ref-count of a mutable Dict.
Definition: Fleece.h:733
FLString FLDictIterator_GetKeyString(const FLDictIterator *)
Returns the current key's string value.
uint32_t FLDict_Count(FLDict) FLPURE
Returns the number of items in a dictionary, or 0 if the pointer is NULL.
FLValue FLDict_GetWithKey(FLDict, FLDictKey *)
Looks up a key in a dictionary using an FLDictKey.
void FLMutableDict_SetChanged(FLMutableDict, bool)
Sets or clears the mutable Dict's "changed" flag.
static void FLMutableDict_SetData(FLMutableDict, FLString key, FLSlice)
Stores a binary data blob into a mutable dictionary.
Definition: Fleece.h:1441
FLMutableArray FLMutableDict_GetMutableArray(FLMutableDict, FLString key)
Convenience function for getting an array-valued property in mutable form.
FLValue FLDict_Get(FLDict, FLSlice keyString) FLPURE
Looks up a key in a dictionary, returning its value.
uint32_t FLDictIterator_GetCount(const FLDictIterator *) FLPURE
Returns the number of items remaining to be iterated, including the current one.
void FLMutableDict_RemoveAll(FLMutableDict)
Removes all keys and values.
FLEECE_PUBLIC const FLDict kFLEmptyDict
FLMutableDict FLDict_MutableCopy(FLDict source, FLCopyFlags)
Creates a new mutable Dict that's a copy of the source Dict.
void FLDictIterator_End(FLDictIterator *)
Cleans up after an iterator.
static void FLMutableDict_SetFloat(FLMutableDict, FLString key, float)
Stores a 32-bit floating-point number into a mutable dictionary.
Definition: Fleece.h:1432
static void FLMutableDict_SetInt(FLMutableDict, FLString key, int64_t)
Stores an integer into a mutable dictionary.
Definition: Fleece.h:1426
static void FLMutableDict_SetValue(FLMutableDict, FLString key, FLValue)
Stores a Fleece value into a mutable dictionary.
Definition: Fleece.h:1444
static void FLMutableDict_SetDouble(FLMutableDict, FLString key, double)
Stores a 64-bit floating point number into a mutable dictionary.
Definition: Fleece.h:1435
FLDict FLMutableDict_GetSource(FLMutableDict)
If the Dict was created by FLDict_MutableCopy, returns the original source Dict.
FLMutableDict FLDict_AsMutable(FLDict) FLPURE
If the dictionary is mutable, returns it cast to FLMutableDict, else NULL.
FLMutableDict FLMutableDict_NewFromJSON(FLString json, FLError *outError)
Creates a new mutable Dict from json.
bool FLDict_IsEmpty(FLDict) FLPURE
Returns true if a dictionary is empty (or NULL).
static void FLMutableDict_SetBool(FLMutableDict, FLString key, bool)
Stores a boolean value into a mutable dictionary.
Definition: Fleece.h:1423
FLMutableDict FLMutableDict_GetMutableDict(FLMutableDict, FLString key)
Convenience function for getting a dict-valued property in mutable form.
static void FLMutableDict_SetArray(FLMutableDict, FLString key, FLArray)
Stores a Fleece array into a mutable dictionary.
Definition: Fleece.h:1447
static void FLMutableDict_Release(FLMutableDict d)
Decrements the refcount of (and possibly frees) a mutable Dict.
Definition: Fleece.h:738
static void FLMutableDict_SetString(FLMutableDict, FLString key, FLString)
Stores a UTF-8-encoded string into a mutable dictionary.
Definition: Fleece.h:1438
void FLMutableDict_Remove(FLMutableDict, FLString key)
Removes the value for a key.
FLValue FLDictIterator_GetKey(const FLDictIterator *) FLPURE
Returns the current key being iterated over.
bool FLDictIterator_Next(FLDictIterator *)
Advances the iterator to the next value, or returns false if at the end.
FLValue FLDictIterator_GetValue(const FLDictIterator *) FLPURE
Returns the current value being iterated over.
FLDictKey FLDictKey_Init(FLSlice string)
Initializes an FLDictKey struct with a key string.
static void FLMutableDict_SetUInt(FLMutableDict, FLString key, uint64_t)
Stores an unsigned integer into a mutable dictionary.
Definition: Fleece.h:1429
bool FLEncoder_ConvertJSON(FLEncoder, FLSlice json)
Parses JSON data and writes the object(s) to the encoder.
const char * FLEncoder_GetErrorMessage(FLEncoder)
Returns the error message of an encoder, or NULL if there's no error.
FLSliceResult FLEncoder_Snip(FLEncoder e)
Returns the data written so far as a standalone Fleece document, whose root is the last value written...
bool FLEncoder_WriteUInt(FLEncoder, uint64_t)
Writes an unsigned integer to an encoder.
void FLEncoder_SetSharedKeys(FLEncoder, FLSharedKeys)
Tells the encoder to use a shared-keys mapping when encoding dictionary keys.
void FLEncoder_Free(FLEncoder)
Frees the space used by an encoder.
intptr_t FLEncoder_LastValueWritten(FLEncoder e)
Returns an opaque reference to the last complete value written to the encoder, if possible.
FLEncoder FLEncoder_NewWritingToFile(FILE *, bool uniqueStrings)
Creates a new Fleece encoder that writes to a file, not to memory.
void FLEncoder_SetExtraInfo(FLEncoder, void *info)
Associates an arbitrary user-defined value with the encoder.
void FLEncoder_SuppressTrailer(FLEncoder)
Tells the encoder not to write the two-byte Fleece trailer at the end of the data.
bool FLEncoder_WriteKey(FLEncoder, FLString)
Specifies the key for the next value to be written to the current dictionary.
FLEncoder FLEncoder_New(void)
Creates a new encoder, for generating Fleece data.
FLSlice FLEncoder_GetBase(FLEncoder)
Returns the base value passed to FLEncoder_Amend.
bool FLEncoder_WriteInt(FLEncoder, int64_t)
Writes an integer to an encoder.
void FLEncoder_WriteValueAgain(FLEncoder e, intptr_t preWrittenValue)
Writes another reference (a "pointer") to an already-written value, given a reference previously retu...
bool FLEncoder_BeginArray(FLEncoder, size_t reserveCount)
Begins writing an array value to an encoder.
bool FLEncoder_WriteUndefined(FLEncoder)
Writes an undefined value to an encoder.
bool FLEncoder_WriteFloat(FLEncoder, float)
Writes a 32-bit floating point number to an encoder.
bool FLEncoder_WriteBool(FLEncoder, bool)
Writes a boolean value (true or false) to an encoder.
void * FLEncoder_GetExtraInfo(FLEncoder)
Returns the user-defined value associated with the encoder; NULL by default.
bool FLEncoder_WriteDouble(FLEncoder, double)
Writes a 64-bit floating point number to an encoder.
FLDoc FLEncoder_FinishDoc(FLEncoder, FLError *)
Ends encoding; if there has been no error, it returns the encoded Fleece data packaged in an FLDoc.
bool FLEncoder_WriteDateString(FLEncoder encoder, FLTimestamp ts, bool asUTC)
Writes a timestamp to an encoder, as an ISO-8601 date string.
size_t FLEncoder_GetNextWritePos(FLEncoder)
Returns the byte offset in the encoded data where the next value will be written.
void FLEncoder_Amend(FLEncoder e, FLSlice base, bool reuseStrings, bool externPointers)
Tells the encoder to logically append to the given Fleece document, rather than making a standalone d...
bool FLEncoder_WriteNull(FLEncoder)
Writes a null value to an encoder.
MUST_USE_RESULT FLSliceResult FLEncoder_Finish(FLEncoder e, FLError *outError)
Ends encoding; if there has been no error, it returns the encoded data, else null.
bool FLEncoder_BeginDict(FLEncoder, size_t reserveCount)
Begins writing a dictionary value to an encoder.
size_t FLEncoder_BytesWritten(FLEncoder)
Returns the number of bytes encoded so far.
bool FLEncoder_WriteData(FLEncoder, FLSlice)
Writes a binary data value (a blob) to an encoder.
size_t FLEncoder_FinishItem(FLEncoder)
Finishes encoding the current item, and returns its offset in the output data.
bool FLEncoder_WriteValue(FLEncoder, FLValue)
Writes a Fleece Value to an Encoder.
bool FLEncoder_WriteString(FLEncoder, FLString)
Writes a string to an encoder.
bool FLEncoder_WriteKeyValue(FLEncoder, FLValue)
Specifies the key for the next value to be written to the current dictionary.
FLEncoderFormat
Output formats a FLEncoder can generate.
Definition: Fleece.h:1001
bool FLEncoder_EndDict(FLEncoder)
Ends writing a dictionary value; pops back the previous encoding state.
void FLEncoder_Reset(FLEncoder)
Resets the state of an encoder without freeing it.
FLEncoder FLEncoder_NewWithOptions(FLEncoderFormat format, size_t reserveSize, bool uniqueStrings)
Creates a new encoder, allowing some options to be customized.
FLError FLEncoder_GetError(FLEncoder)
Returns the error code of an encoder, or NoError (0) if there's no error.
bool FLEncoder_EndArray(FLEncoder)
Ends writing an array value; pops back the previous encoding state.
bool FLEncoder_WriteRaw(FLEncoder, FLSlice)
Writes raw data directly to the encoded output.
@ kFLEncodeFleece
Fleece encoding.
Definition: Fleece.h:1002
@ kFLEncodeJSON5
JSON5, an extension of JSON with a more readable syntax
Definition: Fleece.h:1004
@ kFLEncodeJSON
JSON encoding.
Definition: Fleece.h:1003
bool FLKeyPath_GetElement(FLKeyPath, size_t i, FLSlice *outDictKey, int32_t *outArrayIndex)
Returns an element of a path, either a key or an array index.
struct _FLKeyPath * FLKeyPath
A reference to a key path.
Definition: Fleece.h:880
bool FLKeyPath_Equals(FLKeyPath path1, FLKeyPath path2)
Equality test.
FLStringResult FLKeyPath_ToString(FLKeyPath path)
Returns a path in string form.
void FLKeyPath_Free(FLKeyPath)
Frees a compiled FLKeyPath object.
FLValue FLKeyPath_EvalOnce(FLSlice specifier, FLValue root, FLError *error)
Evaluates a key-path from a specifier string, for a given Fleece root object.
FLKeyPath FLKeyPath_New(FLSlice specifier, FLError *error)
Creates a new FLKeyPath object by compiling a path specifier string.
FLValue FLKeyPath_Eval(FLKeyPath, FLValue root)
Evaluates a compiled key-path for a given Fleece root object.
FLString FLSharedKeys_Decode(FLSharedKeys, int key)
Returns the key string that maps to the given integer key, else NULL.
FLSharedKeyScope FLSharedKeyScope_WithRange(FLSlice range, FLSharedKeys)
struct _FLSharedKeyScope * FLSharedKeyScope
Definition: Fleece.h:978
int FLSharedKeys_Encode(FLSharedKeys, FLString, bool add)
Maps a key string to a number in the range [0...2047], or returns -1 if it isn't mapped.
void FLSharedKeys_Release(FLSharedKeys)
Decrements the reference count of an FLSharedKeys, freeing it when it reaches zero.
FLSliceResult FLSharedKeys_GetStateData(FLSharedKeys)
Returns a data blob containing the current state (all the keys and their integers....
void FLSharedKeys_WriteState(FLSharedKeys, FLEncoder)
Writes the current state to a Fleece encoder as a single value, which can later be decoded and passed...
FLSharedKeys FLSharedKeys_Retain(FLSharedKeys)
Increments the reference count of an FLSharedKeys.
bool FLSharedKeys_LoadState(FLSharedKeys, FLValue)
Updates an FLSharedKeys object with saved state, a Fleece value previously written by FLSharedKeys_Wr...
void FLSharedKeyScope_Free(FLSharedKeyScope)
void FLSharedKeys_RevertToCount(FLSharedKeys, unsigned oldCount)
Reverts an FLSharedKeys by "forgetting" any keys added since it had the count oldCount.
FLSharedKeys FLSharedKeys_New(void)
Creates a new empty FLSharedKeys object, which must eventually be released.
bool(* FLSharedKeysReadCallback)(void *context, FLSharedKeys)
Definition: Fleece.h:935
unsigned FLSharedKeys_Count(FLSharedKeys)
Returns the number of keys in the mapping.
bool FLSharedKeys_LoadStateData(FLSharedKeys, FLSlice)
Updates an FLSharedKeys with saved state data created by FLSharedKeys_GetStateData.
FLSharedKeys FLSharedKeys_NewWithRead(FLSharedKeysReadCallback, void *context)
FLValueType
Types of Fleece values.
Definition: Fleece.h:258
static void FLArray_Release(FLArray v)
Definition: Fleece.h:362
FLValueType FLValue_GetType(FLValue) FLPURE
Returns the data type of an arbitrary Value.
int64_t FLTimestamp
A timestamp, expressed as milliseconds since the Unix epoch (1-1-1970 midnight UTC....
Definition: Fleece.h:271
FLTimestamp FLValue_AsTimestamp(FLValue) FLPURE
Converts a value to a timestamp, in milliseconds since Unix epoch, or INT64_MIN on failure.
FLArray FLValue_AsArray(FLValue) FLPURE
If a FLValue represents an array, returns it cast to FLArray, else NULL.
FLStringResult FLValue_ToString(FLValue)
Returns a string representation of any scalar value.
bool FLValue_IsMutable(FLValue) FLPURE
Returns true if the value is mutable.
FLEECE_PUBLIC const FLValue kFLNullValue
A constant null value (not a NULL pointer!)
FLValue FLValue_NewString(FLString)
Allocates a string value on the heap.
static FLDict FLDict_Retain(FLDict v)
Definition: Fleece.h:363
FLString FLValue_AsString(FLValue) FLPURE
Returns the exact contents of a string value, or null for all other types.
bool FLValue_IsEqual(FLValue v1, FLValue v2) FLPURE
Compares two values for equality.
FLEECE_PUBLIC const FLValue kFLUndefinedValue
A constant undefined value.
bool FLValue_IsInteger(FLValue) FLPURE
Returns true if the value is non-NULL and represents an integer.
static FLArray FLArray_Retain(FLArray v)
Definition: Fleece.h:361
static void FLDict_Release(FLDict v)
Definition: Fleece.h:364
bool FLValue_AsBool(FLValue) FLPURE
Returns a value coerced to boolean.
FLSlice FLValue_AsData(FLValue) FLPURE
Returns the exact contents of a data value, or null for all other types.
bool FLValue_IsDouble(FLValue)
Returns true if the value is non-NULL and represents a 64-bit floating-point number.
float FLValue_AsFloat(FLValue) FLPURE
Returns a value coerced to a 32-bit floating point number.
bool FLValue_IsUnsigned(FLValue) FLPURE
Returns true if the value is non-NULL and represents an integer >= 2^63.
FLDict FLValue_AsDict(FLValue) FLPURE
If a FLValue represents a dictionary, returns it as an FLDict, else NULL.
FLValue FLValue_Retain(FLValue)
If this value is mutable (and thus heap-based) its ref-count is incremented.
double FLValue_AsDouble(FLValue) FLPURE
Returns a value coerced to a 32-bit floating point number.
void FLValue_Release(FLValue)
If this value is mutable (and thus heap-based) its ref-count is decremented, and if it reaches zero t...
uint64_t FLValue_AsUnsigned(FLValue) FLPURE
Returns a value coerced to an unsigned integer.
int64_t FLValue_AsInt(FLValue) FLPURE
Returns a value coerced to an integer.
FLValue FLValue_NewData(FLSlice)
Allocates a data/blob value on the heap.
@ kFLArray
An array of values.
Definition: Fleece.h:265
@ kFLNumber
A numeric value, either integer or floating-point.
Definition: Fleece.h:262
@ kFLBoolean
A true or false value.
Definition: Fleece.h:261
@ kFLString
A string.
Definition: Fleece.h:263
@ kFLNull
Equivalent to a JSON 'null'.
Definition: Fleece.h:260
@ kFLUndefined
Type of a NULL pointer, i.e. no such value, like JSON undefined. Also the type of a value created by ...
Definition: Fleece.h:259
@ kFLDict
A mapping of strings to values.
Definition: Fleece.h:266
@ kFLData
Binary data (no JSON equivalent)
Definition: Fleece.h:264
void FLSlot_SetValue(FLSlot, FLValue)
Stores an FLValue into a slot.
void FLSlot_SetNull(FLSlot)
Stores a JSON null into a slot.
static void FLSlot_SetArray(FLSlot slot, FLArray array)
Definition: Fleece.h:1341
static void FLSlot_SetDict(FLSlot slot, FLDict dict)
Definition: Fleece.h:1345
void FLSlot_SetBool(FLSlot, bool)
Stores a boolean into a slot.
void FLSlot_SetInt(FLSlot, int64_t)
Stores an integer into a slot.
void FLSlot_SetUInt(FLSlot, uint64_t)
Stores an unsigned int into a slot.
void FLSlot_SetString(FLSlot, FLString)
Stores a UTF-8 string into a slot.
MUST_USE_RESULT FLSlot FLMutableArray_Set(FLMutableArray, uint32_t index)
Returns an FLSlot that refers to the given index of the given array.
MUST_USE_RESULT FLSlot FLMutableDict_Set(FLMutableDict FL_NONNULL, FLString key)
Returns an FLSlot that refers to the given key/value pair of the given dictionary.
void FLSlot_SetData(FLSlot, FLSlice)
Stores a data blob into a slot.
MUST_USE_RESULT FLSlot FLMutableArray_Append(FLMutableArray)
Appends a null value to the array and returns an FLSlot that refers to that position.
void FLSlot_SetFloat(FLSlot, float)
Stores a float into a slot.
void FLSlot_SetDouble(FLSlot, double)
Stores a double into a slot.
FLSliceResult FLApplyJSONDelta(FLValue old, FLSlice jsonDelta, FLError *error)
Applies the JSON data created by CreateJSONDelta to the value old, which must be equal to the old val...
bool FLEncodeJSONDelta(FLValue old, FLValue nuu, FLEncoder jsonEncoder)
Writes JSON that describes the changes to turn the value old into nuu.
bool FLEncodeApplyingJSONDelta(FLValue old, FLSlice jsonDelta, FLEncoder encoder)
Applies the (parsed) JSON data created by CreateJSONDelta to the value old, which must be equal to th...
FLSliceResult FLCreateJSONDelta(FLValue old, FLValue nuu)
Returns JSON that encodes the changes to turn the value old into nuu.
FLStringResult FLJSON5_ToJSON(FLString json5, FLStringResult *outErrorMessage, size_t *outErrorPos, FLError *outError)
Converts valid JSON5 https://json5.org to JSON.
FLStringResult FLValue_ToJSON(FLValue)
Encodes a Fleece value as JSON (or a JSON fragment.) Any Data values will become base64-encoded JSON ...
FLStringResult FLValue_ToJSONX(FLValue v, bool json5, bool canonicalForm)
Most general Fleece to JSON converter.
FLStringResult FLValue_ToJSON5(FLValue v)
Encodes a Fleece value as JSON5, a more lenient variant of JSON that allows dictionary keys to be unq...
const char * FLDump(FLValue)
Debugging function that returns a C string of JSON.
const char * FLDumpData(FLSlice data)
Debugging function that returns a C string of JSON.
FLDoc FLDoc_FromJSON(FLSlice json, FLError *outError)
Creates an FLDoc from JSON-encoded data.
FLDoc FLDoc_FromResultData(FLSliceResult data, FLTrust, FLSharedKeys, FLSlice externData)
Creates an FLDoc from Fleece-encoded data that's been returned as a result from FLSlice_Copy or other...
void * FLDoc_GetAssociated(FLDoc doc, const char *type) FLPURE
Returns the pointer associated with the document.
FLDoc FLValue_FindDoc(FLValue) FLPURE
Looks up the Doc containing the Value, or NULL if the Value was created without a Doc.
bool FLDoc_SetAssociated(FLDoc doc, void *pointer, const char *type)
Associates an arbitrary pointer value with a document, and thus its contained values.
FLDoc FLDoc_Retain(FLDoc)
Adds a reference to an FLDoc.
FLSharedKeys FLDoc_GetSharedKeys(FLDoc) FLPURE
Returns the FLSharedKeys used by this FLDoc, as specified when it was created.
struct _FLDoc * FLDoc
A reference to a document.
Definition: Fleece.h:89
FLValue FLDoc_GetRoot(FLDoc) FLPURE
Returns the root value in the FLDoc, usually an FLDict.
FLValue FLValue_FromData(FLSlice data, FLTrust) FLPURE
Returns a pointer to the root value in the encoded data, or NULL if validation failed.
FLStringResult FLData_Dump(FLSlice data)
Produces a human-readable dump of the Value encoded in the data.
FLTrust
Specifies whether not input data is trusted to be 100% valid Fleece.
Definition: Fleece.h:94
struct _FLSharedKeys * FLSharedKeys
A reference to a shared-keys mapping.
Definition: Fleece.h:90
FLSliceResult FLDoc_GetAllocedData(FLDoc) FLPURE
Returns the FLSliceResult data owned by the document, if any, else a null slice.
FLSliceResult FLData_ConvertJSON(FLSlice json, FLError *outError)
Directly converts JSON data to Fleece-encoded data.
FLSlice FLDoc_GetData(FLDoc) FLPURE
Returns the encoded Fleece data backing the document.
void FLDoc_Release(FLDoc)
Releases a reference to an FLDoc.
@ kFLTrusted
Input data is trusted to be valid.
Definition: Fleece.h:104
@ kFLUntrusted
Input data is not trusted to be valid, and will be fully validated by the API call.
Definition: Fleece.h:96
struct _FLDict * FLMutableDict
A reference to a mutable dictionary.
Definition: Fleece.h:54
const struct _FLDict * FLDict
A reference to a dictionary (map) value.
Definition: Fleece.h:51
struct _FLSlot * FLSlot
A reference to a mutable array/dict item.
Definition: Fleece.h:52
struct _FLArray * FLMutableArray
A reference to a mutable array.
Definition: Fleece.h:53
FLError
Error codes returned from some API calls.
Definition: Fleece.h:60
const struct _FLArray * FLArray
A reference to an array value.
Definition: Fleece.h:50
struct _FLEncoder * FLEncoder
A reference to an encoder.
Definition: Fleece.h:55
const struct _FLValue * FLValue
A reference to a value of any type.
Definition: Fleece.h:49
@ kFLNotFound
Definition: Fleece.h:69
@ kFLInvalidData
Definition: Fleece.h:64
@ kFLInternalError
Definition: Fleece.h:68
@ kFLSharedKeysStateError
Definition: Fleece.h:70
@ kFLOutOfRange
Definition: Fleece.h:63
@ kFLEncodeError
Definition: Fleece.h:65
@ kFLMemoryError
Definition: Fleece.h:62
@ kFLUnsupported
Definition: Fleece.h:72
@ kFLUnknownValue
Definition: Fleece.h:67
@ kFLJSONError
Definition: Fleece.h:66
@ kFLPOSIXError
Definition: Fleece.h:71
@ kFLNoError
Definition: Fleece.h:61
Opaque array iterator.
Definition: Fleece.h:431
Opaque dictionary iterator.
Definition: Fleece.h:639
Opaque key for a dictionary.
Definition: Fleece.h:681
uint32_t index
Array index, only if there's no key.
Definition: Fleece.h:844
FLSlice key
Dict key, or kFLSliceNull if none.
Definition: Fleece.h:843
A simple reference to a block of memory.
Definition: FLSlice.h:46
A heap-allocated block of memory returned from an API call.
Definition: FLSlice.h:64