mirror of
https://github.com/edubart/otclient.git
synced 2026-01-09 07:41:29 +01:00
Lua binder compability changes
* A lot of changes in lua binder to compile with clang's libc++ * Add more portability to luabinder * Remove const keyword from bound lua functions * Deprecate std::bind usage with luabinder replace its usage with registerSingletonClass/bindSingletonFunction for binding singleton classes * Fix a bug in lua binder where calling functions with bil object would make the client crash * More fixes to compile with clang
This commit is contained in:
@@ -41,7 +41,7 @@ OTMLNodePtr OTMLNode::create(std::string tag, std::string value)
|
||||
return node;
|
||||
}
|
||||
|
||||
bool OTMLNode::hasChildren() const
|
||||
bool OTMLNode::hasChildren()
|
||||
{
|
||||
int count = 0;
|
||||
for(const OTMLNodePtr& child : m_children) {
|
||||
@@ -51,7 +51,7 @@ bool OTMLNode::hasChildren() const
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
OTMLNodePtr OTMLNode::get(const std::string& childTag) const
|
||||
OTMLNodePtr OTMLNode::get(const std::string& childTag)
|
||||
{
|
||||
for(const OTMLNodePtr& child : m_children) {
|
||||
if(child->tag() == childTag && !child->isNull())
|
||||
@@ -60,7 +60,7 @@ OTMLNodePtr OTMLNode::get(const std::string& childTag) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
OTMLNodePtr OTMLNode::getIndex(int childIndex) const
|
||||
OTMLNodePtr OTMLNode::getIndex(int childIndex)
|
||||
{
|
||||
if(childIndex < size() && childIndex >= 0)
|
||||
return m_children[childIndex];
|
||||
@@ -174,7 +174,7 @@ void OTMLNode::clear()
|
||||
m_children.clear();
|
||||
}
|
||||
|
||||
OTMLNodeList OTMLNode::children() const
|
||||
OTMLNodeList OTMLNode::children()
|
||||
{
|
||||
OTMLNodeList children;
|
||||
for(const OTMLNodePtr& child : m_children)
|
||||
@@ -183,7 +183,7 @@ OTMLNodeList OTMLNode::children() const
|
||||
return children;
|
||||
}
|
||||
|
||||
OTMLNodePtr OTMLNode::clone() const
|
||||
OTMLNodePtr OTMLNode::clone()
|
||||
{
|
||||
OTMLNodePtr myClone(new OTMLNode);
|
||||
myClone->setTag(m_tag);
|
||||
|
||||
@@ -33,17 +33,17 @@ public:
|
||||
static OTMLNodePtr create(std::string tag = "", bool unique = false);
|
||||
static OTMLNodePtr create(std::string tag, std::string value);
|
||||
|
||||
std::string tag() const { return m_tag; }
|
||||
int size() const { return m_children.size(); }
|
||||
OTMLNodePtr parent() const { return m_parent.lock(); }
|
||||
std::string source() const { return m_source; }
|
||||
std::string tag() { return m_tag; }
|
||||
int size() { return m_children.size(); }
|
||||
OTMLNodePtr parent() { return m_parent.lock(); }
|
||||
std::string source() { return m_source; }
|
||||
|
||||
bool isUnique() const { return m_unique; }
|
||||
bool isNull() const { return m_null; }
|
||||
bool isUnique() { return m_unique; }
|
||||
bool isNull() { return m_null; }
|
||||
|
||||
bool hasTag() const { return !m_tag.empty(); }
|
||||
bool hasValue() const { return !m_value.empty(); }
|
||||
bool hasChildren() const;
|
||||
bool hasTag() { return !m_tag.empty(); }
|
||||
bool hasValue() { return !m_value.empty(); }
|
||||
bool hasChildren();
|
||||
bool hasChildAt(const std::string& childTag) { return !!get(childTag); }
|
||||
bool hasChildAtIndex(int childIndex) { return !!getIndex(childIndex); }
|
||||
|
||||
@@ -54,8 +54,8 @@ public:
|
||||
void setParent(const OTMLNodePtr& parent) { m_parent = parent; }
|
||||
void setSource(const std::string& source) { m_source = source; }
|
||||
|
||||
OTMLNodePtr get(const std::string& childTag) const;
|
||||
OTMLNodePtr getIndex(int childIndex) const;
|
||||
OTMLNodePtr get(const std::string& childTag);
|
||||
OTMLNodePtr getIndex(int childIndex);
|
||||
|
||||
OTMLNodePtr at(const std::string& childTag);
|
||||
OTMLNodePtr atIndex(int childIndex);
|
||||
@@ -67,8 +67,8 @@ public:
|
||||
void merge(const OTMLNodePtr& node);
|
||||
void clear();
|
||||
|
||||
OTMLNodeList children() const;
|
||||
OTMLNodePtr clone() const;
|
||||
OTMLNodeList children();
|
||||
OTMLNodePtr clone();
|
||||
|
||||
template<typename T = std::string>
|
||||
T value();
|
||||
|
||||
Reference in New Issue
Block a user