You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
904 B
47 lines
904 B
#ifndef CONFIGMANAGER_H
|
|
#define CONFIGMANAGER_H
|
|
|
|
#include "Singleton.h"
|
|
#include <QMap>
|
|
#include <QString>
|
|
#include <QVariant>
|
|
|
|
class ConfigManager : public Singleton<ConfigManager>
|
|
{
|
|
private:
|
|
qint32 _serverPort;
|
|
|
|
QMap<QString, QVariant> _databaseConf;
|
|
|
|
QString _logFilename;
|
|
|
|
public:
|
|
ConfigManager();
|
|
|
|
/**
|
|
* @brief load 加载配置文件
|
|
* @param file 配置文件路径
|
|
*/
|
|
void load(const QString &filepath);
|
|
|
|
/**
|
|
* @brief serverPort 获取服务端口配置信息
|
|
* @return 端口
|
|
*/
|
|
qint32 serverPort() const;
|
|
|
|
/**
|
|
* @brief databaseConf 获取数据库配置
|
|
* @return 数据库配置
|
|
*/
|
|
const QMap<QString, QVariant> &databaseConf() const;
|
|
|
|
/**
|
|
* @brief logFilename 获取日志文件名称
|
|
* @return 日志文件名称
|
|
*/
|
|
const QString &logFilename() const;
|
|
};
|
|
|
|
#endif // CONFIGMANAGER_H
|