mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
Finished stable implementation (as far as tested), still requires more testing.
This commit is contained in:
@@ -70,7 +70,7 @@ void Config::clear()
|
||||
m_confsDoc->clear();
|
||||
}
|
||||
|
||||
void Config::set(const std::string& key, const std::string& value)
|
||||
void Config::setValue(const std::string& key, const std::string& value)
|
||||
{
|
||||
if(key == "") {
|
||||
remove(key);
|
||||
@@ -94,12 +94,12 @@ void Config::setList(const std::string& key, const std::vector<std::string>& lis
|
||||
m_confsDoc->addChild(child);
|
||||
}
|
||||
|
||||
bool Config::exists(const std::string key)
|
||||
bool Config::exists(const std::string& key)
|
||||
{
|
||||
return m_confsDoc->hasChildAt(key);
|
||||
}
|
||||
|
||||
std::string Config::get(const std::string& key)
|
||||
std::string Config::getValue(const std::string& key)
|
||||
{
|
||||
OTMLNodePtr child = m_confsDoc->get(key);
|
||||
if(child)
|
||||
|
@@ -39,16 +39,16 @@ public:
|
||||
bool save();
|
||||
void clear();
|
||||
|
||||
void set(const std::string& key, const std::string& value);
|
||||
void setValue(const std::string& key, const std::string& value);
|
||||
void setList(const std::string& key, const std::vector<std::string>& list);
|
||||
std::string get(const std::string& key);
|
||||
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);
|
||||
bool exists(const std::string& key);
|
||||
void remove(const std::string& key);
|
||||
|
||||
std::string getFileName();
|
||||
|
@@ -193,9 +193,9 @@ void Application::registerLuaFunctions()
|
||||
// Config
|
||||
g_lua.registerClass<Config>();
|
||||
g_lua.bindClassMemberFunction<Config>("save", &Config::save);
|
||||
g_lua.bindClassMemberFunction<Config>("set", &Config::set);
|
||||
g_lua.bindClassMemberFunction<Config>("setValue", &Config::setValue);
|
||||
g_lua.bindClassMemberFunction<Config>("setList", &Config::setList);
|
||||
g_lua.bindClassMemberFunction<Config>("get", &Config::get);
|
||||
g_lua.bindClassMemberFunction<Config>("getValue", &Config::getValue);
|
||||
g_lua.bindClassMemberFunction<Config>("getList", &Config::getList);
|
||||
g_lua.bindClassMemberFunction<Config>("exists", &Config::exists);
|
||||
g_lua.bindClassMemberFunction<Config>("remove", &Config::remove);
|
||||
|
Reference in New Issue
Block a user