TkN 2.1
Toolkit for Nuclei
tkdatabase Class Reference

Interface to the sqlite database. More...

Detailed Description

Interface to the sqlite database.

Definition at line 57 of file tkdatabase.h.

#include <tkdatabase.h>

Public Member Functions

 tkdatabase (bool opening_db=true)
 
virtual ~tkdatabase ()=default
 
void add_table (tkdb_table &_table)
 
void begin (tkstring _selection, tkstring _from, tkstring _condition="", tkstring _loop_name="default", tkstring _extra_cmd="")
 
void close ()
 
int count (const tkstring &_from, const tkstring &_condition="")
 resets column values and ends the select statement More...
 
void end (const tkstring &_loop_name="default")
 reads the next entry coresponding to the select statement and fills columns More...
 
int exec_sql (const char *_cmd)
 returns the first value for selection More...
 
tkstring get_full_name ()
 
tkstring get_name ()
 
sqlite3 * get_sql_db ()
 
tkdb_tableget_table (tkstring _table_name)
 
tkstring get_value (tkstring _selection, tkstring _from, tkstring _condition="")
 
std::vector< tkstring > & get_views ()
 
bool has_table (const tkstring &_table_name)
 
bool has_view (const tkstring &_table_name)
 
void load_tables ()
 
void load_views ()
 
tkdb_tablenew_table (tkstring _table_name)
 
bool next (const tkstring &_loop_name="default")
 executes the select statement More...
 
sqlite3 * open (tkstring _db, tkstring _option="OPEN")
 
tkdb_tableoperator[] (const char *_table)
 
void print (const tkstring &_properties="", const tkstring &_opt="")
 
void remove_table (tkstring _table_name)
 
void set_sql_db (sqlite3 *_sql_db)
 

Static Public Member Functions

static int getdir (tkstring _dir, std::vector< tkstring > &_files)
 
static void list_files (tkstring _dir, tkstring _pattern)
 
static tkdatabasethe_database ()
 

Constructor & Destructor Documentation

◆ tkdatabase()

tkdatabase ( bool  opening_db = true)

Definition at line 72 of file tkdatabase.cpp.

◆ ~tkdatabase()

virtual ~tkdatabase ( )
virtualdefault

Member Function Documentation

◆ add_table()

void add_table ( tkdb_table _table)

Definition at line 172 of file tkdatabase.cpp.

◆ begin()

void begin ( tkstring  _selection,
tkstring  _from,
tkstring  _condition = "",
tkstring  _loop_name = "default",
tkstring  _extra_cmd = "" 
)

Definition at line 219 of file tkdatabase.cpp.

◆ close()

void close ( )

Definition at line 140 of file tkdatabase.cpp.

◆ count()

int count ( const tkstring _from,
const tkstring _condition = "" 
)

resets column values and ends the select statement

Definition at line 296 of file tkdatabase.cpp.

◆ end()

void end ( const tkstring _loop_name = "default")

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

Definition at line 280 of file tkdatabase.cpp.

◆ exec_sql()

int exec_sql ( const char *  _cmd)

returns the first value for selection

Definition at line 327 of file tkdatabase.cpp.

◆ get_full_name()

tkstring get_full_name ( )
inline

Definition at line 89 of file tkdatabase.h.

◆ get_name()

tkstring get_name ( )
inline

Definition at line 88 of file tkdatabase.h.

◆ get_sql_db()

sqlite3 * get_sql_db ( )
inline

Definition at line 84 of file tkdatabase.h.

◆ get_table()

tkdb_table * get_table ( tkstring  _table_name)

Definition at line 200 of file tkdatabase.cpp.

◆ get_value()

tkstring get_value ( tkstring  _selection,
tkstring  _from,
tkstring  _condition = "" 
)

Definition at line 304 of file tkdatabase.cpp.

◆ get_views()

std::vector< tkstring > & get_views ( )
inline

Definition at line 97 of file tkdatabase.h.

◆ getdir()

static int getdir ( tkstring  _dir,
std::vector< tkstring > &  _files 
)
static

◆ has_table()

bool has_table ( const tkstring _table_name)

Definition at line 177 of file tkdatabase.cpp.

◆ has_view()

bool has_view ( const tkstring _table_name)

Definition at line 182 of file tkdatabase.cpp.

◆ list_files()

static void list_files ( tkstring  _dir,
tkstring  _pattern 
)
static

◆ load_tables()

void load_tables ( )

Definition at line 145 of file tkdatabase.cpp.

◆ load_views()

void load_views ( )

Definition at line 159 of file tkdatabase.cpp.

◆ new_table()

tkdb_table & new_table ( tkstring  _table_name)

Definition at line 187 of file tkdatabase.cpp.

◆ next()

bool next ( const tkstring _loop_name = "default")

executes the select statement

Definition at line 245 of file tkdatabase.cpp.

◆ open()

sqlite3 * open ( tkstring  _db,
tkstring  _option = "OPEN" 
)

Definition at line 80 of file tkdatabase.cpp.

◆ operator[]()

tkdb_table & operator[] ( const char *  _table)
inline

Definition at line 108 of file tkdatabase.h.

◆ print()

void print ( const tkstring _properties = "",
const tkstring _opt = "" 
)

Definition at line 205 of file tkdatabase.cpp.

◆ remove_table()

void remove_table ( tkstring  _table_name)

Definition at line 193 of file tkdatabase.cpp.

◆ set_sql_db()

void set_sql_db ( sqlite3 *  _sql_db)
inline

Definition at line 83 of file tkdatabase.h.

◆ the_database()

tkdatabase * the_database ( )
static

Definition at line 59 of file tkdatabase.cpp.


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