Couchbase Lite C
Couchbase Lite C API
Data Structures | Typedefs | Functions
Fleece Deep Iterator

A deep iterator traverses every value contained in a dictionary, in depth-first order. More...

Data Structures

struct  FLPathComponent
 

Typedefs

typedef struct _FLDeepIterator * FLDeepIterator
 A reference to a deep iterator. More...
 

Functions

FLDeepIterator FLDeepIterator_New (FLValue)
 Creates a FLDeepIterator to iterate over a dictionary. More...
 
void FLDeepIterator_Free (FLDeepIterator)
 
FLValue FLDeepIterator_GetValue (FLDeepIterator)
 Returns the current value being iterated over. More...
 
FLValue FLDeepIterator_GetParent (FLDeepIterator)
 Returns the parent/container of the current value, or NULL at the end of iteration. More...
 
FLSlice FLDeepIterator_GetKey (FLDeepIterator)
 Returns the key of the current value in its parent, or an empty slice if not in a dictionary. More...
 
uint32_t FLDeepIterator_GetIndex (FLDeepIterator)
 Returns the array index of the current value in its parent, or 0 if not in an array. More...
 
size_t FLDeepIterator_GetDepth (FLDeepIterator)
 Returns the current depth in the hierarchy, starting at 1 for the top-level children. More...
 
void FLDeepIterator_SkipChildren (FLDeepIterator)
 Tells the iterator to skip the children of the current value. More...
 
bool FLDeepIterator_Next (FLDeepIterator)
 Advances the iterator to the next value, or returns false if at the end. More...
 
void FLDeepIterator_GetPath (FLDeepIterator, FLPathComponent **outPath, size_t *outDepth)
 Returns the path as an array of FLPathComponents. More...
 
FLSliceResult FLDeepIterator_GetPathString (FLDeepIterator)
 Returns the current path in JavaScript format. More...
 
FLSliceResult FLDeepIterator_GetJSONPointer (FLDeepIterator)
 Returns the current path in JSONPointer format (RFC 6901). More...
 

Detailed Description

A deep iterator traverses every value contained in a dictionary, in depth-first order.

You can skip any nested collection by calling FLDeepIterator_SkipChildren.

Typedef Documentation

◆ FLDeepIterator

typedef struct _FLDeepIterator* FLDeepIterator

A reference to a deep iterator.

Function Documentation

◆ FLDeepIterator_Free()

void FLDeepIterator_Free ( FLDeepIterator  )

◆ FLDeepIterator_GetDepth()

size_t FLDeepIterator_GetDepth ( FLDeepIterator  )

Returns the current depth in the hierarchy, starting at 1 for the top-level children.

◆ FLDeepIterator_GetIndex()

uint32_t FLDeepIterator_GetIndex ( FLDeepIterator  )

Returns the array index of the current value in its parent, or 0 if not in an array.

◆ FLDeepIterator_GetJSONPointer()

FLSliceResult FLDeepIterator_GetJSONPointer ( FLDeepIterator  )

Returns the current path in JSONPointer format (RFC 6901).

◆ FLDeepIterator_GetKey()

FLSlice FLDeepIterator_GetKey ( FLDeepIterator  )

Returns the key of the current value in its parent, or an empty slice if not in a dictionary.

◆ FLDeepIterator_GetParent()

FLValue FLDeepIterator_GetParent ( FLDeepIterator  )

Returns the parent/container of the current value, or NULL at the end of iteration.

◆ FLDeepIterator_GetPath()

void FLDeepIterator_GetPath ( FLDeepIterator  ,
FLPathComponent **  outPath,
size_t *  outDepth 
)

Returns the path as an array of FLPathComponents.

◆ FLDeepIterator_GetPathString()

FLSliceResult FLDeepIterator_GetPathString ( FLDeepIterator  )

Returns the current path in JavaScript format.

◆ FLDeepIterator_GetValue()

FLValue FLDeepIterator_GetValue ( FLDeepIterator  )

Returns the current value being iterated over.

or NULL at the end of iteration.

◆ FLDeepIterator_New()

FLDeepIterator FLDeepIterator_New ( FLValue  )

Creates a FLDeepIterator to iterate over a dictionary.

Call FLDeepIterator_GetKey and FLDeepIterator_GetValue to get the first item, then FLDeepIterator_Next.

◆ FLDeepIterator_Next()

bool FLDeepIterator_Next ( FLDeepIterator  )

Advances the iterator to the next value, or returns false if at the end.

◆ FLDeepIterator_SkipChildren()

void FLDeepIterator_SkipChildren ( FLDeepIterator  )

Tells the iterator to skip the children of the current value.