Configuration.hpp 765 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <boost/noncopyable.hpp>
  3. #include <vector>
  4. #include <string>
  5. #include <stdexcept>
  6. namespace config {
  7. class ConfigException : public std::runtime_error {
  8. public:
  9. ConfigException(const std::string &message)
  10. : std::runtime_error(message) {
  11. }
  12. };
  13. struct ConfigurationImpl;
  14. class Configuration : boost::noncopyable {
  15. public:
  16. Configuration(const std::string fileName);
  17. Configuration(const std::vector<std::string> fileNames);
  18. ~Configuration();
  19. int getInt(const std::string &property);
  20. bool getBool(const std::string &property);
  21. std::string getString(const std::string &property);
  22. private:
  23. ConfigurationImpl *impl;
  24. };
  25. }