commit | 8fe342a872c1f9b3980bee950e4728f4a8ae7f64 | [log] [tgz] |
---|---|---|
author | Uli Kusterer <ulivc@zathras.de> | Tue Jan 21 01:12:47 2014 +0100 |
committer | Uli Kusterer <ulivc@zathras.de> | Tue Jan 21 01:12:47 2014 +0100 |
tree | 181ec3252efec306da92b7970e037aa6e086e452 | |
parent | 44ce7930b71b9d19e505861fcfeefd252da9adf9 [diff] [blame] |
Add SetText() as analog to GetText().
diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 5880557..95075a5 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp
@@ -1260,6 +1260,16 @@ } +void XMLElement::SetText( const char* inText ) +{ + if ( FirstChild() ) + FirstChild()->SetValue( inText ); + else { + XMLText* theText = GetDocument()->NewText( inText ); + InsertFirstChild( theText ); + } +} + XMLError XMLElement::QueryIntText( int* ival ) const { if ( FirstChild() && FirstChild()->ToText() ) {