fix query return type
diff --git a/tinyxml2.h b/tinyxml2.h
index 66d7b7e..52840a0 100755
--- a/tinyxml2.h
+++ b/tinyxml2.h
@@ -106,10 +106,10 @@
#define TINYXML2_MINOR_VERSION 2
#define TINYXML2_PATCH_VERSION 0
-// A fixed element depth limit is problematic. There needs to be a
-// limit to avoid a stack overflow. However, that limit varies per
-// system, and the capacity of the stack. On the other hand, it's a trivial
-// attack that can result from ill, malicious, or even correctly formed XML,
+// A fixed element depth limit is problematic. There needs to be a
+// limit to avoid a stack overflow. However, that limit varies per
+// system, and the capacity of the stack. On the other hand, it's a trivial
+// attack that can result from ill, malicious, or even correctly formed XML,
// so there needs to be a limit in place.
static const int TINYXML2_MAX_ELEMENT_DEPTH = 100;
@@ -349,7 +349,7 @@
~MemPoolT() {
Clear();
}
-
+
void Clear() {
// Delete the blocks.
while( !_blockPtrs.Empty()) {
@@ -395,7 +395,7 @@
++_nUntracked;
return result;
}
-
+
virtual void Free( void* mem ) {
if ( !mem ) {
return;
@@ -572,7 +572,7 @@
static bool IsWhiteSpace( char p ) {
return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) );
}
-
+
inline static bool IsNameStartChar( unsigned char ch ) {
if ( ch >= 128 ) {
// This is a heuristic guess in attempt to not implement Unicode-aware isalpha()
@@ -583,7 +583,7 @@
}
return ch == ':' || ch == '_';
}
-
+
inline static bool IsNameChar( unsigned char ch ) {
return IsNameStartChar( ch )
|| isdigit( ch )
@@ -600,7 +600,7 @@
TIXMLASSERT( nChar >= 0 );
return strncmp( p, q, nChar ) == 0;
}
-
+
inline static bool IsUTF8Continuation( char p ) {
return ( p & 0x80 ) != 0;
}
@@ -882,11 +882,11 @@
Make a copy of this node and all its children.
If the 'target' is null, then the nodes will
- be allocated in the current document. If 'target'
- is specified, the memory will be allocated is the
+ be allocated in the current document. If 'target'
+ is specified, the memory will be allocated is the
specified XMLDocument.
- NOTE: This is probably not the correct tool to
+ NOTE: This is probably not the correct tool to
copy a document, since XMLDocuments can have multiple
top level XMLNodes. You probably want to use
XMLDocument::DeepCopy()
@@ -925,8 +925,8 @@
*/
virtual bool Accept( XMLVisitor* visitor ) const = 0;
- /**
- Set user data into the XMLNode. TinyXML-2 in
+ /**
+ Set user data into the XMLNode. TinyXML-2 in
no way processes or interprets user data.
It is initially 0.
*/
@@ -1384,14 +1384,14 @@
}
-
+
/** Given an attribute name, QueryAttribute() returns
XML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion
can't be performed, or XML_NO_ATTRIBUTE if the attribute
doesn't exist. It is overloaded for the primitive types,
and is a generally more convenient replacement of
QueryIntAttribute() and related functions.
-
+
If successful, the result of the conversion
will be written to 'value'. If not successful, nothing will
be written to 'value'. This allows you to provide default
@@ -1402,27 +1402,27 @@
QueryAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10
@endverbatim
*/
- int QueryAttribute( const char* name, int* value ) const {
+ XMLError QueryAttribute( const char* name, int* value ) const {
return QueryIntAttribute( name, value );
}
- int QueryAttribute( const char* name, unsigned int* value ) const {
+ XMLError QueryAttribute( const char* name, unsigned int* value ) const {
return QueryUnsignedAttribute( name, value );
}
- int QueryAttribute(const char* name, int64_t* value) const {
+ XMLError QueryAttribute(const char* name, int64_t* value) const {
return QueryInt64Attribute(name, value);
}
- int QueryAttribute( const char* name, bool* value ) const {
+ XMLError QueryAttribute( const char* name, bool* value ) const {
return QueryBoolAttribute( name, value );
}
- int QueryAttribute( const char* name, double* value ) const {
+ XMLError QueryAttribute( const char* name, double* value ) const {
return QueryDoubleAttribute( name, value );
}
- int QueryAttribute( const char* name, float* value ) const {
+ XMLError QueryAttribute( const char* name, float* value ) const {
return QueryFloatAttribute( name, value );
}
@@ -1530,7 +1530,7 @@
@verbatim
<foo>Hullaballoo!<b>This is text</b></foo>
@endverbatim
-
+
For this XML:
@verbatim
<foo />
@@ -1544,15 +1544,15 @@
/// Convenience method for setting text inside an element. See SetText() for important limitations.
void SetText( int value );
/// Convenience method for setting text inside an element. See SetText() for important limitations.
- void SetText( unsigned value );
+ void SetText( unsigned value );
/// Convenience method for setting text inside an element. See SetText() for important limitations.
void SetText(int64_t value);
/// Convenience method for setting text inside an element. See SetText() for important limitations.
- void SetText( bool value );
+ void SetText( bool value );
/// Convenience method for setting text inside an element. See SetText() for important limitations.
- void SetText( double value );
+ void SetText( double value );
/// Convenience method for setting text inside an element. See SetText() for important limitations.
- void SetText( float value );
+ void SetText( float value );
/**
Convenience method to query the value of a child text node. This is probably best
@@ -1660,7 +1660,7 @@
friend class XMLElement;
// Gives access to SetError and Push/PopDepth, but over-access for everything else.
// Wishing C++ had "internal" scope.
- friend class XMLNode;
+ friend class XMLNode;
friend class XMLText;
friend class XMLComment;
friend class XMLDeclaration;
@@ -1700,8 +1700,8 @@
/**
Load an XML file from disk. You are responsible
- for providing and closing the FILE*.
-
+ for providing and closing the FILE*.
+
NOTE: The file should be opened as binary ("rb")
not text in order for TinyXML-2 to correctly
do newline normalization.
@@ -1831,7 +1831,7 @@
const char* ErrorName() const;
static const char* ErrorIDToName(XMLError errorID);
- /** Returns a "long form" error description. A hopefully helpful
+ /** Returns a "long form" error description. A hopefully helpful
diagnostic with location, line number, and/or additional info.
*/
const char* ErrorStr() const;
@@ -1844,7 +1844,7 @@
{
return _errorLineNum;
}
-
+
/// Clear the document, resetting it to the initial state.
void Clear();
@@ -1907,8 +1907,8 @@
// the stack. Track stack depth, and error out if needed.
class DepthTracker {
public:
- DepthTracker(XMLDocument * document) {
- this->_document = document;
+ DepthTracker(XMLDocument * document) {
+ this->_document = document;
document->PushDepth();
}
~DepthTracker() {