Files
energy_storage/src/app/Config.h

59 lines
1.0 KiB
C
Raw Normal View History

#pragma once
2025-09-19 18:54:36 +08:00
#include <map>
#include <string>
struct AppOption
{
2025-09-19 18:54:36 +08:00
int debug {0};
std::string webSrvUrl;
std::string lunchDate;
2025-09-20 16:41:08 +08:00
std::string exportpath;
2025-09-19 18:54:36 +08:00
struct {
std::string host;
int port;
std::string user;
std::string passwd;
std::string dbname;
} database;
struct {
2025-09-19 18:54:36 +08:00
int useToken {1};
int port {0};
2025-09-19 18:54:36 +08:00
int encryption {1};
std::string encryptKey;
} http;
2025-09-04 19:31:04 +08:00
struct {
std::string host;
std::string username;
std::string password;
} mqtt;
2025-09-19 18:54:36 +08:00
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);
2025-09-19 18:54:36 +08:00
static AppOption::VideoInfo* getVideoInfo(std::string name);
static AppOption option;
};