/**
 * @file Config.h
 * @author Petr Egert (egertpet@fel.cvut.cz)
 * @brief Contains Config class declaration
 */

#ifndef CONFIG_H
#define CONFIG_H

#include "Error.h"

#include <map>
#include <string>

namespace RD
{
    /**
     * @brief Class repesenting an application configuration
     *
     * Currently only loading of simple key = value config files is supported
     */
    class Config
    {
        public:
            ///value contaier type definition
            typedef std::map<std::string, std::string> MapType;

            ///Default constructor, currently does nothing
            Config(){}

            ///Default destructor, currently does nothing
            ~Config(){}

            Result Init();
            Result Load(const char* fileName);
            Result Release();

            bool GetBool(const std::string &name, bool defVal);
            int GetInt(const std::string &name, int defVal);
            std::string GetString(const std::string &name, const std::string &defVal);

            void SetBool(const std::string &name, bool val);
            void SetInt(const std::string &name, int val);
            void SetString(const std::string &name, const std::string &val);


            MapType values;     ///< Container used to store config variables

            static Config *instance;     ///< Pointer to a singleton instance of this class

        private:
    };
};
#endif // CONFIG_H

