MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / QueryBoolAttribute

Method QueryBoolAttribute

engine/source/persistence/tinyXML/tinyxml.cpp:667–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

665
666
667int TiXmlElement::QueryBoolAttribute( const char* name, bool* bval ) const
668{
669 const TiXmlAttribute* node = attributeSet.Find( name );
670 if ( !node )
671 return TIXML_NO_ATTRIBUTE;
672
673 int result = TIXML_WRONG_TYPE;
674 if ( StringEqual( node->Value(), "true", true, TIXML_ENCODING_UNKNOWN )
675 || StringEqual( node->Value(), "yes", true, TIXML_ENCODING_UNKNOWN )
676 || StringEqual( node->Value(), "1", true, TIXML_ENCODING_UNKNOWN ) )
677 {
678 *bval = true;
679 result = TIXML_SUCCESS;
680 }
681 else if ( StringEqual( node->Value(), "false", true, TIXML_ENCODING_UNKNOWN )
682 || StringEqual( node->Value(), "no", true, TIXML_ENCODING_UNKNOWN )
683 || StringEqual( node->Value(), "0", true, TIXML_ENCODING_UNKNOWN ) )
684 {
685 *bval = false;
686 result = TIXML_SUCCESS;
687 }
688 return result;
689}
690
691
692

Callers

nothing calls this directly

Calls 2

FindMethod · 0.80
ValueMethod · 0.45

Tested by

no test coverage detected