mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Updated the XML module to include the location for C++ exceptions in source code for debug builds.
This commit is contained in:
parent
a8edb37733
commit
3a06fe6048
@ -21,7 +21,7 @@ void Attribute::Validate() const
|
||||
{
|
||||
// Validate the document handle
|
||||
if (!m_Doc)
|
||||
SqThrowF("Invalid XML document reference");
|
||||
STHROWF("Invalid XML document reference");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -35,7 +35,7 @@ Object Attribute::AsLong(Object & def) const
|
||||
Int64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetSLongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Push a long integer instance with the requested value on the stack
|
||||
_SqMod->PushSLongObject(_SqVM, m_Attr.as_llong(longint));
|
||||
// Obtain the object from the stack and return it
|
||||
@ -53,7 +53,7 @@ Object Attribute::AsUlong(Object & def) const
|
||||
Uint64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetULongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Push a long integer instance with the requested value on the stack
|
||||
_SqMod->PushULongObject(_SqVM, m_Attr.as_ullong(longint));
|
||||
// Obtain the object from the stack and return it
|
||||
@ -71,7 +71,7 @@ bool Attribute::ApplyLong(Object & value)
|
||||
Int64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetSLongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Assign the obtained value and return the result
|
||||
return m_Attr.set_value(longint);
|
||||
}
|
||||
@ -87,7 +87,7 @@ bool Attribute::ApplyUlong(Object & value)
|
||||
Uint64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetULongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Assign the obtained value and return the result
|
||||
return m_Attr.set_value(longint);
|
||||
}
|
||||
@ -114,7 +114,7 @@ void Attribute::SetLong(Object & value)
|
||||
Int64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetSLongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Assign the obtained value
|
||||
m_Attr = longint;
|
||||
}
|
||||
@ -141,7 +141,7 @@ void Attribute::SetUlong(Object & value)
|
||||
Uint64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetULongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Assign the obtained value
|
||||
m_Attr = longint;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ public:
|
||||
void SetName(CSStr name)
|
||||
{
|
||||
if (!m_Attr.set_name(name))
|
||||
SqThrowF("Unable to set xml attribute name");
|
||||
STHROWF("Unable to set xml attribute name");
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -175,7 +175,7 @@ public:
|
||||
void SetValue(CSStr name)
|
||||
{
|
||||
if (!m_Attr.set_value(name))
|
||||
SqThrowF("Unable to set xml attribute value");
|
||||
STHROWF("Unable to set xml attribute value");
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
|
@ -82,14 +82,14 @@ void ParseResult::Validate() const
|
||||
{
|
||||
// Is the documen handle valid?
|
||||
if (!m_Doc)
|
||||
SqThrowF("Invalid XML document reference");
|
||||
STHROWF("Invalid XML document reference");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void ParseResult::Check() const
|
||||
{
|
||||
if (m_Result.status != status_ok)
|
||||
SqThrowF("XML parse error [%s]", m_Result.description());
|
||||
STHROWF("XML parse error [%s]", m_Result.description());
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@ -19,7 +19,7 @@ void Document::Validate() const
|
||||
{
|
||||
// Validate the document handle
|
||||
if (!m_Doc)
|
||||
SqThrowF("Invalid XML document reference");
|
||||
STHROWF("Invalid XML document reference");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -27,11 +27,11 @@ void Document::CanLoad() const
|
||||
{
|
||||
// Is the document even valid?
|
||||
if (!m_Doc)
|
||||
SqThrowF("Invalid XML document reference");
|
||||
STHROWF("Invalid XML document reference");
|
||||
// Are there any other references?
|
||||
else if (m_Doc.Count() > 1)
|
||||
// To load new values now, would mean to cause undefined behavior in existing references
|
||||
SqThrowF("Loading is disabled while document is referenced");
|
||||
STHROWF("Loading is disabled while document is referenced");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
@ -20,7 +20,7 @@ void Node::Validate() const
|
||||
{
|
||||
// Validate the document handle
|
||||
if (!m_Doc)
|
||||
SqThrowF("Invalid XML document reference");
|
||||
STHROWF("Invalid XML document reference");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
@ -167,7 +167,7 @@ public:
|
||||
void SetName(CSStr name)
|
||||
{
|
||||
if (!m_Node.set_name(name))
|
||||
SqThrowF("Unable to set XML node name");
|
||||
STHROWF("Unable to set XML node name");
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -192,7 +192,7 @@ public:
|
||||
void SetValue(CSStr name)
|
||||
{
|
||||
if (!m_Node.set_value(name))
|
||||
SqThrowF("Unable to set XML node value");
|
||||
STHROWF("Unable to set XML node value");
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
|
@ -23,7 +23,7 @@ void Text::Validate() const
|
||||
{
|
||||
// Validate the document handle
|
||||
if (!m_Doc)
|
||||
SqThrowF("Invalid XML document reference");
|
||||
STHROWF("Invalid XML document reference");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -48,7 +48,7 @@ Object Text::AsLong(Object & def) const
|
||||
Int64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetSLongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Push a long integer instance with the requested value on the stack
|
||||
_SqMod->PushSLongObject(_SqVM, m_Text.as_llong(longint));
|
||||
// Obtain the object from the stack and return it
|
||||
@ -66,7 +66,7 @@ Object Text::AsUlong(Object & def) const
|
||||
Uint64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetULongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Push a long integer instance with the requested value on the stack
|
||||
_SqMod->PushULongObject(_SqVM, m_Text.as_ullong(longint));
|
||||
// Obtain the object from the stack and return it
|
||||
@ -84,7 +84,7 @@ bool Text::ApplyLong(Object & value)
|
||||
Int64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetSLongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Assign the obtained value and return the result
|
||||
return m_Text.set(longint);
|
||||
}
|
||||
@ -100,7 +100,7 @@ bool Text::ApplyUlong(Object & value)
|
||||
Uint64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetULongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Assign the obtained value and return the result
|
||||
return m_Text.set(longint);
|
||||
}
|
||||
@ -127,7 +127,7 @@ void Text::SetLong(Object & value)
|
||||
Int64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetSLongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Assign the obtained value
|
||||
m_Text = longint;
|
||||
}
|
||||
@ -154,7 +154,7 @@ void Text::SetUlong(Object & value)
|
||||
Uint64 longint = 0;
|
||||
// Attempt to get the numeric value inside the specified object
|
||||
if (SQ_FAILED(_SqMod->GetULongValue(_SqVM, -1, &longint)))
|
||||
SqThrowF("Invalid long integer specified");
|
||||
STHROWF("Invalid long integer specified");
|
||||
// Assign the obtained value
|
||||
m_Text = longint;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user