WebpagePrinterTool 2.0
Print a web page skip the browser's print preview
载入中...
搜索中...
未找到
SqliteDb类 参考

#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< PrinterConfiggetAllConfigs () 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 SqliteDbinstance ()
 

Private 成员函数

 SqliteDb ()
 
 SqliteDb (const SqliteDb &)=delete
 
SqliteDboperator= (const SqliteDb &)=delete
 
 SqliteDb (SqliteDb &&)=delete
 
SqliteDboperator= (SqliteDb &&)=delete
 
void createDb ()
 
void initDb ()
 
bool checkValid ()
 check tables is valid
 

Private 属性

QSqlDatabase db
 
std::unique_ptr< QSqlQuery > query
 

构造及析构函数说明

◆ ~SqliteDb()

SqliteDb::~SqliteDb ( )
default

◆ SqliteDb() [1/3]

SqliteDb::SqliteDb ( )
private

◆ SqliteDb() [2/3]

SqliteDb::SqliteDb ( const SqliteDb & )
privatedelete

◆ SqliteDb() [3/3]

SqliteDb::SqliteDb ( SqliteDb && )
privatedelete

成员函数说明

◆ addConfig()

void SqliteDb::addConfig ( PrinterConfig & config) const

add a new config. config.id will be set to the database id

◆ addPage()

void SqliteDb::addPage ( PrintedPage & page) const

add new page page.id will be set to the database id

◆ checkValid()

bool SqliteDb::checkValid ( )
private

check tables is valid

返回
true
false

◆ createDb()

void SqliteDb::createDb ( )
private

◆ delConfig()

void SqliteDb::delConfig ( int id) const

delete a config by id.

◆ getAllConfigs()

std::deque< PrinterConfig > SqliteDb::getAllConfigs ( ) const

get all configs.

返回
std::deque<PrinterConfig>

◆ getConfigById()

PrinterConfig SqliteDb::getConfigById ( int id) const

Get the Config By Id object

参数
id
返回
PrinterConfig

◆ getPagesDesc()

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_indexThe starting index for pagination.
page_sizeThe number of items to retrieve per page.
返回
A deque of PrintedPage objects and count

◆ initDb()

void SqliteDb::initDb ( )
private

◆ instance()

SqliteDb & SqliteDb::instance ( )
static

◆ operator=() [1/2]

SqliteDb & SqliteDb::operator= ( const SqliteDb & )
privatedelete

◆ operator=() [2/2]

SqliteDb & SqliteDb::operator= ( SqliteDb && )
privatedelete

◆ updateConfig()

void SqliteDb::updateConfig ( const PrinterConfig & printer_config) const

update Config

◆ updatePage()

void SqliteDb::updatePage ( const PrintedPage & page) const

update Page

类成员变量说明

◆ db

QSqlDatabase SqliteDb::db
private

◆ query

std::unique_ptr<QSqlQuery> SqliteDb::query
private

该类的文档由以下文件生成: