Otclient  14/8/2020
Config Class Reference

#include <config.h>

Inheritance diagram for Config:
Collaboration diagram for Config:

Public Member Functions

 Config ()
 
bool load (const std::string &file)
 
bool unload ()
 
bool save ()
 
void clear ()
 
void setValue (const std::string &key, const std::string &value)
 
void setList (const std::string &key, const std::vector< std::string > &list)
 
std::string getValue (const std::string &key)
 
std::vector< std::string > getList (const std::string &key)
 
void setNode (const std::string &key, const OTMLNodePtr &node)
 
void mergeNode (const std::string &key, const OTMLNodePtr &node)
 
OTMLNodePtr getNode (const std::string &key)
 
bool exists (const std::string &key)
 
void remove (const std::string &key)
 
std::string getFileName ()
 
bool isLoaded ()
 
ConfigPtr asConfig ()
 
- Public Member Functions inherited from LuaObject
 LuaObject ()
 
virtual ~LuaObject ()
 
template<typename T >
void connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false)
 
template<typename... T>
int luaCallLuaField (const std::string &field, const T &... args)
 
template<typename R , typename... T>
callLuaField (const std::string &field, const T &... args)
 
template<typename... T>
void callLuaField (const std::string &field, const T &... args)
 
bool hasLuaField (const std::string &field)
 Returns true if the lua field exists. More...
 
template<typename T >
void setLuaField (const std::string &key, const T &value)
 Sets a field in this lua object. More...
 
template<typename T >
getLuaField (const std::string &key)
 Gets a field from this lua object. More...
 
void releaseLuaFieldsTable ()
 Release fields table reference. More...
 
void luaSetField (const std::string &key)
 Sets a field from this lua object, the value must be on the stack. More...
 
void luaGetField (const std::string &key)
 Gets a field from this lua object, the result is pushed onto the stack. More...
 
void luaGetMetatable ()
 Get object's metatable. More...
 
void luaGetFieldsTable ()
 Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More...
 
int getUseCount ()
 
std::string getClassName ()
 Returns the derived class name, its the same name used in Lua. More...
 
LuaObjectPtr asLuaObject ()
 
void operator= (const LuaObject &)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Detailed Description

Definition at line 32 of file config.h.

Constructor & Destructor Documentation

◆ Config()

Config::Config ( )

Definition at line 29 of file config.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ asConfig()

ConfigPtr Config::asConfig ( )
inline

Definition at line 58 of file config.h.

◆ clear()

void Config::clear ( )

Definition at line 70 of file config.cpp.

Here is the call graph for this function:

◆ exists()

bool Config::exists ( const std::string &  key)

Definition at line 99 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFileName()

std::string Config::getFileName ( )

Definition at line 155 of file config.cpp.

Here is the caller graph for this function:

◆ getList()

std::vector< std::string > Config::getList ( const std::string &  key)

Definition at line 113 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNode()

OTMLNodePtr Config::getNode ( const std::string &  key)

Definition at line 145 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getValue()

std::string Config::getValue ( const std::string &  key)

Definition at line 104 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isLoaded()

bool Config::isLoaded ( )

Definition at line 150 of file config.cpp.

Here is the caller graph for this function:

◆ load()

bool Config::load ( const std::string &  file)

Definition at line 35 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mergeNode()

void Config::mergeNode ( const std::string &  key,
const OTMLNodePtr node 
)

Definition at line 137 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove()

void Config::remove ( const std::string &  key)

Definition at line 124 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save()

bool Config::save ( )

Definition at line 63 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setList()

void Config::setList ( const std::string &  key,
const std::vector< std::string > &  list 
)

Definition at line 86 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNode()

void Config::setNode ( const std::string &  key,
const OTMLNodePtr node 
)

Definition at line 131 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setValue()

void Config::setValue ( const std::string &  key,
const std::string &  value 
)

Definition at line 75 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unload()

bool Config::unload ( )

Definition at line 53 of file config.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

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