Recast  1
Game with custom magic
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Static Public Member Functions | List of all members
Config Class Reference

Config class. More...

#include <Config.hpp>

Collaboration diagram for Config:
Collaboration graph

Public Member Functions

 Config (const std::string &filename)
 
 ~Config ()
 
 Config (const Config &other)=delete
 
boost::property_tree::ptree & tree ()
 
void save ()
 
void load ()
 
template<class T >
get (const std::string &key, T defaultVar)
 

Static Public Member Functions

static Configinstance ()
 
template<class T >
static T g (const std::string &key, T defaultVar)
 

Detailed Description

Config class.

Using Boost ptree struct. Config file hashing and buffering in memory. (You can't get an instance of Config from constructor) Please call Config::instance to get an instance of Config.

Constructor & Destructor Documentation

Config::Config ( const std::string &  filename)
Config::~Config ( )
Config::Config ( const Config other)
delete

Member Function Documentation

template<class T >
static T Config::g ( const std::string &  key,
defaultVar 
)
inlinestatic

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
T Config::get ( const std::string &  key,
defaultVar 
)
inline

This method create param if not exist

Template Parameters
Tclass of config var
Parameters
keystring with path like 'general.server.port'
defaultVarvar used when config var is empty
Returns
defultVar returned if config var is empty

Here is the call graph for this function:

Here is the caller graph for this function:

Config * Config::instance ( )
static

Here is the call graph for this function:

Here is the caller graph for this function:

void Config::load ( )
void Config::save ( )

Here is the call graph for this function:

ptree & Config::tree ( )

Here is the caller graph for this function:


The documentation for this class was generated from the following files: