Couchbase Lite C
Couchbase Lite C API
FLDoc.h
Go to the documentation of this file.
1//
2// FLDoc.h
3//
4// Copyright 2016-Present Couchbase, Inc.
5//
6// Use of this software is governed by the Business Source License included
7// in the file licenses/BSL-Couchbase.txt. As of the Change Date specified
8// in that file, in accordance with the Business Source License, use of this
9// software will be governed by the Apache License, Version 2.0, included in
10// the file licenses/APL2.txt.
11//
12
13#pragma once
14#ifndef _FLDOC_H
15#define _FLDOC_H
16
17#include "FLBase.h"
18
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25 // This is the C API! For the C++ API, see Fleece.hh.
26
27
42
45
49
52
55
58
61
65
81 void * FL_NULLABLE pointer,
82 const char *type) FLAPI;
83
93
94
98#ifdef __cplusplus
99}
100#endif
101
103
104#endif // _FLDOC_H
#define FL_NULLABLE
Definition: CompilerSupport.h:74
#define FLEECE_PUBLIC
Definition: CompilerSupport.h:241
#define FL_ASSUME_NONNULL_BEGIN
Definition: CompilerSupport.h:72
#define FLPURE
Definition: CompilerSupport.h:110
#define FL_ASSUME_NONNULL_END
Definition: CompilerSupport.h:73
#define FLAPI
Definition: CompilerSupport.h:247
FLEECE_PUBLIC FLSharedKeys FLDoc_GetSharedKeys(FLDoc FL_NULLABLE) FLPURE
Returns the FLSharedKeys used by this FLDoc, as specified when it was created.
FLEECE_PUBLIC FLSliceResult FLDoc_GetAllocedData(FLDoc FL_NULLABLE) FLPURE
Returns the FLSliceResult data owned by the document, if any, else a null slice.
FLEECE_PUBLIC bool FLDoc_SetAssociated(FLDoc FL_NULLABLE doc, void *FL_NULLABLE pointer, const char *type)
Associates an arbitrary pointer value with a document, and thus its contained values.
FLEECE_PUBLIC FLValue FLDoc_GetRoot(FLDoc FL_NULLABLE) FLPURE
Returns the root value in the FLDoc, usually an FLDict.
FLEECE_PUBLIC FLDoc FL_NULLABLE FLValue_FindDoc(FLValue FL_NULLABLE) FLPURE
Looks up the Doc containing the Value, or NULL if there is none.
FLEECE_PUBLIC FLDoc FLDoc_FromResultData(FLSliceResult data, FLTrust, FLSharedKeys FL_NULLABLE, FLSlice externData)
Creates an FLDoc from Fleece-encoded data that's been returned as a result from FLSlice_Copy or other...
FLEECE_PUBLIC void FLDoc_Release(FLDoc FL_NULLABLE)
Releases a reference to an FLDoc.
FLEECE_PUBLIC FLSlice FLDoc_GetData(FLDoc FL_NULLABLE) FLPURE
Returns the encoded Fleece data backing the document.
FLEECE_PUBLIC void * FLDoc_GetAssociated(FLDoc FL_NULLABLE doc, const char *type) FLPURE
Returns the pointer associated with the document.
FLEECE_PUBLIC FLDoc FLDoc_Retain(FLDoc FL_NULLABLE)
Adds a reference to an FLDoc.
struct _FLDoc * FLDoc
A reference to a document.
Definition: FLBase.h:42
FLTrust
Specifies whether not input data is trusted to be 100% valid Fleece.
Definition: FLBase.h:65
struct _FLSharedKeys * FLSharedKeys
A reference to a shared-keys mapping.
Definition: FLBase.h:43
const struct _FLValue * FLValue
A reference to a value of any type.
Definition: FLBase.h:35
A simple reference to a block of memory.
Definition: FLSlice.h:45
A heap-allocated block of memory returned from an API call.
Definition: FLSlice.h:63