mirror of https://github.com/AxioDL/tinyxml2.git
Add SetText() as analog to GetText().
This commit is contained in:
parent
44ce7930b7
commit
8fe342a872
10
tinyxml2.cpp
10
tinyxml2.cpp
|
@ -1260,6 +1260,16 @@ const char* XMLElement::GetText() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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
|
XMLError XMLElement::QueryIntText( int* ival ) const
|
||||||
{
|
{
|
||||||
if ( FirstChild() && FirstChild()->ToText() ) {
|
if ( FirstChild() && FirstChild()->ToText() ) {
|
||||||
|
|
|
@ -116,9 +116,9 @@ inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )
|
||||||
#define TIXML_SSCANF sscanf
|
#define TIXML_SSCANF sscanf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const int TIXML2_MAJOR_VERSION = 1;
|
static const int TIXML2_MAJOR_VERSION = 1;
|
||||||
static const int TIXML2_MINOR_VERSION = 0;
|
static const int TIXML2_MINOR_VERSION = 0;
|
||||||
static const int TIXML2_PATCH_VERSION = 13;
|
static const int TIXML2_PATCH_VERSION = 13;
|
||||||
|
|
||||||
namespace tinyxml2
|
namespace tinyxml2
|
||||||
{
|
{
|
||||||
|
@ -1369,6 +1369,8 @@ public:
|
||||||
*/
|
*/
|
||||||
const char* GetText() const;
|
const char* GetText() const;
|
||||||
|
|
||||||
|
void SetText( const char* inText );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Convenience method to query the value of a child text node. This is probably best
|
Convenience method to query the value of a child text node. This is probably best
|
||||||
shown by example. Given you have a document is this form:
|
shown by example. Given you have a document is this form:
|
||||||
|
|
Loading…
Reference in New Issue