TkN 2.7
Toolkit for Nuclei
Loading...
Searching...
No Matches
tkdb_table Class Reference

Representaiton of a sqlite data table. More...

#include <db/tkdb_table.h>

Classes

struct  measure_data_struct
 data structure used to fill a tkmeasure object from the sqlite database More...
 

Public Types

using measure_columns = std::array<tkdb_column *, 6>
 

Public Member Functions

 tkdb_table ()
 
 tkdb_table (const char *_name, sqlite3 *_db)
 
 tkdb_table (const tkdb_table &_other)
 
 tkdb_table (tkdb_table &&_other) noexcept
 
virtual ~tkdb_table ()
 
void add_column (const char *_colname, const char *_coltype)
 
void add_constraint (const char *_constraint)
 
void begin (tkstring _condition, tkstring _selection="*")
 
void end ()
 reads the next entry coresponding to the select statement and fills columns
 
tkdb_column * get_column (const tkstring &_col_name)
 
row & get_columns ()
 
measure_columns get_measure_columns (const tkstring &_col_base_name)
 
tkstring get_name ()
 
bool has_column (const tkstring &_col_name)
 
void load ()
 resets column values and ends the select statement
 
bool next ()
 executes the select statement
 
tkdb_table & operator= (const tkdb_table &_other)
 
tkdb_table & operator= (tkdb_table &&_other) noexcept
 
tkdb_column & operator[] (const char *_column)
 
void print (const tkstring &_opt="")
 
void print_columns (const tkstring &_opt="")
 
void print_rows (const char *_selection, const char *_properties="*")
 
void push_dummy_row ()
 
void push_row ()
 
void read_measure (measure_data_struct &_struct, const measure_columns &_columns)
 
void read_measure (measure_data_struct &_struct, const tkstring &_col_base_name)
 
void reset_column_values ()
 
void update_row (const tkstring &_where)
 
void write_to_database ()
 

Detailed Description

Representaiton of a sqlite data table.

Definition at line 30 of file tkdb_table.h.

Member Typedef Documentation

◆ measure_columns

using measure_columns = std::array<tkdb_column *, 6>

Definition at line 81 of file tkdb_table.h.

Constructor & Destructor Documentation

◆ tkdb_table() [1/4]

tkdb_table ( const char * _name,
sqlite3 * _db )

Definition at line 29 of file tkdb_table.cpp.

◆ tkdb_table() [2/4]

tkdb_table ( )
inline

Definition at line 95 of file tkdb_table.h.

◆ tkdb_table() [3/4]

tkdb_table ( const tkdb_table & _other)

Definition at line 37 of file tkdb_table.cpp.

◆ tkdb_table() [4/4]

tkdb_table ( tkdb_table && _other)
noexcept

Definition at line 58 of file tkdb_table.cpp.

◆ ~tkdb_table()

~tkdb_table ( )
virtual

Definition at line 91 of file tkdb_table.cpp.

Member Function Documentation

◆ add_column()

void add_column ( const char * _colname,
const char * _coltype )

Definition at line 239 of file tkdb_table.cpp.

◆ add_constraint()

void add_constraint ( const char * _constraint)

Definition at line 247 of file tkdb_table.cpp.

◆ begin()

void begin ( tkstring _condition,
tkstring _selection = "*" )

Definition at line 164 of file tkdb_table.cpp.

◆ end()

void end ( )

reads the next entry coresponding to the select statement and fills columns

Definition at line 206 of file tkdb_table.cpp.

◆ get_column()

tkdb_column * get_column ( const tkstring & _col_name)

Definition at line 258 of file tkdb_table.cpp.

◆ get_columns()

row & get_columns ( )
inline

Definition at line 126 of file tkdb_table.h.

◆ get_measure_columns()

tkdb_table::measure_columns get_measure_columns ( const tkstring & _col_base_name)

Definition at line 409 of file tkdb_table.cpp.

◆ get_name()

tkstring get_name ( )
inline

Definition at line 102 of file tkdb_table.h.

◆ has_column()

bool has_column ( const tkstring & _col_name)

Definition at line 253 of file tkdb_table.cpp.

◆ load()

void load ( )

resets column values and ends the select statement

Definition at line 105 of file tkdb_table.cpp.

◆ next()

bool next ( )

executes the select statement

Definition at line 183 of file tkdb_table.cpp.

◆ operator=() [1/2]

tkdb_table & operator= ( const tkdb_table & _other)

Definition at line 46 of file tkdb_table.cpp.

◆ operator=() [2/2]

tkdb_table & operator= ( tkdb_table && _other)
noexcept

Definition at line 73 of file tkdb_table.cpp.

◆ operator[]()

tkdb_column & operator[] ( const char * _column)
inline

Definition at line 104 of file tkdb_table.h.

◆ print()

void print ( const tkstring & _opt = "")

Definition at line 125 of file tkdb_table.cpp.

◆ print_columns()

void print_columns ( const tkstring & _opt = "")

Definition at line 131 of file tkdb_table.cpp.

◆ print_rows()

void print_rows ( const char * _selection,
const char * _properties = "*" )

Definition at line 143 of file tkdb_table.cpp.

◆ push_dummy_row()

void push_dummy_row ( )

Definition at line 378 of file tkdb_table.cpp.

◆ push_row()

void push_row ( )

Definition at line 270 of file tkdb_table.cpp.

◆ read_measure() [1/2]

void read_measure ( measure_data_struct & _struct,
const measure_columns & _columns )

Definition at line 423 of file tkdb_table.cpp.

◆ read_measure() [2/2]

void read_measure ( measure_data_struct & _struct,
const tkstring & _col_base_name )

Definition at line 398 of file tkdb_table.cpp.

◆ reset_column_values()

void reset_column_values ( )

Definition at line 264 of file tkdb_table.cpp.

◆ update_row()

void update_row ( const tkstring & _where)

Definition at line 336 of file tkdb_table.cpp.

◆ write_to_database()

void write_to_database ( )

Definition at line 359 of file tkdb_table.cpp.


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