Skip to content

Commit

Permalink
Merge pull request #360 from Dmitry-Me/documentConsistencyAsserts
Browse files Browse the repository at this point in the history
Document consistency asserts
  • Loading branch information
leethomason committed Jul 21, 2015
2 parents 400e5b2 + 66487eb commit eb89ef6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tinyxml2.h
Expand Up @@ -630,10 +630,12 @@ class TINYXML2_LIB XMLNode

/// Get the XMLDocument that owns this XMLNode.
const XMLDocument* GetDocument() const {
TIXMLASSERT( _document );
return _document;
}
/// Get the XMLDocument that owns this XMLNode.
XMLDocument* GetDocument() {
TIXMLASSERT( _document );
return _document;
}

Expand Down Expand Up @@ -1536,9 +1538,11 @@ class TINYXML2_LIB XMLDocument : public XMLNode
~XMLDocument();

virtual XMLDocument* ToDocument() {
TIXMLASSERT( this == _document );
return this;
}
virtual const XMLDocument* ToDocument() const {
TIXMLASSERT( this == _document );
return this;
}

Expand Down

0 comments on commit eb89ef6

Please sign in to comment.