Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
config_manager.h
Go to the documentation of this file.
1 #ifndef CONFIG_MANAGER_H
2 #define CONFIG_MANAGER_H
3 #include <json/json.h>
4 #include <vector>
5 
6 //= SCRIPTABLE
7 namespace Utility {
11  class ConfigManager {
12  private:
13  Json::Value config_handle;
14  public:
18  ConfigManager();
19 
27  bool loadConfig(const std::string& file_path);
28  //= BEGIN SCRIPTABLE
29 
37  int getInt(const std::string& key);
45  unsigned int getUnsignedInt(const std::string& key);
53  std::string getString(const std::string& key);
61  float getFloat(const std::string& key);
69  double getDouble(const std::string& key);
77  bool getBool(const std::string& key);
85  std::vector<std::string> getStringVector(const std::string& key);
93  std::vector<unsigned int> getUnsignedIntVector(const std::string& key);
94  //= END SCRIPTABLE
95  };
96 }
97 
98 #endif
bool getBool(const std::string &key)
Gets a bool from config.
Definition: config_manager.cpp:80
Class for configuration manager to load json configurations.
Definition: config_manager.h:11
unsigned int getUnsignedInt(const std::string &key)
Gets an unsigned int from config.
Definition: config_manager.cpp:56
double getDouble(const std::string &key)
Gets a double from config.
Definition: config_manager.cpp:74
int getInt(const std::string &key)
Gets an int from config.
Definition: config_manager.cpp:50
bool loadConfig(const std::string &file_path)
Loads a configuration.
Definition: config_manager.cpp:11
float getFloat(const std::string &key)
Gets a float from config.
Definition: config_manager.cpp:68
std::vector< std::string > getStringVector(const std::string &key)
Gets a string vector from config.
Definition: config_manager.cpp:22
std::string getString(const std::string &key)
Gets a string from config.
Definition: config_manager.cpp:62
std::vector< unsigned int > getUnsignedIntVector(const std::string &key)
Gets an unsigned int vector from config.
Definition: config_manager.cpp:35
ConfigManager()
Constructs the configManager.
Definition: config_manager.cpp:7