35 lines
517 B
C++
Executable File
35 lines
517 B
C++
Executable File
#ifndef ConfigFile_h__
|
|
#define ConfigFile_h__
|
|
|
|
#include <string>
|
|
#include <boost/property_tree/ptree.hpp>
|
|
#include <boost/property_tree/ini_parser.hpp>
|
|
|
|
#include "ResourceManager.h"
|
|
|
|
|
|
namespace dd
|
|
{
|
|
|
|
class ConfigFile : public Resource
|
|
{
|
|
friend class ResourceManager;
|
|
|
|
private:
|
|
ConfigFile(std::string path);
|
|
|
|
public:
|
|
template <typename T, T defaultValue>
|
|
T GetValue(std::string key)
|
|
{
|
|
return m_ptree.get<T>(key, defaultValue);
|
|
}
|
|
|
|
private:
|
|
boost::property_tree::ptree m_ptree;
|
|
|
|
};
|
|
|
|
};
|
|
#endif // ConfigFile_h__
|