Couchbase Lite C
Couchbase Lite C API
CBLEncryptable.h
Go to the documentation of this file.
1//
2// CBLEncryptable.h
3//
4// Copyright (c) 2021 Couchbase, Inc All rights reserved.
5//
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17//
18
19#pragma once
20#include "CBLBase.h"
21#include "fleece/Fleece.h"
22
23#ifdef COUCHBASE_ENTERPRISE
24
26
89
91
92#ifdef __APPLE__
93#pragma mark - CREATING:
94#endif
95
98
101
104
107
110
113
116
119
122
125
126#ifdef __APPLE__
127#pragma mark - READING:
128#endif
129
132
135
136#ifdef __APPLE__
137#pragma mark - FLEECE:
138#endif
139
142
146}
147
152
158}
159
162
164static inline void FLMutableDict_SetEncryptableValue(FLMutableDict dict, FLString key, CBLEncryptable* encryptable) {
165 FLSlot_SetEncryptableValue(FLMutableDict_Set(dict, key), encryptable);
166}
167
171
172#endif
#define CBLAPI
Definition: CBL_Compat.h:98
#define _cbl_nullable
Definition: CBL_Compat.h:86
#define CBL_CAPI_BEGIN
Definition: CBL_Compat.h:99
#define CBL_CAPI_END
Definition: CBL_Compat.h:100
#define CBL_PUBLIC
Definition: CBL_Compat.h:117
FLDict FLValue_AsDict(FLValue) FLPURE
If a FLValue represents a dictionary, returns it as an FLDict, else NULL.
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.
const CBLEncryptable *_cbl_nullable FLDict_GetEncryptableValue(FLDict _cbl_nullable encryptableDict)
Returns a CBLEncryptable object corresponding to the given encryptable dictionary in a document or NU...
CBLEncryptable * CBLEncryptable_CreateWithValue(FLValue value)
Creates CBLEncryptable object with an FLValue value.
CBLEncryptable * CBLEncryptable_CreateWithUInt(uint64_t value)
Creates CBLEncryptable object with an unsigned int value.
CBLEncryptable * CBLEncryptable_CreateWithInt(int64_t value)
Creates CBLEncryptable object with an int value.
static const CBLEncryptable *_cbl_nullable FLValue_GetEncryptableValue(FLValue _cbl_nullable value)
Returns a CBLEncryptable object corresponding to the given Fleece Value Accessors in a document or NU...
Definition: CBLEncryptable.h:156
CBLEncryptable * CBLEncryptable_CreateWithBool(bool value)
Creates CBLEncryptable object with a boolean value.
CBLEncryptable * CBLEncryptable_CreateWithDict(FLDict value)
Creates CBLEncryptable object with an FLDict value.
CBLEncryptable * CBLEncryptable_CreateWithNull(void)
Creates CBLEncryptable object with null value.
CBLEncryptable * CBLEncryptable_CreateWithString(FLString value)
Creates CBLEncryptable object with a string value.
CBL_PUBLIC const FLSlice kCBLEncryptableValueProperty
"value"
CBLEncryptable * CBLEncryptable_CreateWithArray(FLArray value)
Creates CBLEncryptable object with an FLArray value.
FLDict CBLEncryptable_Properties(const CBLEncryptable *encryptable)
Returns the dictionary format of the CBLEncryptable object.
static void FLMutableDict_SetEncryptableValue(FLMutableDict dict, FLString key, CBLEncryptable *encryptable)
Set a CBLEncryptable's dictionary into a mutable dictionary.
Definition: CBLEncryptable.h:164
void FLSlot_SetEncryptableValue(FLSlot slot, const CBLEncryptable *encryptable)
Set a CBLEncryptable's dictionary into a mutable dictionary's slot.
CBL_PUBLIC const FLSlice kCBLEncryptableType
"encryptable"
struct CBLEncryptable CBLEncryptable
An encryptable value.
Definition: CBLBase.h:223
bool FLDict_IsEncryptableValue(FLDict _cbl_nullable)
Checks whether the given dictionary is a CBLEncryptable or not.
CBLEncryptable * CBLEncryptable_CreateWithFloat(float value)
Creates CBLEncryptable object with a float value.
static bool FLValue_IsEncryptableValue(FLValue _cbl_nullable value)
Checks whether the given FLValue is a CBLEncryptable or not.
Definition: CBLEncryptable.h:144
CBLEncryptable * CBLEncryptable_CreateWithDouble(double value)
Creates CBLEncryptable object with a double value.
FLValue CBLEncryptable_Value(const CBLEncryptable *encryptable)
Returns the value to be encrypted by the push replicator.
#define CBL_REFCOUNTED(TYPE, NAME)
Definition: CBLBase.h:170
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
const struct _FLArray * FLArray
A reference to an array value.
Definition: Fleece.h:50
const struct _FLValue * FLValue
A reference to a value of any type.
Definition: Fleece.h:49
A simple reference to a block of memory.
Definition: FLSlice.h:46