Couchbase Lite C++
Couchbase Lite C++ API
Loading...
Searching...
No Matches
Base.hh File Reference
#include "cbl/CBLBase.h"
#include "cbl/CBLQueryTypes.h"
#include "fleece/slice.hh"
#include <algorithm>
#include <functional>
#include <cassert>
#include <memory>
#include <stdexcept>
#include <utility>

Go to the source code of this file.

Classes

struct  cbl::Error
 The exception thrown by the Couchbase Lite C++ API to report a Couchbase Lite failure. More...
class  cbl::ListenerToken< Args >
 A token representing a registered listener; instances are returned from the various methods that register listeners, such as Collection::addChangeListener. More...

Namespaces

namespace  cbl

Macros

#define CBL_REFCOUNTED_WITHOUT_COPY_MOVE_BOILERPLATE(CLASS, SUPER, C_TYPE)
#define CBL_REFCOUNTED_BOILERPLATE(CLASS, SUPER, C_TYPE)

Typedefs

using cbl::slice = fleece::slice
 Convenience alias for fleece::slice, a non-owning view of a byte range.
using cbl::alloc_slice = fleece::alloc_slice
 Convenience alias for fleece::alloc_slice, an owning byte buffer.
using cbl::QueryLanguage = CBLQueryLanguage

Functions

bool operator== (const CBLError &e1, const CBLError &e2)
 Equality for two CBLError values.

Macro Definition Documentation

◆ CBL_REFCOUNTED_BOILERPLATE

#define CBL_REFCOUNTED_BOILERPLATE ( CLASS,
SUPER,
C_TYPE )
Value:
public: \ \
CLASS(const CLASS &other) noexcept :SUPER(other) { } \ \
CLASS(CLASS &&other) noexcept :SUPER((SUPER&&)other) { } \ \
CLASS& operator=(const CLASS &other) noexcept {SUPER::operator=(other); return *this;} \ \
CLASS& operator=(CLASS &&other) noexcept {SUPER::operator=((SUPER&&)other); return *this;}
#define CBL_REFCOUNTED_WITHOUT_COPY_MOVE_BOILERPLATE(CLASS, SUPER, C_TYPE)
Definition Base.hh:140

◆ CBL_REFCOUNTED_WITHOUT_COPY_MOVE_BOILERPLATE

#define CBL_REFCOUNTED_WITHOUT_COPY_MOVE_BOILERPLATE ( CLASS,
SUPER,
C_TYPE )
Value:
public: \ \
CLASS() noexcept :SUPER() { } \ \
CLASS& operator=(std::nullptr_t) {clear(); return *this;} \ \
bool valid() const {return RefCounted::valid();} \ \
explicit operator bool() const {return valid();} \ \
bool operator==(const CLASS &other) const {return _ref == other._ref;} \ \
bool operator!=(const CLASS &other) const {return _ref != other._ref;} \ \
C_TYPE* _cbl_nullable ref() const {return (C_TYPE*)_ref;}\
protected: \ \
explicit CLASS(C_TYPE* _cbl_nullable ref) :SUPER((CBLRefCounted*)ref) { }
bool operator==(const CBLError &e1, const CBLError &e2)
Equality for two CBLError values.
Definition Base.hh:39
#define _cbl_nullable
struct CBLRefCounted CBLRefCounted

Function Documentation

◆ operator==()

bool operator== ( const CBLError & e1,
const CBLError & e2 )
inline

Equality for two CBLError values.

Two errors are equal when both indicate success (code == 0), or when they share the same domain and code.