96 lines
2.6 KiB
C
96 lines
2.6 KiB
C
|
#pragma once
|
|||
|
|
|||
|
#include <QtWidgets/QWidget>
|
|||
|
#include <sstream>
|
|||
|
#include <QString>
|
|||
|
#include <QDomDocument>
|
|||
|
#include <QTextStream>
|
|||
|
#include <QFile>
|
|||
|
#include <QDir>
|
|||
|
#include <QSqlDatabase>
|
|||
|
#include <QSqlError>
|
|||
|
#include <QSqlQuery>
|
|||
|
#include <QMessageBox>
|
|||
|
#include <vector>
|
|||
|
using namespace std;
|
|||
|
|
|||
|
#pragma region SoftKey
|
|||
|
class SoftKey
|
|||
|
{
|
|||
|
public:
|
|||
|
//SoftKey<65><79>
|
|||
|
QString GetKey(QString key);
|
|||
|
};
|
|||
|
#pragma endregion
|
|||
|
|
|||
|
#pragma region FolderOperation
|
|||
|
class FolderOperation
|
|||
|
{
|
|||
|
public:
|
|||
|
//ɾ<><C9BE>N<EFBFBD><4E>ǰ<EFBFBD><C7B0><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|||
|
bool FindFileForDelete(QString key, QString path, int day = -30);
|
|||
|
|
|||
|
//ɾ<><C9BE>N<EFBFBD><4E>ǰ<EFBFBD><C7B0><EFBFBD>ļ<EFBFBD><C4BC>У<EFBFBD>
|
|||
|
bool FindFolderForDelete(QString key, QString path, int day = 30);
|
|||
|
};
|
|||
|
#pragma endregion
|
|||
|
|
|||
|
#pragma region SQLite
|
|||
|
class SQLite
|
|||
|
{
|
|||
|
public:
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQLite<74><65><EFBFBD>ݿ⣻
|
|||
|
//sql_nameΪ<65><CEAA><EFBFBD>ݿ<EFBFBD><DDBF>ļ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>磺QDir::currentPath() + "/MyDataBase.db"<22><>
|
|||
|
//databaseΪ<65><CEAA><EFBFBD>ݿ⣻
|
|||
|
bool CreateConnectDB(QString key, QString sql_name, QSqlDatabase &database);
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//table_nameΪ<65><CEAA><EFBFBD>ݿ<EFBFBD><DDBF>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3>磺LoginTable<6C><65>
|
|||
|
bool CreateTable(QString key, QString table_name);
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>
|
|||
|
//table_nameΪ<65><CEAA><EFBFBD>ݿ<EFBFBD><DDBF>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3>磺LoginTable<6C><65>user_nameΪ<65>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>passwordΪ<64><CEAA><EFBFBD>룻
|
|||
|
bool InsertData(QString key, QString table_name, QString user_name, QString password);
|
|||
|
|
|||
|
//<2F><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>(Ĭ<>ϱ<EFBFBD><CFB1><EFBFBD>ΪLoginTable)<29><>
|
|||
|
//user_nameΪ<65>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>passwordΪ<64>ĵ<DEB8><C4B5><EFBFBD><EFBFBD>룻
|
|||
|
bool ModifyData(QString key, QString user_name, QString password);
|
|||
|
|
|||
|
//<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>(Ĭ<>ϱ<EFBFBD><CFB1><EFBFBD>ΪLoginTable)<29><>
|
|||
|
//user_nameΪ<65>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>passwordΪ<64><CEAA>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD>룻
|
|||
|
bool QueryData(QString key, QString user_name, QString &password);
|
|||
|
|
|||
|
//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(Ĭ<>ϱ<EFBFBD><CFB1><EFBFBD>ΪLoginTable)<29><>
|
|||
|
//user_nameΪ<65>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
bool DeleteData(QString key, QString user_name);
|
|||
|
|
|||
|
//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//table_nameΪ<65><CEAA><EFBFBD>ݿ<EFBFBD><DDBF>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><C6A3>磺LoginTable<6C><65>
|
|||
|
bool DeleteTable(QString key, QString table_name);
|
|||
|
|
|||
|
//<2F>ر<EFBFBD><D8B1><EFBFBD><EFBFBD>ݿ⣻
|
|||
|
//databaseΪ<65><CEAA><EFBFBD>ݿ⣻
|
|||
|
bool CloseDB(QString key, QSqlDatabase database);
|
|||
|
};
|
|||
|
#pragma endregion
|
|||
|
|
|||
|
#pragma region XML
|
|||
|
class XML
|
|||
|
{
|
|||
|
public:
|
|||
|
//<2F><><EFBFBD><EFBFBD>5<EFBFBD><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Xml<6D>ļ<EFBFBD><C4BC><EFBFBD>
|
|||
|
//file_nameΪXML<4D>ļ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>磺QDir::currentPath() + "/Param.xml"<22><>
|
|||
|
bool CreateXml5(QString key, QString file_name, QString value1, QString value2, QString value3, QString value4, QString value5);
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD>9<EFBFBD><39><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Xml<6D>ļ<EFBFBD><C4BC><EFBFBD>
|
|||
|
//file_nameΪXML<4D>ļ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>磺QDir::currentPath() + "/Param.xml"<22><>
|
|||
|
bool CreateXml9(QString key, QString file_name, QString value1, QString value2, QString value3, QString value4, QString value5, QString value6, QString value7, QString value8, QString value9);
|
|||
|
|
|||
|
//<2F><EFBFBD>Xml<6D>ļ<EFBFBD><C4BC>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
bool ModifyXml(QString key, QString file_name, vector<string> parameter, vector<string> value);
|
|||
|
|
|||
|
//<2F><>ȡXml<6D>ļ<EFBFBD><C4BC>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
bool ReadXml(QString key, QString file_name, QString parameter, QString& value);
|
|||
|
};
|
|||
|
#pragma endregion
|