#ifndef FOUNDATION_SETTINGS_CONFIG_PARSER_H #define FOUNDATION_SETTINGS_CONFIG_PARSER_H #include "xmlconfig.h" #include #include 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, CHN_MAX }; std::vector GetDataCenter() const; std::vector GetLoginUsers() const; int16_t GetWWWPort() const; int32_t GetRetryTimes(); std::unordered_map GetChannels() const; Channel FindChannel(const std::string &name); private: XmlConfig *xmlConfig_; }; } // namespace settings #endif // FOUNDATION_SETTINGS_CONFIG_PARSER_H