|
@@ -1297,10 +1297,10 @@ void XMLElement::SetText( unsigned inNum )
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-void XMLElement::SetText( bool inBool )
|
|
|
|
|
|
|
+void XMLElement::SetText( double inNum )
|
|
|
{
|
|
{
|
|
|
char buf[BUF_SIZE];
|
|
char buf[BUF_SIZE];
|
|
|
- XMLUtil::ToStr( inBool, buf, BUF_SIZE );
|
|
|
|
|
|
|
+ XMLUtil::ToStr( inNum, buf, BUF_SIZE );
|
|
|
if ( FirstChild() && FirstChild()->ToText() )
|
|
if ( FirstChild() && FirstChild()->ToText() )
|
|
|
FirstChild()->SetValue( buf );
|
|
FirstChild()->SetValue( buf );
|
|
|
else {
|
|
else {
|
|
@@ -1310,7 +1310,7 @@ void XMLElement::SetText( bool inBool )
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-void XMLElement::SetText( double inNum )
|
|
|
|
|
|
|
+void XMLElement::SetText( float inNum )
|
|
|
{
|
|
{
|
|
|
char buf[BUF_SIZE];
|
|
char buf[BUF_SIZE];
|
|
|
XMLUtil::ToStr( inNum, buf, BUF_SIZE );
|
|
XMLUtil::ToStr( inNum, buf, BUF_SIZE );
|
|
@@ -1323,19 +1323,29 @@ void XMLElement::SetText( double inNum )
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-void XMLElement::SetText( float inNum )
|
|
|
|
|
|
|
+void XMLElement::SetBoolFirstChild( bool inBool )
|
|
|
{
|
|
{
|
|
|
- char buf[BUF_SIZE];
|
|
|
|
|
- XMLUtil::ToStr( inNum, buf, BUF_SIZE );
|
|
|
|
|
- if ( FirstChild() && FirstChild()->ToText() )
|
|
|
|
|
- FirstChild()->SetValue( buf );
|
|
|
|
|
- else {
|
|
|
|
|
- XMLText* theText = GetDocument()->NewText( buf );
|
|
|
|
|
|
|
+ if( FirstChild() && FirstChild()->ToElement()
|
|
|
|
|
+ && (strcmp(FirstChild()->Value(),"true") == 0 || strcmp(FirstChild()->Value(),"false") == 0) ) {
|
|
|
|
|
+ FirstChild()->SetValue( inBool ? "true" : "false" );
|
|
|
|
|
+ }
|
|
|
|
|
+ else if( !FirstChild() ) {
|
|
|
|
|
+ XMLElement* theText = GetDocument()->NewElement( inBool ? "true" : "false" );
|
|
|
InsertFirstChild( theText );
|
|
InsertFirstChild( theText );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+bool XMLElement::BoolFirstChild()
|
|
|
|
|
+{
|
|
|
|
|
+ if ( FirstChild() && FirstChild()->ToElement() ) {
|
|
|
|
|
+ return strcmp( FirstChild()->Value(), "true" ) == 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return false;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
XMLError XMLElement::QueryIntText( int* ival ) const
|
|
XMLError XMLElement::QueryIntText( int* ival ) const
|
|
|
{
|
|
{
|
|
|
if ( FirstChild() && FirstChild()->ToText() ) {
|
|
if ( FirstChild() && FirstChild()->ToText() ) {
|