TkN 2.6
Toolkit for Nuclei
Loading...
Searching...
No Matches
tkdatabase Class Reference

Interface to the sqlite database. More...

#include <db/tkdatabase.h>

Public Member Functions

 tkdatabase (bool opening_db=true)
 
virtual ~tkdatabase ()
 
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
 
void end (const tkstring &_loop_name="default")
 reads the next entry coresponding to the select statement and fills columns
 
int exec_sql (const char *_cmd)
 returns the first value for selection
 
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
 
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 ()
 

Detailed Description

Interface to the sqlite database.

Definition at line 34 of file tkdatabase.h.

Constructor & Destructor Documentation

◆ tkdatabase()

tkdatabase ( bool opening_db = true)

Definition at line 49 of file tkdatabase.cpp.

◆ ~tkdatabase()

~tkdatabase ( )
virtual

Definition at line 56 of file tkdatabase.cpp.

Member Function Documentation

◆ add_table()

void add_table ( tkdb_table & _table)

Definition at line 154 of file tkdatabase.cpp.

◆ begin()

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

Definition at line 201 of file tkdatabase.cpp.

◆ close()

void close ( )

Definition at line 122 of file tkdatabase.cpp.

◆ count()

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

resets column values and ends the select statement

Definition at line 279 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 263 of file tkdatabase.cpp.

◆ exec_sql()

int exec_sql ( const char * _cmd)

returns the first value for selection

Definition at line 310 of file tkdatabase.cpp.

◆ get_full_name()

tkstring get_full_name ( )
inline

Definition at line 67 of file tkdatabase.h.

◆ get_name()

tkstring get_name ( )
inline

Definition at line 66 of file tkdatabase.h.

◆ get_sql_db()

sqlite3 * get_sql_db ( )
inline

Definition at line 62 of file tkdatabase.h.

◆ get_table()

tkdb_table * get_table ( tkstring _table_name)

Definition at line 182 of file tkdatabase.cpp.

◆ get_value()

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

Definition at line 287 of file tkdatabase.cpp.

◆ get_views()

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

Definition at line 75 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 159 of file tkdatabase.cpp.

◆ has_view()

bool has_view ( const tkstring & _table_name)

Definition at line 164 of file tkdatabase.cpp.

◆ list_files()

static void list_files ( tkstring _dir,
tkstring _pattern )
static

◆ load_tables()

void load_tables ( )

Definition at line 127 of file tkdatabase.cpp.

◆ load_views()

void load_views ( )

Definition at line 141 of file tkdatabase.cpp.

◆ new_table()

tkdb_table & new_table ( tkstring _table_name)

Definition at line 169 of file tkdatabase.cpp.

◆ next()

bool next ( const tkstring & _loop_name = "default")

executes the select statement

Definition at line 229 of file tkdatabase.cpp.

◆ open()

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

Definition at line 62 of file tkdatabase.cpp.

◆ operator[]()

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

Definition at line 86 of file tkdatabase.h.

◆ print()

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

Definition at line 187 of file tkdatabase.cpp.

◆ remove_table()

void remove_table ( tkstring _table_name)

Definition at line 175 of file tkdatabase.cpp.

◆ set_sql_db()

void set_sql_db ( sqlite3 * _sql_db)
inline

Definition at line 61 of file tkdatabase.h.

◆ the_database()

tkdatabase * the_database ( )
static

Definition at line 36 of file tkdatabase.cpp.


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