MCPcopy Create free account
hub / github.com/DFHack/dfhack / QueryBoolAttribute

Method QueryBoolAttribute

depends/tinyxml/tinyxml.cpp:683–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681
682
683int TiXmlElement::QueryBoolAttribute( const char* name, bool* bval ) const
684{
685 const TiXmlAttribute* node = attributeSet.Find( name );
686 if ( !node )
687 return TIXML_NO_ATTRIBUTE;
688
689 int result = TIXML_WRONG_TYPE;
690 if ( StringEqual( node->Value(), "true", true, TIXML_ENCODING_UNKNOWN )
691 || StringEqual( node->Value(), "yes", true, TIXML_ENCODING_UNKNOWN )
692 || StringEqual( node->Value(), "1", true, TIXML_ENCODING_UNKNOWN ) )
693 {
694 *bval = true;
695 result = TIXML_SUCCESS;
696 }
697 else if ( StringEqual( node->Value(), "false", true, TIXML_ENCODING_UNKNOWN )
698 || StringEqual( node->Value(), "no", true, TIXML_ENCODING_UNKNOWN )
699 || StringEqual( node->Value(), "0", true, TIXML_ENCODING_UNKNOWN ) )
700 {
701 *bval = false;
702 result = TIXML_SUCCESS;
703 }
704 return result;
705}
706
707
708

Callers

nothing calls this directly

Calls 2

FindMethod · 0.45
ValueMethod · 0.45

Tested by

no test coverage detected