A mutable document, whose properties can be modified and saved to a collection.
More...
|
| | MutableDocument (std::nullptr_t) |
| | Creates a new, empty document in memory, with a randomly-generated unique ID.
|
| | MutableDocument (std::string_view docID) |
| | Creates a new, empty document in memory, with the given ID.
|
| fleece::MutableDict | properties () |
| | Returns a mutable document's properties as a mutable dictionary.
|
| template<typename V> |
| void | set (std::string_view key, const V &val) |
| | Sets a property key and value.
|
| template<typename K, typename V> |
| void | set (const K &key, const V &val) |
| | Sets a property key and value.
|
| fleece::keyref< fleece::MutableDict, fleece::slice > | operator[] (std::string_view key) |
| | A subscript operator to access a document's property value by key for either getting or setting the value.
|
| void | setProperties (fleece::MutableDict properties) |
| | Sets a mutable document's properties.
|
| void | setProperties (fleece::Dict properties) |
| | Sets a mutable document's properties.
|
| void | setPropertiesAsJSON (std::string_view json) |
| | Sets a mutable document's properties from a JSON Dictionary string.
|
| | MutableDocument () noexcept |
| | Constructs a null reference (one that points to no object).
|
| MutableDocument & | 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 MutableDocument &other) const |
| | Returns true if both sides reference the same object, or are both null references.
|
| bool | operator!= (const MutableDocument &other) const |
| | Returns true if the two sides reference different objects.
|
| CBLDocument *_Nullable | ref () const |
| | Returns a pointer to the underlying C object (CBLDocument), or NULL if this is a null reference.
|
| | MutableDocument (const MutableDocument &other) noexcept |
| | Copy constructor: creates another reference to the same object as other.
|
| | MutableDocument (MutableDocument &&other) noexcept |
| | Move constructor: takes over the reference from other, leaving it a null reference.
|
| MutableDocument & | operator= (const MutableDocument &other) noexcept |
| | Copy assignment: replaces this reference with a reference to other's object.
|
| MutableDocument & | operator= (MutableDocument &&other) noexcept |
| | Move assignment: replaces this reference with other's, leaving other a null reference.
|
| std::string | id () const |
| | A document's ID.
|
| std::string | revisionID () const |
| | A document's revision ID, which is a short opaque string that's guaranteed to be unique to every change made to the document.
|
| uint64_t | timestamp () const |
| | The hybrid logical timestamp in nanoseconds since epoch that the revision was created.
|
| uint64_t | sequence () const |
| | A document's current sequence in the local database.
|
| Collection | collection () const |
| | A document's collection or NULL for the new document that hasn't been saved.
|
| fleece::Dict | properties () const |
| | A document's properties as an immutable dictionary.
|
| alloc_slice | propertiesAsJSON () const |
| | A document's properties as JSON.
|
| fleece::Value | operator[] (std::string_view key) const |
| | A subscript operator to access a document's property value by key.
|
| MutableDocument | mutableCopy () const |
| | Creates a new mutable Document instance that refers to the same document as the original.
|
| | Document () noexcept |
| | Constructs a null reference (one that points to no object).
|
| Document & | 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 Document &other) const |
| | Returns true if both sides reference the same object, or are both null references.
|
| bool | operator!= (const Document &other) const |
| | Returns true if the two sides reference different objects.
|
| const CBLDocument *_Nullable | ref () const |
| | Returns a pointer to the underlying C object (const CBLDocument), or NULL if this is a null reference.
|
| | Document (const Document &other) noexcept |
| | Copy constructor: creates another reference to the same object as other.
|
| | Document (Document &&other) noexcept |
| | Move constructor: takes over the reference from other, leaving it a null reference.
|
| Document & | operator= (const Document &other) noexcept |
| | Copy assignment: replaces this reference with a reference to other's object.
|
| Document & | operator= (Document &&other) noexcept |
| | Move assignment: replaces this reference with other's, leaving other a null reference.
|
A mutable document, whose properties can be modified and saved to a collection.