LiteCore
Couchbase Lite cross-platform core implementation
Loading...
Searching...
No Matches
c4Document+Fleece.h File Reference
#include "c4Document.h"

Go to the source code of this file.

Fleece-related

#define kC4ObjectTypeProperty   "@type"
 The sub-document property that identifies it as a special type of object.
 
#define kC4ObjectType_Blob   "blob"
 Value of kC4ObjectTypeProperty that denotes a blob.
 
#define kC4BlobDigestProperty   "digest"
 Blob dict property containing a digest of the data.
 
#define kC4BlobDataProperty   "data"
 Blob dict property containing the data itself.
 
#define kC4LegacyAttachmentsProperty   "_attachments"
 Top-level document property whose value is a CBL 1.x / CouchDB attachments container.
 
#define kC4ObjectType_Encryptable   "encryptable"
 Value of kC4ObjectTypeProperty that denotes an encryptable value.
 
#define kC4EncryptableValueProperty   "value"
 Encryptable-value property containing the actual value; may be any type.
 
CBL_CORE_API FLDict c4doc_getProperties (C4Document *)
 Returns the properties of the selected revision, i.e.
 
NODISCARD CBL_CORE_API FLDoc c4doc_createFleeceDoc (C4Document *)
 Returns a Fleece document reference created from the selected revision.
 
NODISCARD CBL_CORE_API bool c4doc_resolveConflict2 (C4Document *doc, C4String winningRevID, C4String losingRevID, FLDict mergedProperties, C4RevisionFlags mergedFlags, C4Error *error)
 Resolves a conflict between two leaf revisions.
 
CBL_CORE_API C4Documentc4doc_containingValue (FLValue value)
 Returns the C4Document, if any, that contains the given Fleece value.
 
CBL_CORE_API bool c4doc_isOldMetaProperty (C4String prop)
 Returns true if this is the name of a 1.x metadata property ("_id", "_rev", "_deleted".) Does NOT return true for "_attachments" because that property isn't obsolete.
 
CBL_CORE_API bool c4doc_hasOldMetaProperties (FLDict doc)
 Returns true if the document contains 1.x metadata properties at top level.
 
CBL_CORE_API C4SliceResult c4doc_encodeStrippingOldMetaProperties (FLDict doc, FLSharedKeys sk, C4Error *outError)
 Re-encodes to Fleece, without any 1.x metadata properties.
 
NODISCARD CBL_CORE_API bool c4doc_getDictBlobKey (FLDict dict, C4BlobKey *outKey)
 Decodes the dict's "digest" property to a C4BlobKey.
 
NODISCARD CBL_CORE_API bool c4doc_dictIsBlob (FLDict dict, C4BlobKey *outKey)
 Returns true if the given dictionary is a [reference to a] blob; if so, gets its key.
 
CBL_CORE_API bool c4doc_dictContainsBlobs (FLDict dict)
 Returns true if the given dictionary is a [reference to a] blob;.
 
CBL_CORE_API C4SliceResult c4doc_getBlobData (FLDict dict, C4BlobStore *blobStore, C4Error *outError)
 Returns the contents of a blob dictionary, whether they're inline in the "data" property, or indirectly referenced via the "digest" property.
 
CBL_CORE_API bool c4doc_blobIsCompressible (FLDict blobDict)
 Given a dictionary that's a reference to a blob, determines whether it's worth trying to compress the blob's data.
 
CBL_CORE_API C4StringResult c4doc_bodyAsJSON (C4Document *doc, bool canonical, C4Error *outError)
 Translates the body of the selected revision from Fleece to JSON.
 
NODISCARD CBL_CORE_API FLEncoder c4db_createFleeceEncoder (C4Database *db)
 Creates a Fleece encoder for creating documents for a given database.
 
CBL_CORE_API FLEncoder c4db_getSharedFleeceEncoder (C4Database *db)
 Returns a shared Fleece encoder for creating documents for a given database.
 
CBL_CORE_API C4SliceResult c4db_encodeJSON (C4Database *, C4String jsonData, C4Error *outError)
 Encodes JSON data to Fleece, to store into a document.
 
CBL_CORE_API FLSharedKeys c4db_getFLSharedKeys (C4Database *db)
 Returns the FLSharedKeys object used by the given database.