MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / SkipWhiteSpace

Method SkipWhiteSpace

tinyxml/src/tinyxmlparser.cpp:314–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312
313
314const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding )
315{
316 if ( !p || !*p )
317 {
318 return 0;
319 }
320 if ( encoding == TIXML_ENCODING_UTF8 )
321 {
322 while ( *p )
323 {
324 const unsigned char* pU = (const unsigned char*)p;
325
326 // Skip the stupid Microsoft UTF-8 Byte order marks
327 if ( *(pU+0)==TIXML_UTF_LEAD_0
328 && *(pU+1)==TIXML_UTF_LEAD_1
329 && *(pU+2)==TIXML_UTF_LEAD_2 )
330 {
331 p += 3;
332 continue;
333 }
334 else if(*(pU+0)==TIXML_UTF_LEAD_0
335 && *(pU+1)==0xbfU
336 && *(pU+2)==0xbeU )
337 {
338 p += 3;
339 continue;
340 }
341 else if(*(pU+0)==TIXML_UTF_LEAD_0
342 && *(pU+1)==0xbfU
343 && *(pU+2)==0xbfU )
344 {
345 p += 3;
346 continue;
347 }
348
349 if ( IsWhiteSpace( *p ) ) // Still using old rules for white space.
350 ++p;
351 else
352 break;
353 }
354 }
355 else
356 {
357 while ( *p && IsWhiteSpace( *p ) )
358 ++p;
359 }
360
361 return p;
362}
363
364#ifdef TIXML_USE_STL
365/*static*/ bool TiXmlBase::StreamWhiteSpace( std::istream * in, TIXML_STRING * tag )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected