Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
dbiplus::Dataset Class Referenceabstract

#include <dataset.h>

Inheritance diagram for dbiplus::Dataset:
dbiplus::MysqlDataset dbiplus::SqliteDataset

Public Member Functions

 Dataset ()
 
 Dataset (Database *newDb)
 
virtual ~Dataset ()
 
void setDatabase (Database *newDb)
 
DatabasegetDatabase (void)
 
void setExecSql (const char *newSql)
 
const char * getExecSql (void)
 
virtual bool isActive (void)
 
virtual void setSqlParams (sqlType t, const char *sqlFrmt,...)
 
virtual int64_t lastinsertid ()=0
 
virtual long nextid (const char *seq_name)=0
 
virtual int num_rows ()=0
 
virtual void open (const std::string &sql)=0
 
virtual void open ()=0
 
virtual int exec (const std::string &sql)=0
 
virtual int exec ()=0
 
virtual const voidgetExecRes ()=0
 
virtual bool query (const std::string &sql)=0
 
virtual void close ()
 
virtual void refresh ()
 
virtual bool dropIndex (const char *table, const char *index)
 Drop an index from the database table, provided it exists.
 
virtual bool seek (int pos=0)
 
virtual bool goto_rec (int pos=1)
 
virtual void first ()
 
virtual void next ()
 
virtual void prev ()
 
virtual void last ()
 
virtual bool eof (void)
 
virtual bool bof (void)
 
virtual void insert ()
 
virtual void append ()
 
virtual void edit ()
 
virtual void del ()
 
virtual void post ()
 
virtual void deletion ()
 
virtual void cancel ()
 
virtual void interrupt ()
 
virtual void setParamList (const ParamList &params)
 
virtual bool locate ()
 
virtual bool locate (const ParamList &params)
 
virtual bool findNext ()
 
virtual int field_count ()
 
virtual int fieldCount ()
 
virtual const char * fieldName (int n)
 
virtual int fieldIndex (const char *fn)
 
virtual bool set_field_value (const char *f_name, const field_value &value)
 
virtual bool sf (const char *f, const field_value &v)
 
virtual const field_valueget_field_value (const char *f_name)
 
virtual const field_valueget_field_value (int index)
 
const field_valuefv (const char *f)
 
const field_valuefv (int index)
 
void set_autocommit (bool v)
 
bool get_autocommit ()
 
Fieldsget_fields_object ()
 
Fieldsget_edit_object ()
 
const result_setget_result_set ()
 
const sql_recordget_sql_record ()
 
dsStates get_state ()
 
void set_select_sql (const char *sel_sql)
 
void set_select_sql (const std::string &select_sql)
 
void add_update_sql (const char *upd_sql)
 
void add_update_sql (const std::string &upd_sql)
 
void add_insert_sql (const char *ins_sql)
 
void add_insert_sql (const std::string &ins_sql)
 
void add_delete_sql (const char *del_sql)
 
void add_delete_sql (const std::string &del_sql)
 
void clear_update_sql ()
 
void clear_insert_sql ()
 
void clear_delete_sql ()
 
size_t insert_sql_count ()
 
size_t delete_sql_count ()
 
const char * get_select_sql ()
 

Protected Member Functions

virtual void make_insert ()=0
 
virtual void make_edit ()=0
 
virtual void make_deletion ()=0
 
virtual void fill_fields (void)=0
 
void parse_sql (std::string &sql)
 
virtual field_value f_old (const char *f)
 
char * str_toLower (char *s)
 

Protected Attributes

Databasedb
 
dsStates ds_state
 
Fieldsfields_object
 
Fieldsedit_object
 
std::unordered_map< std::string, unsigned intname2indexMap
 
result_set result
 
result_set exec_res
 
bool autorefresh
 
bool active
 
bool haveError
 
int frecno
 
std::string sql
 
ParamList plist
 
bool fbof
 
bool feof
 
bool autocommit
 
std::string empty_sql
 
std::string select_sql
 
StringList update_sql
 
StringList insert_sql
 
StringList delete_sql
 

Constructor & Destructor Documentation

◆ Dataset() [1/2]

dbiplus::Dataset::Dataset ( )

◆ Dataset() [2/2]

dbiplus::Dataset::Dataset ( Database * newDb)
explicit

◆ ~Dataset()

dbiplus::Dataset::~Dataset ( )
virtual

Member Function Documentation

◆ add_delete_sql() [1/2]

void dbiplus::Dataset::add_delete_sql ( const char * del_sql)

◆ add_delete_sql() [2/2]

void dbiplus::Dataset::add_delete_sql ( const std::string & del_sql)

◆ add_insert_sql() [1/2]

void dbiplus::Dataset::add_insert_sql ( const char * ins_sql)

◆ add_insert_sql() [2/2]

void dbiplus::Dataset::add_insert_sql ( const std::string & ins_sql)

◆ add_update_sql() [1/2]

void dbiplus::Dataset::add_update_sql ( const char * upd_sql)

◆ add_update_sql() [2/2]

void dbiplus::Dataset::add_update_sql ( const std::string & upd_sql)

◆ append()

virtual void dbiplus::Dataset::append ( )
inlinevirtual

◆ bof()

virtual bool dbiplus::Dataset::bof ( void )
inlinevirtual

◆ cancel()

virtual void dbiplus::Dataset::cancel ( )
inlinevirtual

◆ clear_delete_sql()

void dbiplus::Dataset::clear_delete_sql ( )

◆ clear_insert_sql()

void dbiplus::Dataset::clear_insert_sql ( )

◆ clear_update_sql()

void dbiplus::Dataset::clear_update_sql ( )

◆ close()

void dbiplus::Dataset::close ( void )
virtual

◆ del()

void dbiplus::Dataset::del ( )
virtual

◆ delete_sql_count()

size_t dbiplus::Dataset::delete_sql_count ( )

◆ deletion()

void dbiplus::Dataset::deletion ( )
virtual

◆ dropIndex()

virtual bool dbiplus::Dataset::dropIndex ( const char * table,
const char * index )
inlinevirtual

Drop an index from the database table, provided it exists.

Parameters
table- name of the table the index to be dropped is associated with
index- name of the index to be dropped
Returns
true when the index is guaranteed to no longer exist in the database.

Reimplemented in dbiplus::MysqlDataset, and dbiplus::SqliteDataset.

◆ edit()

void dbiplus::Dataset::edit ( )
virtual

◆ eof()

virtual bool dbiplus::Dataset::eof ( void )
inlinevirtual

◆ exec() [1/2]

virtual int dbiplus::Dataset::exec ( )
pure virtual

◆ exec() [2/2]

virtual int dbiplus::Dataset::exec ( const std::string & sql)
pure virtual

◆ f_old()

field_value dbiplus::Dataset::f_old ( const char * f)
protectedvirtual

◆ field_count()

int dbiplus::Dataset::field_count ( )
virtual

◆ fieldCount()

int dbiplus::Dataset::fieldCount ( )
virtual

◆ fieldIndex()

int dbiplus::Dataset::fieldIndex ( const char * fn)
virtual

◆ fieldName()

const char * dbiplus::Dataset::fieldName ( int n)
virtual

◆ fill_fields()

virtual void dbiplus::Dataset::fill_fields ( void )
protectedpure virtual

◆ findNext()

bool dbiplus::Dataset::findNext ( void )
virtual

◆ first()

void dbiplus::Dataset::first ( )
virtual

◆ fv() [1/2]

const field_value & dbiplus::Dataset::fv ( const char * f)
inline

◆ fv() [2/2]

const field_value & dbiplus::Dataset::fv ( int index)
inline

◆ get_autocommit()

bool dbiplus::Dataset::get_autocommit ( )
inline

◆ get_edit_object()

Fields * dbiplus::Dataset::get_edit_object ( )
inline

◆ get_field_value() [1/2]

const field_value & dbiplus::Dataset::get_field_value ( const char * f_name)
virtual

◆ get_field_value() [2/2]

const field_value & dbiplus::Dataset::get_field_value ( int index)
virtual

◆ get_fields_object()

Fields * dbiplus::Dataset::get_fields_object ( )
inline

◆ get_result_set()

const result_set & dbiplus::Dataset::get_result_set ( )
inline

◆ get_select_sql()

const char * dbiplus::Dataset::get_select_sql ( )

◆ get_sql_record()

const sql_record * dbiplus::Dataset::get_sql_record ( )

◆ get_state()

dsStates dbiplus::Dataset::get_state ( )
inline

◆ getDatabase()

Database * dbiplus::Dataset::getDatabase ( void )
inline

◆ getExecRes()

virtual const void * dbiplus::Dataset::getExecRes ( )
pure virtual

◆ getExecSql()

const char * dbiplus::Dataset::getExecSql ( void )
inline

◆ goto_rec()

bool dbiplus::Dataset::goto_rec ( int pos = 1)
virtual

◆ insert()

void dbiplus::Dataset::insert ( )
virtual

◆ insert_sql_count()

size_t dbiplus::Dataset::insert_sql_count ( )

◆ interrupt()

virtual void dbiplus::Dataset::interrupt ( )
inlinevirtual

◆ isActive()

virtual bool dbiplus::Dataset::isActive ( void )
inlinevirtual

◆ last()

void dbiplus::Dataset::last ( )
virtual

◆ lastinsertid()

virtual int64_t dbiplus::Dataset::lastinsertid ( )
pure virtual

◆ locate() [1/2]

bool dbiplus::Dataset::locate ( )
virtual

◆ locate() [2/2]

bool dbiplus::Dataset::locate ( const ParamList & params)
virtual

◆ make_deletion()

virtual void dbiplus::Dataset::make_deletion ( )
protectedpure virtual

◆ make_edit()

virtual void dbiplus::Dataset::make_edit ( )
protectedpure virtual

◆ make_insert()

virtual void dbiplus::Dataset::make_insert ( )
protectedpure virtual

◆ next()

void dbiplus::Dataset::next ( void )
virtual

◆ nextid()

virtual long dbiplus::Dataset::nextid ( const char * seq_name)
pure virtual

◆ num_rows()

virtual int dbiplus::Dataset::num_rows ( )
pure virtual

◆ open() [1/2]

virtual void dbiplus::Dataset::open ( )
pure virtual

◆ open() [2/2]

virtual void dbiplus::Dataset::open ( const std::string & sql)
pure virtual

◆ parse_sql()

void dbiplus::Dataset::parse_sql ( std::string & sql)
protected

◆ post()

void dbiplus::Dataset::post ( )
virtual

◆ prev()

void dbiplus::Dataset::prev ( void )
virtual

◆ query()

virtual bool dbiplus::Dataset::query ( const std::string & sql)
pure virtual

◆ refresh()

void dbiplus::Dataset::refresh ( )
virtual

◆ seek()

bool dbiplus::Dataset::seek ( int pos = 0)
virtual

◆ set_autocommit()

void dbiplus::Dataset::set_autocommit ( bool v)
inline

◆ set_field_value()

bool dbiplus::Dataset::set_field_value ( const char * f_name,
const field_value & value )
virtual

◆ set_select_sql() [1/2]

void dbiplus::Dataset::set_select_sql ( const char * sel_sql)

◆ set_select_sql() [2/2]

void dbiplus::Dataset::set_select_sql ( const std::string & select_sql)

◆ setDatabase()

void dbiplus::Dataset::setDatabase ( Database * newDb)
inline

◆ setExecSql()

void dbiplus::Dataset::setExecSql ( const char * newSql)
inline

◆ setParamList()

void dbiplus::Dataset::setParamList ( const ParamList & params)
virtual

◆ setSqlParams()

void dbiplus::Dataset::setSqlParams ( sqlType t,
const char * sqlFrmt,
... )
virtual

◆ sf()

virtual bool dbiplus::Dataset::sf ( const char * f,
const field_value & v )
inlinevirtual

◆ str_toLower()

char * dbiplus::Dataset::str_toLower ( char * s)
protected

Member Data Documentation

◆ active

bool dbiplus::Dataset::active
protected

◆ autocommit

bool dbiplus::Dataset::autocommit
protected

◆ autorefresh

bool dbiplus::Dataset::autorefresh
protected

◆ db

Database* dbiplus::Dataset::db
protected

◆ delete_sql

StringList dbiplus::Dataset::delete_sql
protected

◆ ds_state

dsStates dbiplus::Dataset::ds_state
protected

◆ edit_object

Fields * dbiplus::Dataset::edit_object
protected

◆ empty_sql

std::string dbiplus::Dataset::empty_sql
protected

◆ exec_res

result_set dbiplus::Dataset::exec_res
protected

◆ fbof

bool dbiplus::Dataset::fbof
protected

◆ feof

bool dbiplus::Dataset::feof
protected

◆ fields_object

Fields* dbiplus::Dataset::fields_object
protected

◆ frecno

int dbiplus::Dataset::frecno
protected

◆ haveError

bool dbiplus::Dataset::haveError
protected

◆ insert_sql

StringList dbiplus::Dataset::insert_sql
protected

◆ name2indexMap

std::unordered_map<std::string, unsigned int> dbiplus::Dataset::name2indexMap
protected

◆ plist

ParamList dbiplus::Dataset::plist
protected

◆ result

result_set dbiplus::Dataset::result
protected

◆ select_sql

std::string dbiplus::Dataset::select_sql
protected

◆ sql

std::string dbiplus::Dataset::sql
protected

◆ update_sql

StringList dbiplus::Dataset::update_sql
protected

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