From d34f52c43b8c20bfa3201dea558a3a67088eb99f Mon Sep 17 00:00:00 2001 From: Lee Thomason Date: Fri, 20 Jan 2012 12:55:24 -0800 Subject: [PATCH] switching over to StrPair --- tinyxml2.cpp | 4 +--- tinyxml2.h | 18 +++++++++++------- tinyxml2.suo | Bin 29184 -> 29184 bytes 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 4a3152a..091f328 100644 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -88,9 +88,7 @@ const char* XMLBase::ParseText( char* p, const char* endTag, char** next ) } -char* XMLBase::ParseName( char* in, StrPair* pair ); - -const char* XMLBase::ParseName( char* p, char** next ) +char* XMLBase::ParseName( char* p, StrPair* pair ) { char* start = p; char* nextTag = 0; diff --git a/tinyxml2.h b/tinyxml2.h index f081758..fe3979e 100644 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -48,6 +48,7 @@ struct CharBuffer // FIXME: refactor to be the basis for all string handling. class StrPair { +public: enum { NEEDS_FLUSH = 0x01, NEEDS_ENTITY_PROCESSING = 0x02, @@ -55,7 +56,7 @@ class StrPair }; StrPair() : flags( 0 ), start( 0 ), end( 0 ) {} - void Init( const char* start, char* end, int flags; ) { + void Init( const char* start, char* end, int flags ) { this->start = start; this->end = end; this->flags = flags | NEEDS_FLUSH; } const char* GetStr(); @@ -80,6 +81,9 @@ protected: inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) { int n = 0; + if ( p == q ) { + return true; + } while( *p && *q && *p == *q && nF7`}G`7OdSBur@bcy_U8VXs@@lz_ol8s0syYL9D>!Lq&p!wZr{TlLh8} zELj%OKE|kV%8WlIOD2L_+($Br{#Z=5mBg5BSqNGD;oPzr;xA)l?>#MKw>jy(=bZQJ zd7k&2@hANF6MniSgWrrT8Jjbo_q_k`%h`7_c4z7A9LK#$1F>Pp>{8CWE}LJbM@Ua$ zDKD87$mF;+9L!O5W@C`o(HFOVWqs7xhWnBSFN_hLX1F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