Rabbit Remote Control 0.1.0-bate8
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
CDatabaseFile Class Reference

File database. More...

#include <Database.h>

Inheritance diagram for CDatabaseFile:
Inheritance graph
[legend]
Collaboration diagram for CDatabaseFile:
Collaboration graph
[legend]

Public Member Functions

 CDatabaseFile (const QString &szSuffix=QString(), QObject *parent=nullptr)
 
bool IsExist (const QString &szFile)
 
QByteArray Load (const QString &szFile)
 Load.
 
bool Save (const QString &szFile)
 Save.
 
bool ImportFileToDatabaseFromJson (const QJsonObject &obj, QString &szFile)
 Import file to database from JSON.
 
- Public Member Functions inherited from CDatabase
 CDatabase (QObject *parent=nullptr)
 
QSqlDatabase GetDatabase () const
 
virtual bool IsOpen () const
 
void CloseDatabase ()
 Close database.
 
const CParameterDatabaseGetParameter () const
 
const QString GetError () const
 
bool SetDatabase (const CDatabase *db)
 Share an existing database.
 
bool SetDatabase (const QSqlDatabase db, const CParameterDatabase *pPara)
 Share an existing database.
 
bool OpenDatabase (const CParameterDatabase *pPara=nullptr, const QString &szConnectName=QString())
 Open a new database.
 
bool OpenMySqlDatabase (const CParameterDatabase *pPara, const QString &szConnectName=QString())
 
bool OpenODBCDatabase (const CParameterDatabase *pPara, const QString &szConnectName=QString())
 
bool OpenSQLiteDatabase (const CParameterDatabase *pPara, const QString &szConnectionName=QString())
 
bool OpenSQLiteDatabase (const QString &szFile, const QString &szConnectionName=QString())
 
virtual bool ExportToJsonFile (const QString &szFile)
 
virtual bool ImportFromJsonFile (const QString &szFile)
 

Static Public Member Functions

static bool ExportFileToJson (const QString &szFile, QJsonObject &obj)
 ExportFileToJson.
 
static bool ImportFileFromJson (const QJsonObject &obj, QString &szFile)
 Import file from JSON.
 
static QString GetFile (const QString &szFile)
 Get the file with file system from the file in database.
 
static QString SetFile (const QString &szFile)
 Set the file with file system to the file in database.
 

Protected Member Functions

virtual bool OnInitializeSqliteDatabase () override
 
virtual bool OnInitializeMySqlDatabase () override
 
- Protected Member Functions inherited from CDatabase
void SetError (const QString &szErr=QString())
 
virtual bool ExportToJson (QJsonObject &obj)
 
virtual bool ImportFromJson (const QJsonObject &obj)
 
virtual bool OnInitializeDatabase ()
 Initialize database.
 

Private Attributes

QString m_szTableName
 

Additional Inherited Members

- Signals inherited from CDatabase
void sigChanged ()
 
- Protected Attributes inherited from CDatabase
QString m_szConnectName
 
QString m_MinVersion
 
const CParameterDatabasem_pPara
 

Detailed Description

File database.

Note
The file field is filename, don't include path.

Definition at line 163 of file Database.h.

Constructor & Destructor Documentation

◆ CDatabaseFile()

CDatabaseFile::CDatabaseFile ( const QString &  szSuffix = QString(),
QObject *  parent = nullptr 
)
explicit

Definition at line 723 of file Database.cpp.

Member Function Documentation

◆ ExportFileToJson()

bool CDatabaseFile::ExportFileToJson ( const QString &  szFile,
QJsonObject &  obj 
)
static

ExportFileToJson.

Parameters
szFilefile path(with file system)
obj
Returns

Definition at line 657 of file Database.cpp.

◆ GetFile()

QString CDatabaseFile::GetFile ( const QString &  szFile)
static

Get the file with file system from the file in database.

Parameters
szFilethe file in database
Returns
the file with file system

Definition at line 881 of file Database.cpp.

◆ ImportFileFromJson()

bool CDatabaseFile::ImportFileFromJson ( const QJsonObject &  obj,
QString &  szFile 
)
static

Import file from JSON.

Parameters
obj
szFilefile path(with file system)
Returns

Definition at line 686 of file Database.cpp.

◆ ImportFileToDatabaseFromJson()

bool CDatabaseFile::ImportFileToDatabaseFromJson ( const QJsonObject &  obj,
QString &  szFile 
)

Import file to database from JSON.

Parameters
obj
szFilefile path(with file system)
Returns

Definition at line 715 of file Database.cpp.

◆ IsExist()

bool CDatabaseFile::IsExist ( const QString &  szFile)

Definition at line 859 of file Database.cpp.

◆ Load()

QByteArray CDatabaseFile::Load ( const QString &  szFile)

Load.

Parameters
szFilethe file path(with file system)

Definition at line 732 of file Database.cpp.

◆ OnInitializeMySqlDatabase()

bool CDatabaseFile::OnInitializeMySqlDatabase ( )
overrideprotectedvirtual

Reimplemented from CDatabase.

Definition at line 839 of file Database.cpp.

◆ OnInitializeSqliteDatabase()

bool CDatabaseFile::OnInitializeSqliteDatabase ( )
overrideprotectedvirtual

Reimplemented from CDatabase.

Definition at line 816 of file Database.cpp.

◆ Save()

bool CDatabaseFile::Save ( const QString &  szFile)

Save.

Parameters
szFilethe file path(with file system)

Definition at line 756 of file Database.cpp.

◆ SetFile()

QString CDatabaseFile::SetFile ( const QString &  szFile)
static

Set the file with file system to the file in database.

Parameters
szFilethe file with system system
Returns
the file in database

Definition at line 892 of file Database.cpp.

Member Data Documentation

◆ m_szTableName

QString CDatabaseFile::m_szTableName
private

Definition at line 224 of file Database.h.


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