Configuration.hpp 821 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef CONFIGURATION_HPP_
  2. #define CONFIGURATION_HPP_
  3. #include <string>
  4. #include <stdexcept>
  5. #include <boost/noncopyable.hpp>
  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. }
  26. #endif /* CONFIGURATION_HPP_ */