removed the pointer-diff

This commit is contained in:
Lee Thomason (grinliz)
2012-03-07 21:54:57 -08:00
8 changed files with 238 additions and 69 deletions

View File

@@ -36,6 +36,7 @@ distribution.
*/
/*
gcc: g++ -Wall tinyxml2.cpp xmltest.cpp -o gccxmltest.exe
*/
#if defined( _DEBUG ) || defined( DEBUG ) || defined (__DEBUG__)
@@ -84,6 +85,9 @@ distribution.
#define TIXML_SSCANF sscanf
#endif
static const int TIXML2_MAJOR_VERSION = 0;
static const int TIXML2_MINOR_VERSION = 9;
static const int TIXML2_PATCH_VERSION = 0;
namespace tinyxml2
{
@@ -112,8 +116,10 @@ public:
NEEDS_NEWLINE_NORMALIZATION = 0x02,
TEXT_ELEMENT = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,
TEXT_ELEMENT_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION,
ATTRIBUTE_NAME = 0,
ATTRIBUTE_VALUE = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,
ATTRIBUTE_VALUE_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION,
COMMENT = NEEDS_NEWLINE_NORMALIZATION,
};
@@ -801,7 +807,7 @@ private:
void operator=( const XMLAttribute& ); // not supported
void SetName( const char* name );
char* ParseDeep( char* p );
char* ParseDeep( char* p, bool processEntities );
mutable StrPair name;
mutable StrPair value;
@@ -959,7 +965,7 @@ class XMLDocument : public XMLNode
friend class XMLElement;
public:
/// constructor
XMLDocument();
XMLDocument( bool processEntities = true );
~XMLDocument();
virtual XMLDocument* ToDocument() { return this; }
@@ -990,6 +996,11 @@ public:
*/
void SaveFile( const char* filename );
bool ProcessEntities() const { return processEntities; }
/**
Returns true if this document has a leading Byte Order Mark of UTF8.
*/
bool HasBOM() const { return writeBOM; }
/** Return the root element of DOM. Equivalent to FirstChildElement().
@@ -1068,8 +1079,8 @@ public:
// internal
char* Identify( char* p, XMLNode** node );
virtual XMLNode* ShallowClone( XMLDocument* ) const { return 0; }
virtual bool ShallowEqual( const XMLNode* ) const { return false; }
virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const { return 0; }
virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const { return false; }
private:
XMLDocument( const XMLDocument& ); // not supported
@@ -1077,6 +1088,7 @@ private:
void InitDocument();
bool writeBOM;
bool processEntities;
int errorID;
const char* errorStr1;
const char* errorStr2;
@@ -1193,6 +1205,7 @@ private:
FILE* fp;
int depth;
int textDepth;
bool processEntities;
enum {
ENTITY_RANGE = 64,