Merge branch 'master' of https://github.com/leethomason/tinyxml2
Conflicts: tinyxml2.cpp xmltest.cpp
This commit is contained in:
57
tinyxml2.cpp
57
tinyxml2.cpp
@@ -1293,71 +1293,46 @@ void XMLElement::SetText( const char* inText )
|
||||
}
|
||||
|
||||
|
||||
void XMLElement::SetText( int inNum )
|
||||
void XMLElement::SetText( int v )
|
||||
{
|
||||
char buf[BUF_SIZE];
|
||||
XMLUtil::ToStr( inNum, buf, BUF_SIZE );
|
||||
if ( FirstChild() && FirstChild()->ToText() )
|
||||
FirstChild()->SetValue( buf );
|
||||
else {
|
||||
XMLText* theText = GetDocument()->NewText( buf );
|
||||
InsertFirstChild( theText );
|
||||
}
|
||||
XMLUtil::ToStr( v, buf, BUF_SIZE );
|
||||
SetText( buf );
|
||||
}
|
||||
|
||||
|
||||
void XMLElement::SetText( unsigned inNum )
|
||||
void XMLElement::SetText( unsigned v )
|
||||
{
|
||||
char buf[BUF_SIZE];
|
||||
XMLUtil::ToStr( inNum, buf, BUF_SIZE );
|
||||
if ( FirstChild() && FirstChild()->ToText() )
|
||||
FirstChild()->SetValue( buf );
|
||||
else {
|
||||
XMLText* theText = GetDocument()->NewText( buf );
|
||||
InsertFirstChild( theText );
|
||||
}
|
||||
XMLUtil::ToStr( v, buf, BUF_SIZE );
|
||||
SetText( buf );
|
||||
}
|
||||
|
||||
|
||||
void XMLElement::SetText( double inNum )
|
||||
void XMLElement::SetText( bool v )
|
||||
{
|
||||
char buf[BUF_SIZE];
|
||||
XMLUtil::ToStr( inNum, buf, BUF_SIZE );
|
||||
if ( FirstChild() && FirstChild()->ToText() )
|
||||
FirstChild()->SetValue( buf );
|
||||
else {
|
||||
XMLText* theText = GetDocument()->NewText( buf );
|
||||
InsertFirstChild( theText );
|
||||
}
|
||||
XMLUtil::ToStr( v, buf, BUF_SIZE );
|
||||
SetText( buf );
|
||||
}
|
||||
|
||||
|
||||
void XMLElement::SetText( float inNum )
|
||||
void XMLElement::SetText( float v )
|
||||
{
|
||||
char buf[BUF_SIZE];
|
||||
XMLUtil::ToStr( inNum, buf, BUF_SIZE );
|
||||
if ( FirstChild() && FirstChild()->ToText() )
|
||||
FirstChild()->SetValue( buf );
|
||||
else {
|
||||
XMLText* theText = GetDocument()->NewText( buf );
|
||||
InsertFirstChild( theText );
|
||||
}
|
||||
XMLUtil::ToStr( v, buf, BUF_SIZE );
|
||||
SetText( buf );
|
||||
}
|
||||
|
||||
void XMLElement::SetText( long long inNum )
|
||||
|
||||
void XMLElement::SetText( double v )
|
||||
{
|
||||
char buf[BUF_SIZE];
|
||||
XMLUtil::ToStr( inNum, buf, BUF_SIZE );
|
||||
if ( FirstChild() && FirstChild()->ToText() )
|
||||
FirstChild()->SetValue( buf );
|
||||
else {
|
||||
XMLText* theText = GetDocument()->NewText( buf );
|
||||
InsertFirstChild( theText );
|
||||
}
|
||||
XMLUtil::ToStr( v, buf, BUF_SIZE );
|
||||
SetText( buf );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void XMLElement::SetBoolFirstChild( bool inBool )
|
||||
{
|
||||
if( FirstChild() && FirstChild()->ToElement()
|
||||
|
||||
Reference in New Issue
Block a user