Config.h 608 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef CONFIG_H
  2. #define CONFIG_H
  3. #include <fstream>
  4. #include <map>
  5. #include <sstream>
  6. #include <vector>
  7. /**
  8. * Namespace which loads and holds configuration data
  9. */
  10. namespace Config {
  11. /**
  12. * Load data from file into storage
  13. *
  14. * @param filename the name of the file which holds the data
  15. */
  16. bool init(const std::string &filename);
  17. /**
  18. * Load data from file into storage
  19. *
  20. * @param key get value from storage by key
  21. */
  22. std::string getValue(const std::string &key);
  23. /**
  24. * Map which holds the configuration data
  25. */
  26. extern std::map<std::string, std::string> storage;
  27. }; // namespace Config
  28. #endif