MCPcopy Create free account
hub / github.com/AllentDan/LibtorchTutorials / StringEqual

Method StringEqual

lesson7-Detection/src/utils/tinyxmlparser.cpp:534–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532
533
534bool TiXmlBase::StringEqual( const char* p,
535 const char* tag,
536 bool ignoreCase,
537 TiXmlEncoding encoding )
538{
539 assert( p );
540 assert( tag );
541 if ( !p || !*p )
542 {
543 assert( 0 );
544 return false;
545 }
546
547 const char* q = p;
548
549 if ( ignoreCase )
550 {
551 while ( *q && *tag && ToLower( *q, encoding ) == ToLower( *tag, encoding ) )
552 {
553 ++q;
554 ++tag;
555 }
556
557 if ( *tag == 0 )
558 return true;
559 }
560 else
561 {
562 while ( *q && *tag && *q == *tag )
563 {
564 ++q;
565 ++tag;
566 }
567
568 if ( *tag == 0 ) // Have we found the end of the tag, and everything equal?
569 return true;
570 }
571 return false;
572}
573
574const char* TiXmlBase::ReadText( const char* p,
575 TIXML_STRING * text,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected