mirror of https://github.com/AxioDL/tinyxml2.git
reset name
This commit is contained in:
parent
dadcdfad4a
commit
39ede2487d
|
@ -88,6 +88,8 @@ 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* start = p;
|
||||
|
@ -115,10 +117,10 @@ const char* XMLBase::ParseName( char* p, char** next )
|
|||
*p = 0;
|
||||
|
||||
if ( p > start ) {
|
||||
*next = p;
|
||||
*next = p+1;
|
||||
return start;
|
||||
}
|
||||
return p+1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
24
tinyxml2.h
24
tinyxml2.h
|
@ -45,6 +45,28 @@ struct CharBuffer
|
|||
static void Free( CharBuffer* );
|
||||
};
|
||||
|
||||
// FIXME: refactor to be the basis for all string handling.
|
||||
class StrPair
|
||||
{
|
||||
enum {
|
||||
NEEDS_FLUSH = 0x01,
|
||||
NEEDS_ENTITY_PROCESSING = 0x02,
|
||||
NEEDS_NEWLINE_NORMALIZATION = 0x04
|
||||
};
|
||||
|
||||
StrPair() : flags( 0 ), start( 0 ), end( 0 ) {}
|
||||
void Init( const char* start, char* end, int flags; ) {
|
||||
this->start = start; this->end = end; this->flags = flags | NEEDS_FLUSH;
|
||||
}
|
||||
const char* GetStr();
|
||||
|
||||
private:
|
||||
// After parsing, if *end != 0, it can be set to zero.
|
||||
int flags;
|
||||
const char* start;
|
||||
char* end;
|
||||
};
|
||||
|
||||
|
||||
class XMLBase
|
||||
{
|
||||
|
@ -71,7 +93,7 @@ protected:
|
|||
inline static int IsAlpha( unsigned char anyByte ) { return ( anyByte <= 127 ) ? isalpha( anyByte ) : 1; }
|
||||
|
||||
const char* ParseText( char* in, const char* endTag, char** next );
|
||||
const char* ParseName( char* in, char** next );
|
||||
char* ParseName( char* in, StrPair* pair );
|
||||
char* Identify( XMLDocument* document, char* p, XMLNode** node );
|
||||
};
|
||||
|
||||
|
|
BIN
tinyxml2.suo
BIN
tinyxml2.suo
Binary file not shown.
|
@ -28,7 +28,7 @@ int main( int argc, const char* argv )
|
|||
}
|
||||
#endif
|
||||
{
|
||||
static const char* test[] = { "<element />",
|
||||
static const char* test[] = { //"<element />",
|
||||
"<element></element>",
|
||||
0
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue