WebpagePrinterTool 2.0
Print a web page skip the browser's print preview
|
#include <SqliteDb.h>
Public 成员函数 | |
~SqliteDb ()=default | |
void | addConfig (PrinterConfig &) const |
add a new config. config.id will be set to the database id | |
void | updateConfig (const PrinterConfig &) const |
update Config | |
void | delConfig (int id) const |
delete a config by id. | |
PrinterConfig | getConfigById (int id) const |
Get the Config By Id object | |
std::deque< PrinterConfig > | getAllConfigs () const |
get all configs. | |
void | addPage (PrintedPage &) const |
add new page page.id will be set to the database id | |
void | updatePage (const PrintedPage &) const |
update Page | |
std::tuple< std::deque< PrintedPage >, int > | getPagesDesc (int page_index, int page_size) const |
静态 Public 成员函数 | |
static SqliteDb & | instance () |
Private 成员函数 | |
SqliteDb () | |
SqliteDb (const SqliteDb &)=delete | |
SqliteDb & | operator= (const SqliteDb &)=delete |
SqliteDb (SqliteDb &&)=delete | |
SqliteDb & | operator= (SqliteDb &&)=delete |
void | createDb () |
void | initDb () |
bool | checkValid () |
check tables is valid | |
Private 属性 | |
QSqlDatabase | db |
std::unique_ptr< QSqlQuery > | query |
|
default |
|
private |
|
privatedelete |
|
privatedelete |
void SqliteDb::addConfig | ( | PrinterConfig & | config | ) | const |
add a new config. config.id will be set to the database id
void SqliteDb::addPage | ( | PrintedPage & | page | ) | const |
add new page page.id will be set to the database id
|
private |
check tables is valid
|
private |
void SqliteDb::delConfig | ( | int | id | ) | const |
delete a config by id.
std::deque< PrinterConfig > SqliteDb::getAllConfigs | ( | ) | const |
get all configs.
PrinterConfig SqliteDb::getConfigById | ( | int | id | ) | const |
std::tuple< std::deque< PrintedPage >, int > SqliteDb::getPagesDesc | ( | int | page_index, |
int | page_size ) const |
Retrieves a deque of PrintedPage objects in descending order, paginated by the specified index and size.
page_index | The starting index for pagination. |
page_size | The number of items to retrieve per page. |
|
private |
|
static |
void SqliteDb::updateConfig | ( | const PrinterConfig & | printer_config | ) | const |
update Config
void SqliteDb::updatePage | ( | const PrintedPage & | page | ) | const |
update Page
|
private |
|
private |