#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