MCPcopy Create free account
hub / github.com/JayXon/Leanify / PrintString

Method PrintString

lib/tinyxml2/tinyxml2.cpp:2050–2085  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2048
2049
2050void XMLPrinter::PrintString( const char* p, bool restricted )
2051{
2052 // Look for runs of bytes between entities to print.
2053 const char* q = p;
2054
2055 if ( _processEntities ) {
2056 const bool* flag = restricted ? _restrictedEntityFlag : _entityFlag;
2057 while ( *q ) {
2058 // Remember, char is sometimes signed. (How many times has that bitten me?)
2059 if ( *q > 0 && *q < ENTITY_RANGE ) {
2060 // Check for entities. If one is found, flush
2061 // the stream up until the entity, write the
2062 // entity, and keep looking.
2063 if ( flag[(unsigned char)(*q)] ) {
2064 while ( p < q ) {
2065 Print( "%c", *p );
2066 ++p;
2067 }
2068 for( int i=0; i<NUM_ENTITIES; ++i ) {
2069 if ( entities[i].value == *q ) {
2070 Print( "&%s;", entities[i].pattern );
2071 break;
2072 }
2073 }
2074 ++p;
2075 }
2076 }
2077 ++q;
2078 }
2079 }
2080 // Flush the remaining string. This will be the entire
2081 // string if an entity wasn't found.
2082 if ( !_processEntities || (q-p > 0) ) {
2083 Print( "%s", p );
2084 }
2085}
2086
2087
2088void XMLPrinter::PushHeader( bool writeBOM, bool writeDec )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected