A reference to an encryptable value associated with a document.
More...
#include <cbl++/Encryptable.hh>
|
| | Encryptable (fleece::Value value) |
| | Creates an Encryptable wrapping an arbitrary Fleece value.
|
| | Encryptable (std::string_view value) |
| | Creates an Encryptable wrapping a string value.
|
| fleece::Value | value () const |
| | Returns the value to be encrypted by the push replicator.
|
| fleece::Dict | properties () const |
| | Returns the Encryptable's underlying dictionary representation (its persistent form).
|
| void | setInto (fleece::MutableDict dict, fleece::slice key) const |
| | Sets this encryptable value into dict under key.
|
| | Encryptable () noexcept |
| | Constructs a null reference (one that points to no object).
|
| Encryptable & | operator= (std::nullptr_t) |
| | Releases the underlying object and resets this to a null reference.
|
| bool | valid () const |
| | Returns true if this references an object, or false if it is a null reference.
|
| | operator bool () const |
| | Returns true if this references an object (same as valid).
|
| bool | operator== (const Encryptable &other) const |
| | Returns true if both sides reference the same object, or are both null references.
|
| bool | operator!= (const Encryptable &other) const |
| | Returns true if the two sides reference different objects.
|
| CBLEncryptable *_Nullable | ref () const |
| | Returns a pointer to the underlying C object (CBLEncryptable), or NULL if this is a null reference.
|
| | Encryptable (const Encryptable &other) noexcept |
| | Copy constructor: creates another reference to the same object as other.
|
| | Encryptable (Encryptable &&other) noexcept |
| | Move constructor: takes over the reference from other, leaving it a null reference.
|
| Encryptable & | operator= (const Encryptable &other) noexcept |
| | Copy assignment: replaces this reference with a reference to other's object.
|
| Encryptable & | operator= (Encryptable &&other) noexcept |
| | Move assignment: replaces this reference with other's, leaving other a null reference.
|
A reference to an encryptable value associated with a document.
An Encryptable wraps a value (null, bool, number, string, array, dict) that should be encrypted by the push replicator and decrypted by the pull replicator. Its persistent form is a special dictionary in the document properties; construct an Encryptable from such a dictionary via Encryptable::getEncryptableValue.
- Note
- ENTERPRISE EDITION ONLY
◆ Encryptable() [1/6]
| cbl::Encryptable::Encryptable |
( |
fleece::Value | value | ) |
|
|
inlineexplicit |
Creates an Encryptable wrapping an arbitrary Fleece value.
- Parameters
-
| value | The value to be encrypted. |
◆ Encryptable() [2/6]
| cbl::Encryptable::Encryptable |
( |
std::string_view | value | ) |
|
|
inlineexplicit |
Creates an Encryptable wrapping a string value.
- Parameters
-
| value | The string to be encrypted. |
◆ Encryptable() [3/6]
| cbl::Encryptable::Encryptable |
( |
| ) |
|
|
inlinenoexcept |
Constructs a null reference (one that points to no object).
◆ Encryptable() [4/6]
(Internal) Constructs a reference wrapping, and retaining, a C object pointer.
◆ Encryptable() [5/6]
| cbl::Encryptable::Encryptable |
( |
const Encryptable & | other | ) |
|
|
inlinenoexcept |
Copy constructor: creates another reference to the same object as other.
◆ Encryptable() [6/6]
Move constructor: takes over the reference from other, leaving it a null reference.
◆ createWithBool()
| Encryptable cbl::Encryptable::createWithBool |
( |
bool | value | ) |
|
|
inlinestatic |
Creates an Encryptable wrapping a boolean value.
- Parameters
-
| value | The value to be encrypted. |
- Note
- Use factory method to avoid ambiguity.
◆ createWithDouble()
| Encryptable cbl::Encryptable::createWithDouble |
( |
double | value | ) |
|
|
inlinestatic |
Creates an Encryptable wrapping a double value.
- Parameters
-
| value | The value to be encrypted. |
- Note
- Use factory method to avoid ambiguity.
◆ createWithFloat()
| Encryptable cbl::Encryptable::createWithFloat |
( |
float | value | ) |
|
|
inlinestatic |
Creates an Encryptable wrapping a float value.
- Parameters
-
| value | The value to be encrypted. |
- Note
- Use factory method to avoid ambiguity.
◆ createWithInt()
| Encryptable cbl::Encryptable::createWithInt |
( |
int64_t | value | ) |
|
|
inlinestatic |
Creates an Encryptable wrapping a signed integer value.
- Parameters
-
| value | The value to be encrypted. |
- Note
- Use factory method to avoid ambiguity.
◆ createWithNull()
Creates an Encryptable wrapping a null value.
- Note
- Use factory method to avoid ambiguity.
◆ createWithUInt()
| Encryptable cbl::Encryptable::createWithUInt |
( |
uint64_t | value | ) |
|
|
inlinestatic |
Creates an Encryptable wrapping an unsigned integer value.
- Parameters
-
| value | The value to be encrypted. |
- Note
- Use factory method to avoid ambiguity.
◆ getEncryptableValue()
| Encryptable cbl::Encryptable::getEncryptableValue |
( |
fleece::Value | value | ) |
|
|
inlinestatic |
Returns the Encryptable that the given value represents, if any.
- Parameters
-
| value | A value from a document, expected to be an encryptable dictionary. |
- Returns
- The corresponding Encryptable, or a falsy Encryptable if the value is not one.
◆ isEncryptableValue()
| bool cbl::Encryptable::isEncryptableValue |
( |
fleece::Dict | dict | ) |
|
|
inlinestatic |
Returns true if the given dictionary is the persistent form of an Encryptable.
- Parameters
-
| dict | The dictionary to test. |
◆ operator bool()
| cbl::Encryptable::operator bool |
( |
| ) |
const |
|
inlineexplicit |
Returns true if this references an object (same as valid).
◆ operator!=()
| bool cbl::Encryptable::operator!= |
( |
const Encryptable & | other | ) |
const |
|
inline |
Returns true if the two sides reference different objects.
◆ operator=() [1/3]
Copy assignment: replaces this reference with a reference to other's object.
◆ operator=() [2/3]
Move assignment: replaces this reference with other's, leaving other a null reference.
◆ operator=() [3/3]
| Encryptable & cbl::Encryptable::operator= |
( |
std::nullptr_t | | ) |
|
|
inline |
Releases the underlying object and resets this to a null reference.
◆ operator==()
| bool cbl::Encryptable::operator== |
( |
const Encryptable & | other | ) |
const |
|
inline |
Returns true if both sides reference the same object, or are both null references.
◆ properties()
| fleece::Dict cbl::Encryptable::properties |
( |
| ) |
const |
|
inline |
Returns the Encryptable's underlying dictionary representation (its persistent form).
◆ ref()
Returns a pointer to the underlying C object (CBLEncryptable), or NULL if this is a null reference.
◆ setInto()
| void cbl::Encryptable::setInto |
( |
fleece::MutableDict | dict, |
|
|
fleece::slice | key ) const |
|
inline |
Sets this encryptable value into dict under key.
Equivalent to the C API FLMutableDict_SetEncryptableValue.
◆ valid()
| bool cbl::Encryptable::valid |
( |
| ) |
const |
|
inline |
Returns true if this references an object, or false if it is a null reference.
◆ value()
| fleece::Value cbl::Encryptable::value |
( |
| ) |
const |
|
inline |
Returns the value to be encrypted by the push replicator.
The documentation for this class was generated from the following file: