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
22#ifdef COUCHBASE_ENTERPRISE
23
25
88
90
91#ifdef __APPLE__
92#pragma mark - CREATING:
93#endif
94
97
100
103
106
109
112
115
118
121
124
125#ifdef __APPLE__
126#pragma mark - READING:
127#endif
128
131
134
135#ifdef __APPLE__
136#pragma mark - FLEECE:
137#endif
138
141
145}
146
151
157}
158
161
163static inline void FLMutableDict_SetEncryptableValue(FLMutableDict dict, FLString key, CBLEncryptable* encryptable) {
164 FLSlot_SetEncryptableValue(FLMutableDict_Set(dict, key), encryptable);
165}
166
170
171#endif
#define CBLAPI
Definition: CBL_Compat.h:104
#define _cbl_nullable
Definition: CBL_Compat.h:92
#define CBL_CAPI_BEGIN
Definition: CBL_Compat.h:105
#define CBL_CAPI_END
Definition: CBL_Compat.h:106
#define CBL_PUBLIC
Definition: CBL_Compat.h:123
FLEECE_PUBLIC FLDict FL_NULLABLE FLValue_AsDict(FLValue FL_NULLABLE) FLPURE
If a FLValue represents a dictionary, returns it as an FLDict, else NULL.
NODISCARD FLEECE_PUBLIC FLSlot FLMutableDict_Set(FLMutableDict, 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 Values in a document or NULL if the...
Definition: CBLEncryptable.h:155
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:163
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:245
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:143
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: FLBase.h:40
const struct _FLDict * FLDict
A reference to a dictionary (map) value.
Definition: FLBase.h:37
struct _FLSlot * FLSlot
A reference to a mutable array/dict item.
Definition: FLBase.h:38
const struct _FLArray * FLArray
A reference to an array value.
Definition: FLBase.h:36
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