MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / ToBool

Method ToBool

native/thirdpart/tinyxml2/tinyxml2.cpp:636–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

634}
635
636bool XMLUtil::ToBool( const char* str, bool* value )
637{
638 int ival = 0;
639 if ( ToInt( str, &ival )) {
640 *value = (ival==0) ? false : true;
641 return true;
642 }
643 static const char* TRUE_VALS[] = { "true", "True", "TRUE", 0 };
644 static const char* FALSE_VALS[] = { "false", "False", "FALSE", 0 };
645
646 for (int i = 0; TRUE_VALS[i]; ++i) {
647 if (StringEqual(str, TRUE_VALS[i])) {
648 *value = true;
649 return true;
650 }
651 }
652 for (int i = 0; FALSE_VALS[i]; ++i) {
653 if (StringEqual(str, FALSE_VALS[i])) {
654 *value = false;
655 return true;
656 }
657 }
658 return false;
659}
660
661
662bool XMLUtil::ToFloat( const char* str, float* value )

Callers

nothing calls this directly

Calls 1

StringEqualFunction · 0.85

Tested by

no test coverage detected