| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #pragma once
- #include <string>
- #include <boost/noncopyable.hpp>
- #include <yaml-cpp/yaml.h>
- #include <fstream>
- using namespace std;
- #pragma comment(lib,"libyaml-cppmd-mt.lib")
- #define YAMLCONFIGFILEPATH "HttpServer.yml"
- class YamlConfig :public boost::noncopyable
- {
- public:
- YamlConfig();
- ~YamlConfig();
- static YamlConfig* GetInstance() { return &sp; };
- auto GetWsServerIP()const { return wsServerIP; }
- auto GetWsServerPort()const { return wsServerPort; }
- auto GetAcdIP() const { return acdIP; };
- auto GetAcdPort() const { return acdPort; };
- auto GetHttpServerIP() const { return httpIP; };
- auto GetHttpServerPort() const { return httpPort; };
- std::string GetWssSSLFilePath()const { return sslFilePath; }
- std::string GetWssPwd() const { return sslPwd; }
- int GetWssPort() const { return wssPort; }
- private:
- static YamlConfig sp;
- private:
- std::string wsServerIP;
- int wsServerPort;
- std::string acdIP;
- int acdPort;
- string httpIP;
- int httpPort;
- int wssPort;
- std::string sslFilePath;
- std::string sslPwd;
- };
|