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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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/SqlConfiguration.h"
  8. namespace Json
  9. {
  10. class Value;
  11. }
  12. class PdnsSlaveConfig
  13. {
  14. public:
  15. PdnsSlaveConfig(const std::string& filePath);
  16. bool readConfig();
  17. const std::string &getDhcpdFilePath() const;
  18. const std::string &getDhcpdTemplatePath() const;
  19. const std::string &getHostsPath() const;
  20. const SqlConfiguration &getMasterConfig() const;
  21. const SqlConfiguration &getSlaveConfig() const;
  22. private:
  23. bool readString(const Json::Value& value, const std::string& name, std::string& dest);
  24. bool readSqlConfiguration(const Json::Value &value, const std::string &name, SqlConfiguration& sqlConfiguration);
  25. std::string _filePath;
  26. private:
  27. std::string _dhcpdFilePath;
  28. std::string _dhcpdTemplatePath;
  29. std::string _hostsPath;
  30. SqlConfiguration _masterConfig;
  31. SqlConfiguration _slaveConfig;
  32. };
  33. #endif //PDNS_SLAVE_PDNSSLAVECONFIG_H