Couchbase Lite C++
Couchbase Lite C++ API
Loading...
Searching...
No Matches
cbl::Result Class Reference

A single query result; ResultSet::iterator iterates over these. More...

#include <cbl++/Query.hh>

Public Member Functions

uint64_t count () const
 Returns the number of columns in the current result.
alloc_slice toJSON () const
 Returns the current result as a JSON dictionary string.
fleece::Value valueAtIndex (unsigned i) const
 Returns the value of a column of the current result, given its (zero-based) numeric index.
fleece::Value valueForKey (std::string_view key) const
 Returns the value of a column of the current result, given its column name.
fleece::Value operator[] (int i) const
 A subscript operator that returns value of a column of the current result, given its (zero-based) numeric index.
fleece::Value operator[] (std::string_view key) const
 A subscript operator that returns the value of a column of the current result, given its column name.

Protected Member Functions

 Result (CBLResultSet *_Nullable ref)

Protected Attributes

CBLResultSet *_Nullable _ref

Friends

class ResultSetIterator

Detailed Description

A single query result; ResultSet::iterator iterates over these.

Constructor & Destructor Documentation

◆ Result()

cbl::Result::Result ( CBLResultSet *_Nullable ref)
inlineexplicitprotected

Member Function Documentation

◆ count()

uint64_t cbl::Result::count ( ) const
inline

Returns the number of columns in the current result.

◆ operator[]() [1/2]

fleece::Value cbl::Result::operator[] ( int i) const
inline

A subscript operator that returns value of a column of the current result, given its (zero-based) numeric index.

◆ operator[]() [2/2]

fleece::Value cbl::Result::operator[] ( std::string_view key) const
inline

A subscript operator that returns the value of a column of the current result, given its column name.

◆ toJSON()

alloc_slice cbl::Result::toJSON ( ) const
inline

Returns the current result as a JSON dictionary string.

◆ valueAtIndex()

fleece::Value cbl::Result::valueAtIndex ( unsigned i) const
inline

Returns the value of a column of the current result, given its (zero-based) numeric index.

This may return a NULL Value, indicating MISSING, if the value doesn't exist, e.g. if the column is a property that doesn't exist in the document.

◆ valueForKey()

fleece::Value cbl::Result::valueForKey ( std::string_view key) const
inline

Returns the value of a column of the current result, given its column name.

This may return a NULL Value, indicating MISSING, if the value doesn't exist, e.g. if the column is a property that doesn't exist in the document. (Or, of course, if the key is not a column name in this query.)

◆ ResultSetIterator

friend class ResultSetIterator
friend

Member Data Documentation

◆ _ref

CBLResultSet* _Nullable cbl::Result::_ref
protected

The documentation for this class was generated from the following file: