Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
|
The Field Object for the Config. More...
#include <config.h>
Public Member Functions | |
Field (const char *section, const char *key, T def) | |
Construct a new Field object. | |
~Field () | |
Destroy the Field object. | |
void | load (const rapidjson::Document &document) |
Loads the value from the config. | |
void | save (rapidjson::Document &document) |
Saves value to the config. | |
const T & | getValue () |
Get the Value of the field. | |
void | setValue (T v) |
Set the Value of the field. | |
void | registerLuaProperty (lua_State *state) |
Register this property in Lua. | |
Public Attributes | |
std::string | section |
Section of the field. | |
std::string | key |
Key of the field. | |
The Field Object for the Config.
The field object should only be used internally, as it is only used in Config for parsing / writing values to the config file.
T | the value type of the field |
Get the Value of the field.
Loads the value from the config.
Loads from the json document the value, parsing it.
document | The Json document |
Register this property in Lua.
state | the lua state |
Saves value to the config.
Saves value to the json document.
document | The Json document |
Set the Value of the field.
v | the new value |