summaryrefslogtreecommitdiff
path: root/common/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/config.h')
m---------common0
-rw-r--r--common/config.h48
2 files changed, 0 insertions, 48 deletions
diff --git a/common b/common
new file mode 160000
+Subproject dd64a35c949738c2c321989d065e0754556823d
diff --git a/common/config.h b/common/config.h
deleted file mode 100644
index 87e9765..0000000
--- a/common/config.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#include <string>
-#include <map>
-
-//! Utility class for handling configuration file
-//! Supported format in config file is:
-//! keyword = value
-//! example: nick = xyz
-class Config{
- private:
- //! Map in the format <id, value>
- std::map<std::string, std::string> config;
-
- //! The path to the configuration file
- std::string path;
-
- //! Loads configuration from file
- void load_conf();
-
- //! Saves configuration to file
- void save_conf();
-
- public:
- //! Constructs a object with the default configuration path
- Config();
- //! Constructs a object with a custom configuration path
- Config(std::string path);
- //! Deletes the object, saving the configuration to a file
- ~Config();
-
- //! Adds a std::string value to the configuration
- //! \param keyword Keyword associated with the value inserted
- //! \param value The value for the associated keyword
- void add_element(std::string keyword, std::string value);
-
- //! Adds a int value to the configuration
- //! \param keyword Keyword associated with the value inserted
- //! \param value The value for the associated keyword
- void add_element(std::string keyword, const int value);
-
- //! Gets a element from the configuration
- //! \param keyword The keyword you want the value from
- std::string get_element(std::string keyword);
-};
-
-#endif