123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #ifndef FOUNDATION_SETTINGS_CONFIG_PARSER_H
- #define FOUNDATION_SETTINGS_CONFIG_PARSER_H
- #include "xmlconfig.h"
- #include <unordered_map>
- #include <vector>
- namespace settings {
- class ConfigParser {
- public:
- ConfigParser();
- ~ConfigParser();
- struct DataCenter {
- std::string name;
- std::string ID;
- std::string key;
- std::string host;
- int32_t port;
- bool isTls;
- int32_t protoType;
- int32_t yunID;
- };
- struct LoginUser {
- std::string user;
- std::string passwd;
- };
- struct Channel {
- int32_t type;
- std::string devPath;
- };
- enum ChnType { CHN_COM = 0, CHN_TCP, CHN_UDP, CHN_LORA };
- std::vector<DataCenter> GetDataCenter() const;
- std::vector<LoginUser> GetLoginUsers() const;
- int16_t GetWWWPort() const;
- int32_t GetRetryTimes();
- std::unordered_map<std::string, Channel> GetChannels() const;
- private:
- XmlConfig *xmlConfig_;
- };
- } // namespace settings
- #endif // FOUNDATION_SETTINGS_CONFIG_PARSER_H
|