You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PdnsSlaveConfig.h 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // Created by robin on 8/8/15.
  3. //
  4. #ifndef PDNS_SLAVE_PDNSSLAVECONFIG_H
  5. #define PDNS_SLAVE_PDNSSLAVECONFIG_H
  6. # include <string>
  7. # include "DBO/Result.h"
  8. # include "DBO/SqlConfiguration.h"
  9. namespace Json
  10. {
  11. class Value;
  12. }
  13. class PdnsSlaveConfig
  14. {
  15. public:
  16. PdnsSlaveConfig(const std::string& filePath);
  17. BResult readConfig();
  18. const std::string &getDhcpdFilePath() const;
  19. const std::string &getDhcpdTemplatePath() const;
  20. const std::string &getHostsPath() const;
  21. const std::string &getDbType() const;
  22. const SqlConfiguration &getMasterConfig() const;
  23. const SqlConfiguration &getSlaveConfig() const;
  24. private:
  25. BResult readString(const Json::Value& value, const std::string& name, std::string& dest);
  26. BResult readSqlConfiguration(const Json::Value &value, const std::string &name, SqlConfiguration& sqlConfiguration);
  27. std::string _filePath;
  28. private:
  29. std::string _dhcpdFilePath;
  30. std::string _dhcpdTemplatePath;
  31. std::string _hostsPath;
  32. std::string _dbType;
  33. SqlConfiguration _masterConfig;
  34. SqlConfiguration _slaveConfig;
  35. };
  36. #endif //PDNS_SLAVE_PDNSSLAVECONFIG_H