kDB: Knowledge DataBase
Loading...
Searching...
No Matches
knowDBC::Result Class Reference

#include <Result.h>

Inheritance diagram for knowDBC::Result:
Collaboration diagram for knowDBC::Result:

Public Types

using Type = Interfaces::Result::Type
 

Public Member Functions

 Result (Interfaces::Result *_result)
 
 Result (const Result &)=default
 
Resultoperator= (const Result &)=default
 
knowCore::Value value (int _tuple, const QByteArray &_field) const
 
knowCore::Value value (int _tuple, const char *_field) const
 
template<typename _T_ >
cres_qresult< _T_ > value (int _tuple, int _field, knowCore::TypeCheckingMode _conversion=knowCore::TypeCheckingMode::Safe) const
 
template<typename _T_ >
cres_qresult< _T_ > value (int _tuple, const QByteArray &_field, knowCore::TypeCheckingMode _conversion=knowCore::TypeCheckingMode::Safe) const
 
template<typename _T_ >
cres_qresult< _T_ > value (int _tuple, const char *_field, knowCore::TypeCheckingMode _conversion=knowCore::TypeCheckingMode::Safe) const
 
bool boolean () const
 
int fieldIndex (const QString &_name) const
 
QString fieldName (int _index) const
 
 operator bool () const
 
cres_qresult< void > write (QIODevice *_device, const QString &_format=knowCore::FileFormat::JSON) const
 

Static Public Member Functions

static Result create (const QString &_query, const char *_error)
 
static Result create (const QString &_query, const QString &_error)
 
static Result create (const QString &_query, QStringList _fields, const QList< knowCore::ValueList > &_data)
 
static Result create (const QString &_query, bool _boolean)
 
static cres_qresult< Resultread (QIODevice *_device, const QString &_format=knowCore::FileFormat::JSON, const knowCore::Uri &_base=knowCore::Uri())
 

Detailed Description

Hold an Interfaces::Result and provide convenient functionnalities common to all type of query results.

Member Function Documentation

◆ boolean()

bool Result::boolean ( ) const

If the result is of type Type::Boolean return the boolean value, otherwise result is undefined.

◆ fieldIndex()

int Result::fieldIndex ( const QString & _name) const
Returns
the index of the field _name.

◆ fieldName()

QString Result::fieldName ( int _index) const
inline
Returns
the name of the field at index _index.

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