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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 SqlConfiguration &getMasterConfig() const;
  22. const SqlConfiguration &getSlaveConfig() const;
  23. private:
  24. BResult readString(const Json::Value& value, const std::string& name, std::string& dest);
  25. BResult readSqlConfiguration(const Json::Value &value, const std::string &name, SqlConfiguration& sqlConfiguration);
  26. std::string _filePath;
  27. private:
  28. std::string _dhcpdFilePath;
  29. std::string _dhcpdTemplatePath;
  30. std::string _hostsPath;
  31. SqlConfiguration _masterConfig;
  32. SqlConfiguration _slaveConfig;
  33. };
  34. #endif //PDNS_SLAVE_PDNSSLAVECONFIG_H