Configuration.hpp 747 B

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