mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-01-19 03:57:14 +01:00
Compare commits
No commits in common. "8dc0ca18f52e4d5e990f65be6a109a1d664fd9e3" and "d749250e1bc327b3fa68db112a33ff649e90c951" have entirely different histories.
8dc0ca18f5
...
d749250e1b
@ -138,10 +138,9 @@ SQInteger XmlAttribute::GetLong() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
XmlAttribute & XmlAttribute::SetLong(SQInteger value)
|
||||
void XmlAttribute::SetLong(SQInteger value)
|
||||
{
|
||||
m_Attr = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -151,10 +150,9 @@ SQInteger XmlAttribute::GetUlong() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
XmlAttribute & XmlAttribute::SetUlong(SQInteger value)
|
||||
void XmlAttribute::SetUlong(SQInteger value)
|
||||
{
|
||||
m_Attr = static_cast< uint64_t >(value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -188,10 +186,9 @@ SQInteger XmlText::GetLong() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
XmlText & XmlText::SetLong(SQInteger value)
|
||||
void XmlText::SetLong(SQInteger value)
|
||||
{
|
||||
m_Text = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -201,10 +198,9 @@ SQInteger XmlText::GetUlong() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
XmlText & XmlText::SetUlong(SQInteger value)
|
||||
void XmlText::SetUlong(SQInteger value)
|
||||
{
|
||||
m_Text = static_cast< uint64_t >(value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -263,8 +259,8 @@ void Register_XML(HSQUIRRELVM vm)
|
||||
.Prop(_SC("Next"), &XmlAttribute::NextAttribute)
|
||||
.Prop(_SC("Prev"), &XmlAttribute::PrevAttribute)
|
||||
// Member Methods
|
||||
.FmtFunc(_SC("SetName"), &XmlAttribute::SetName)
|
||||
.FmtFunc(_SC("SetValue"), &XmlAttribute::ApplyValue)
|
||||
.Func(_SC("SetName"), &XmlAttribute::ApplyName)
|
||||
.Func(_SC("SetValue"), &XmlAttribute::ApplyValue)
|
||||
.Func(_SC("AsString"), &XmlAttribute::AsString)
|
||||
.Func(_SC("AsInt"), &XmlAttribute::AsInt)
|
||||
.Func(_SC("AsUint"), &XmlAttribute::AsUint)
|
||||
@ -354,8 +350,8 @@ void Register_XML(HSQUIRRELVM vm)
|
||||
.Overload(_SC("AppendBuffer"), &XmlNode::AppendBuffer1)
|
||||
.Overload(_SC("AppendBuffer"), &XmlNode::AppendBuffer2)
|
||||
.Overload(_SC("AppendBuffer"), &XmlNode::AppendBuffer3)
|
||||
.FmtFunc(_SC("SetName"), &XmlNode::SetName)
|
||||
.FmtFunc(_SC("SetValue"), &XmlNode::ApplyValue)
|
||||
.Func(_SC("SetName"), &XmlNode::ApplyName)
|
||||
.Func(_SC("SetValue"), &XmlNode::ApplyValue)
|
||||
.Func(_SC("GetChild"), &XmlNode::Child)
|
||||
.Func(_SC("GetAttr"), &XmlNode::GetAttribute)
|
||||
.Func(_SC("GetAttribute"), &XmlNode::GetAttribute)
|
||||
@ -372,8 +368,8 @@ void Register_XML(HSQUIRRELVM vm)
|
||||
.Func(_SC("PrependAttrCopy"), &XmlNode::PrependAttrCopy)
|
||||
.Func(_SC("InsertAttrCopyAfter"), &XmlNode::InsertAttrCopyAfter)
|
||||
.Func(_SC("InsertAttrCopyBefore"), &XmlNode::InsertAttrCopyBefore)
|
||||
.FmtFunc(_SC("AppendChild"), &XmlNode::AppendChild)
|
||||
.FmtFunc(_SC("PrependChild"), &XmlNode::PrependChild)
|
||||
.Func(_SC("AppendChild"), &XmlNode::AppendChild)
|
||||
.Func(_SC("PrependChild"), &XmlNode::PrependChild)
|
||||
.Func(_SC("AppendChildNode"), &XmlNode::AppendChildNode)
|
||||
.Func(_SC("PrependChildNode"), &XmlNode::PrependChildNode)
|
||||
.Func(_SC("AppendChildType"), &XmlNode::AppendChildType)
|
||||
@ -390,9 +386,9 @@ void Register_XML(HSQUIRRELVM vm)
|
||||
.Func(_SC("PrependMove"), &XmlNode::PrependMove)
|
||||
.Func(_SC("InsertMoveAfter"), &XmlNode::InsertMoveAfter)
|
||||
.Func(_SC("InsertMoveBefore"), &XmlNode::InsertMoveBefore)
|
||||
.FmtFunc(_SC("RemoveAttr"), &XmlNode::RemoveAttr)
|
||||
.Func(_SC("RemoveAttr"), &XmlNode::RemoveAttr)
|
||||
.Func(_SC("RemoveAttrInst"), &XmlNode::RemoveAttrInst)
|
||||
.FmtFunc(_SC("RemoveChild"), &XmlNode::RemoveChild)
|
||||
.Func(_SC("RemoveChild"), &XmlNode::RemoveChild)
|
||||
.Func(_SC("RemoveChildInst"), &XmlNode::RemoveChildInst)
|
||||
.Overload(_SC("FindChildByAttr"), &XmlNode::FindChildByAttr2)
|
||||
.Overload(_SC("FindChildByAttr"), &XmlNode::FindChildByAttr3)
|
||||
@ -425,7 +421,7 @@ void Register_XML(HSQUIRRELVM vm)
|
||||
.Overload(_SC("SaveFile"), &XmlDocument::SaveFile4)
|
||||
);
|
||||
|
||||
RootTable(vm).Bind(_SC("SqXML"), xmlns);
|
||||
RootTable(vm).Bind(_SC("SqXml"), xmlns);
|
||||
|
||||
ConstTable(vm).Enum(_SC("SqXmlNodeType"), Enumeration(vm)
|
||||
.Const(_SC("Null"), static_cast< int32_t >(node_null))
|
||||
|
@ -663,7 +663,7 @@ protected:
|
||||
* Explicit constructor.
|
||||
*/
|
||||
XmlNode(DocumentRef doc, const Type & node)
|
||||
: m_Node(node), m_Doc(std::move(doc))
|
||||
: m_Doc(std::move(doc)), m_Node(node)
|
||||
{
|
||||
/* ... */
|
||||
}
|
||||
@ -671,8 +671,8 @@ protected:
|
||||
private:
|
||||
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
Type m_Node{}; // The managed document node.
|
||||
DocumentRef m_Doc{}; // The main xml document instance.
|
||||
Type m_Node{}; // The managed document node.
|
||||
|
||||
public:
|
||||
|
||||
@ -777,13 +777,20 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify node name.
|
||||
*/
|
||||
XmlNode & SetName(StackStrF & name)
|
||||
void SetName(StackStrF & name)
|
||||
{
|
||||
if (!m_Node.set_name(name.mPtr))
|
||||
{
|
||||
STHROWF("Unable to set XML node name `{}`", name.ToStr());
|
||||
STHROWF("Unable to set XML node name");
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the node name.
|
||||
*/
|
||||
bool ApplyName(StackStrF & name)
|
||||
{
|
||||
return m_Node.set_name(name.mPtr);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -797,13 +804,12 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify node value.
|
||||
*/
|
||||
XmlNode & SetValue(StackStrF & name)
|
||||
void SetValue(StackStrF & name)
|
||||
{
|
||||
if (!m_Node.set_value(name.mPtr))
|
||||
{
|
||||
STHROWF("Unable to set XML node value");
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1325,13 +1331,20 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve attribute name.
|
||||
*/
|
||||
XmlAttribute & SetName(StackStrF & name)
|
||||
void SetName(StackStrF & name)
|
||||
{
|
||||
if (!m_Attr.set_name(name.mPtr))
|
||||
{
|
||||
STHROWF("Unable to set XML attribute name `{}`", name.ToStr());
|
||||
STHROWF("Unable to set XML attribute name");
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the attribute name.
|
||||
*/
|
||||
bool ApplyName(StackStrF & name)
|
||||
{
|
||||
return m_Attr.set_name(name.mPtr);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1345,13 +1358,12 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve attribute value.
|
||||
*/
|
||||
XmlAttribute SetValue(StackStrF & name)
|
||||
void SetValue(StackStrF & name)
|
||||
{
|
||||
if (!m_Attr.set_value(name.mPtr))
|
||||
{
|
||||
STHROWF("Unable to set XML attribute value");
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1489,10 +1501,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a string.
|
||||
*/
|
||||
XmlAttribute & SetString(StackStrF & value)
|
||||
void SetString(StackStrF & value)
|
||||
{
|
||||
m_Attr = value.mPtr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1506,10 +1517,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a integer.
|
||||
*/
|
||||
XmlAttribute & SetInt(int32_t value)
|
||||
void SetInt(int32_t value)
|
||||
{
|
||||
m_Attr = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1523,10 +1533,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a unsigned integer.
|
||||
*/
|
||||
XmlAttribute & SetUint(uint32_t value)
|
||||
void SetUint(uint32_t value)
|
||||
{
|
||||
m_Attr = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1540,10 +1549,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a floating point.
|
||||
*/
|
||||
XmlAttribute & SetFloat(SQFloat value)
|
||||
void SetFloat(SQFloat value)
|
||||
{
|
||||
m_Attr = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1557,10 +1565,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a double floating point.
|
||||
*/
|
||||
XmlAttribute & SetDouble(SQFloat value)
|
||||
void SetDouble(SQFloat value)
|
||||
{
|
||||
m_Attr = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1571,7 +1578,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a long integer.
|
||||
*/
|
||||
XmlAttribute & SetLong(SQInteger value);
|
||||
void SetLong(SQInteger value);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the value as a unsigned long integer.
|
||||
@ -1581,7 +1588,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a unsigned long integer.
|
||||
*/
|
||||
XmlAttribute & SetUlong(SQInteger value);
|
||||
void SetUlong(SQInteger value);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the value as a boolean.
|
||||
@ -1594,10 +1601,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a boolean.
|
||||
*/
|
||||
XmlAttribute & SetBool(bool value)
|
||||
void SetBool(bool value)
|
||||
{
|
||||
m_Attr = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1847,10 +1853,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a string.
|
||||
*/
|
||||
XmlText & SetString(StackStrF & value)
|
||||
void SetString(StackStrF & value)
|
||||
{
|
||||
m_Text = value.mPtr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1864,10 +1869,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a integer.
|
||||
*/
|
||||
XmlText & SetInt(int32_t value)
|
||||
void SetInt(int32_t value)
|
||||
{
|
||||
m_Text = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1881,10 +1885,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a unsigned integer.
|
||||
*/
|
||||
XmlText & SetUint(uint32_t value)
|
||||
void SetUint(uint32_t value)
|
||||
{
|
||||
m_Text = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1898,10 +1901,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a floating point.
|
||||
*/
|
||||
XmlText & SetFloat(SQFloat value)
|
||||
void SetFloat(SQFloat value)
|
||||
{
|
||||
m_Text = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1915,10 +1917,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a double floating point.
|
||||
*/
|
||||
XmlText & SetDouble(SQFloat value)
|
||||
void SetDouble(SQFloat value)
|
||||
{
|
||||
m_Text = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -1929,7 +1930,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a long integer.
|
||||
*/
|
||||
XmlText & SetLong(SQInteger value);
|
||||
void SetLong(SQInteger value);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the value as a unsigned long integer.
|
||||
@ -1939,7 +1940,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a unsigned long integer.
|
||||
*/
|
||||
XmlText & SetUlong(SQInteger value);
|
||||
void SetUlong(SQInteger value);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the value as a boolean.
|
||||
@ -1952,10 +1953,9 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the value as a boolean.
|
||||
*/
|
||||
XmlText & SetBool(bool value)
|
||||
void SetBool(bool value)
|
||||
{
|
||||
m_Text = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user