From 94a1189d757f0269ac081ad2d750152e30564986 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 19 Dec 2010 12:19:41 +0100 Subject: Linked common as submodule. --- common | 1 + common/config.h | 48 ------------------------------------------------ 2 files changed, 1 insertion(+), 48 deletions(-) create mode 160000 common delete mode 100644 common/config.h (limited to 'common/config.h') diff --git a/common b/common new file mode 160000 index 0000000..dd64a35 --- /dev/null +++ b/common @@ -0,0 +1 @@ +Subproject commit dd64a35c949738c2c321989d065e0754556823d5 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 -#include - -//! Utility class for handling configuration file -//! Supported format in config file is: -//! keyword = value -//! example: nick = xyz -class Config{ - private: - //! Map in the format - std::map 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 -- cgit v1.2.3