mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
58 lines
1007 B
C++
58 lines
1007 B
C++
#pragma once
|
|
|
|
#include <map>
|
|
#include <string>
|
|
|
|
struct AppOption
|
|
{
|
|
int debug {0};
|
|
std::string webSrvUrl;
|
|
std::string lunchDate;
|
|
|
|
struct {
|
|
std::string host;
|
|
int port;
|
|
std::string user;
|
|
std::string passwd;
|
|
std::string dbname;
|
|
} database;
|
|
|
|
struct {
|
|
int useToken {1};
|
|
int port {0};
|
|
int encryption {1};
|
|
std::string encryptKey;
|
|
} http;
|
|
|
|
struct {
|
|
std::string host;
|
|
std::string username;
|
|
std::string password;
|
|
} mqtt;
|
|
|
|
struct {
|
|
float latitude {0};
|
|
float longitude {0};
|
|
float altitude {0};
|
|
} view;
|
|
|
|
struct VideoInfo {
|
|
std::string host;
|
|
int port;
|
|
std::string user;
|
|
std::string passwd;
|
|
};
|
|
|
|
std::map<std::string, VideoInfo> mapVideo;
|
|
|
|
};
|
|
|
|
class Config
|
|
{
|
|
public:
|
|
static bool init(std::string filename);
|
|
|
|
static AppOption::VideoInfo* getVideoInfo(std::string name);
|
|
|
|
static AppOption option;
|
|
}; |