Updated to latest TinyXML

Build TinyXML into core dll once and use it from CLI
This commit is contained in:
PKEuS 2013-08-03 20:29:50 +02:00
parent 2413655d3d
commit 4a84195a8c
6 changed files with 94 additions and 88 deletions

View File

@ -174,7 +174,7 @@
<BufferSecurityCheck>true</BufferSecurityCheck> <BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
@ -216,7 +216,7 @@
<BufferSecurityCheck>true</BufferSecurityCheck> <BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
@ -266,7 +266,7 @@
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>false</BufferSecurityCheck> <BufferSecurityCheck>false</BufferSecurityCheck>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
@ -327,7 +327,7 @@
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\lib;..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>false</BufferSecurityCheck> <BufferSecurityCheck>false</BufferSecurityCheck>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
@ -357,12 +357,6 @@
<ResourceCompile Include="version.rc" /> <ResourceCompile Include="version.rc" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\externals\tinyxml\tinyxml2.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="..\lib\config.h" /> <ClInclude Include="..\lib\config.h" />
<ClInclude Include="cmdlineparser.h" /> <ClInclude Include="cmdlineparser.h" />
<ClInclude Include="cppcheckexecutor.h" /> <ClInclude Include="cppcheckexecutor.h" />
@ -376,12 +370,6 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\externals\tinyxml\tinyxml2.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="cmdlineparser.cpp" /> <ClCompile Include="cmdlineparser.cpp" />
<ClCompile Include="cppcheckexecutor.cpp" /> <ClCompile Include="cppcheckexecutor.cpp" />
<ClCompile Include="filelister.cpp" /> <ClCompile Include="filelister.cpp" />

View File

@ -32,9 +32,6 @@
<ClInclude Include="pathmatch.h"> <ClInclude Include="pathmatch.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\externals\tinyxml\tinyxml2.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="main.cpp"> <ClCompile Include="main.cpp">
@ -55,9 +52,6 @@
<ClCompile Include="cmdlineparser.cpp"> <ClCompile Include="cmdlineparser.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\externals\tinyxml\tinyxml2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="version.rc"> <ResourceCompile Include="version.rc">

View File

@ -425,13 +425,13 @@ void XMLUtil::ToStr( bool v, char* buffer, int bufferSize )
void XMLUtil::ToStr( float v, char* buffer, int bufferSize ) void XMLUtil::ToStr( float v, char* buffer, int bufferSize )
{ {
TIXML_SNPRINTF( buffer, bufferSize, "%g", v ); TIXML_SNPRINTF( buffer, bufferSize, "%f", v );
} }
void XMLUtil::ToStr( double v, char* buffer, int bufferSize ) void XMLUtil::ToStr( double v, char* buffer, int bufferSize )
{ {
TIXML_SNPRINTF( buffer, bufferSize, "%g", v ); TIXML_SNPRINTF( buffer, bufferSize, "%f", v );
} }
@ -499,8 +499,8 @@ char* XMLDocument::Identify( char* p, XMLNode** node )
// What is this thing? // What is this thing?
// - Elements start with a letter or underscore, but xml is reserved. // - Elements start with a letter or underscore, but xml is reserved.
// - Comments: <!-- // - Comments: <!--
// - Decleration: <? // - Declaration: <?
// - Everthing else is unknown to tinyxml. // - Everything else is unknown to tinyxml.
// //
static const char* xmlHeader = { "<?" }; static const char* xmlHeader = { "<?" };
@ -581,7 +581,8 @@ XMLNode::XMLNode( XMLDocument* doc ) :
_document( doc ), _document( doc ),
_parent( 0 ), _parent( 0 ),
_firstChild( 0 ), _lastChild( 0 ), _firstChild( 0 ), _lastChild( 0 ),
_prev( 0 ), _next( 0 ) _prev( 0 ), _next( 0 ),
_memPool( 0 )
{ {
} }
@ -1608,6 +1609,7 @@ XMLError XMLDocument::LoadFile( FILE* fp )
fseek( fp, 0, SEEK_SET ); fseek( fp, 0, SEEK_SET );
if ( size == 0 ) { if ( size == 0 ) {
SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );
return _errorID; return _errorID;
} }
@ -1662,6 +1664,7 @@ XMLError XMLDocument::SaveFile( FILE* fp, bool compact )
XMLError XMLDocument::Parse( const char* p, size_t len ) XMLError XMLDocument::Parse( const char* p, size_t len )
{ {
const char* start = p;
Clear(); Clear();
if ( !p || !*p ) { if ( !p || !*p ) {
@ -1682,12 +1685,13 @@ XMLError XMLDocument::Parse( const char* p, size_t len )
return _errorID; return _errorID;
} }
ParseDeep( _charBuffer, 0 ); ptrdiff_t delta = p - start; // skip initial whitespace, BOM, etc.
ParseDeep( _charBuffer+delta, 0 );
return _errorID; return _errorID;
} }
void XMLDocument::Print( XMLPrinter* streamer ) void XMLDocument::Print( XMLPrinter* streamer ) const
{ {
XMLPrinter stdStreamer( stdout ); XMLPrinter stdStreamer( stdout );
if ( !streamer ) { if ( !streamer ) {
@ -1835,8 +1839,8 @@ void XMLPrinter::PrintString( const char* p, bool restricted )
void XMLPrinter::PushHeader( bool writeBOM, bool writeDec ) void XMLPrinter::PushHeader( bool writeBOM, bool writeDec )
{ {
static const unsigned char bom[] = { TIXML_UTF_LEAD_0, TIXML_UTF_LEAD_1, TIXML_UTF_LEAD_2, 0 };
if ( writeBOM ) { if ( writeBOM ) {
static const unsigned char bom[] = { TIXML_UTF_LEAD_0, TIXML_UTF_LEAD_1, TIXML_UTF_LEAD_2, 0 };
Print( "%s", bom ); Print( "%s", bom );
} }
if ( writeDec ) { if ( writeDec ) {

View File

@ -57,6 +57,23 @@ distribution.
# endif # endif
#endif #endif
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4251)
#endif
#ifdef _WIN32
# ifdef TINYXML2_EXPORT
# define TINYXML2_LIB __declspec(dllexport)
# elif defined(TINYXML2_IMPORT)
# define TINYXML2_LIB __declspec(dllimport)
# else
# define TINYXML2_LIB
# endif
#else
# define TINYXML2_LIB
#endif
#if defined(DEBUG) #if defined(DEBUG)
# if defined(_MSC_VER) # if defined(_MSC_VER)
@ -172,7 +189,7 @@ private:
NEEDS_DELETE = 0x200 NEEDS_DELETE = 0x200
}; };
// After parsing, if *end != 0, it can be set to zero. // After parsing, if *_end != 0, it can be set to zero.
int _flags; int _flags;
char* _start; char* _start;
char* _end; char* _end;
@ -397,18 +414,18 @@ private:
are simply called with Visit(). are simply called with Visit().
If you return 'true' from a Visit method, recursive parsing will continue. If you return If you return 'true' from a Visit method, recursive parsing will continue. If you return
false, <b>no children of this node or its sibilings</b> will be visited. false, <b>no children of this node or its siblings</b> will be visited.
All flavors of Visit methods have a default implementation that returns 'true' (continue All flavors of Visit methods have a default implementation that returns 'true' (continue
visiting). You need to only override methods that are interesting to you. visiting). You need to only override methods that are interesting to you.
Generally Accept() is called on the TiXmlDocument, although all nodes support visiting. Generally Accept() is called on the XMLDocument, although all nodes support visiting.
You should never change the document from a callback. You should never change the document from a callback.
@sa XMLNode::Accept() @sa XMLNode::Accept()
*/ */
class XMLVisitor class TINYXML2_LIB XMLVisitor
{ {
public: public:
virtual ~XMLVisitor() {} virtual ~XMLVisitor() {}
@ -554,7 +571,7 @@ public:
@endverbatim @endverbatim
*/ */
class XMLNode class TINYXML2_LIB XMLNode
{ {
friend class XMLDocument; friend class XMLDocument;
friend class XMLElement; friend class XMLElement;
@ -690,7 +707,7 @@ public:
return _prev; return _prev;
} }
/// Get the previous (left) sibling element of this node, with an opitionally supplied name. /// Get the previous (left) sibling element of this node, with an optionally supplied name.
const XMLElement* PreviousSiblingElement( const char* value=0 ) const ; const XMLElement* PreviousSiblingElement( const char* value=0 ) const ;
XMLElement* PreviousSiblingElement( const char* value=0 ) { XMLElement* PreviousSiblingElement( const char* value=0 ) {
@ -706,7 +723,7 @@ public:
return _next; return _next;
} }
/// Get the next (right) sibling element of this node, with an opitionally supplied name. /// Get the next (right) sibling element of this node, with an optionally supplied name.
const XMLElement* NextSiblingElement( const char* value=0 ) const; const XMLElement* NextSiblingElement( const char* value=0 ) const;
XMLElement* NextSiblingElement( const char* value=0 ) { XMLElement* NextSiblingElement( const char* value=0 ) {
@ -759,12 +776,12 @@ public:
*/ */
virtual bool ShallowEqual( const XMLNode* compare ) const = 0; virtual bool ShallowEqual( const XMLNode* compare ) const = 0;
/** Accept a hierarchical visit of the nodes in the TinyXML DOM. Every node in the /** Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the
XML tree will be conditionally visited and the host will be called back XML tree will be conditionally visited and the host will be called back
via the TiXmlVisitor interface. via the XMLVisitor interface.
This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse
the XML for the callbacks, so the performance of TinyXML is unchanged by using this the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this
interface versus any other.) interface versus any other.)
The interface has been based on ideas from: The interface has been based on ideas from:
@ -776,7 +793,7 @@ public:
An example of using Accept(): An example of using Accept():
@verbatim @verbatim
TiXmlPrinter printer; XMLPrinter printer;
tinyxmlDoc.Accept( &printer ); tinyxmlDoc.Accept( &printer );
const char* xmlcstr = printer.CStr(); const char* xmlcstr = printer.CStr();
@endverbatim @endverbatim
@ -818,9 +835,9 @@ private:
A text node can have 2 ways to output the next. "normal" output A text node can have 2 ways to output the next. "normal" output
and CDATA. It will default to the mode it was parsed from the XML file and and CDATA. It will default to the mode it was parsed from the XML file and
you generally want to leave it alone, but you can change the output mode with you generally want to leave it alone, but you can change the output mode with
SetCDATA() and query it with CDATA(). SetCData() and query it with CData().
*/ */
class XMLText : public XMLNode class TINYXML2_LIB XMLText : public XMLNode
{ {
friend class XMLBase; friend class XMLBase;
friend class XMLDocument; friend class XMLDocument;
@ -859,7 +876,7 @@ private:
/** An XML Comment. */ /** An XML Comment. */
class XMLComment : public XMLNode class TINYXML2_LIB XMLComment : public XMLNode
{ {
friend class XMLDocument; friend class XMLDocument;
public: public:
@ -891,13 +908,13 @@ private:
<?xml version="1.0" standalone="yes"?> <?xml version="1.0" standalone="yes"?>
@endverbatim @endverbatim
TinyXML2 will happily read or write files without a declaration, TinyXML-2 will happily read or write files without a declaration,
however. however.
The text of the declaration isn't interpreted. It is parsed The text of the declaration isn't interpreted. It is parsed
and written as a string. and written as a string.
*/ */
class XMLDeclaration : public XMLNode class TINYXML2_LIB XMLDeclaration : public XMLNode
{ {
friend class XMLDocument; friend class XMLDocument;
public: public:
@ -922,14 +939,14 @@ protected:
}; };
/** Any tag that tinyXml doesn't recognize is saved as an /** Any tag that TinyXML-2 doesn't recognize is saved as an
unknown. It is a tag of text, but should not be modified. unknown. It is a tag of text, but should not be modified.
It will be written back to the XML, unchanged, when the file It will be written back to the XML, unchanged, when the file
is saved. is saved.
DTD tags get thrown into TiXmlUnknowns. DTD tags get thrown into XMLUnknowns.
*/ */
class XMLUnknown : public XMLNode class TINYXML2_LIB XMLUnknown : public XMLNode
{ {
friend class XMLDocument; friend class XMLDocument;
public: public:
@ -988,7 +1005,7 @@ enum XMLError {
@note The attributes are not XMLNodes. You may only query the @note The attributes are not XMLNodes. You may only query the
Next() attribute in a list. Next() attribute in a list.
*/ */
class XMLAttribute class TINYXML2_LIB XMLAttribute
{ {
friend class XMLElement; friend class XMLElement;
public: public:
@ -1005,52 +1022,52 @@ public:
return _next; return _next;
} }
/** IntAttribute interprets the attribute as an integer, and returns the value. /** IntValue interprets the attribute as an integer, and returns the value.
If the value isn't an integer, 0 will be returned. There is no error checking; If the value isn't an integer, 0 will be returned. There is no error checking;
use QueryIntAttribute() if you need error checking. use QueryIntValue() if you need error checking.
*/ */
int IntValue() const { int IntValue() const {
int i=0; int i=0;
QueryIntValue( &i ); QueryIntValue( &i );
return i; return i;
} }
/// Query as an unsigned integer. See IntAttribute() /// Query as an unsigned integer. See IntValue()
unsigned UnsignedValue() const { unsigned UnsignedValue() const {
unsigned i=0; unsigned i=0;
QueryUnsignedValue( &i ); QueryUnsignedValue( &i );
return i; return i;
} }
/// Query as a boolean. See IntAttribute() /// Query as a boolean. See IntValue()
bool BoolValue() const { bool BoolValue() const {
bool b=false; bool b=false;
QueryBoolValue( &b ); QueryBoolValue( &b );
return b; return b;
} }
/// Query as a double. See IntAttribute() /// Query as a double. See IntValue()
double DoubleValue() const { double DoubleValue() const {
double d=0; double d=0;
QueryDoubleValue( &d ); QueryDoubleValue( &d );
return d; return d;
} }
/// Query as a float. See IntAttribute() /// Query as a float. See IntValue()
float FloatValue() const { float FloatValue() const {
float f=0; float f=0;
QueryFloatValue( &f ); QueryFloatValue( &f );
return f; return f;
} }
/** QueryIntAttribute interprets the attribute as an integer, and returns the value /** QueryIntValue interprets the attribute as an integer, and returns the value
in the provided paremeter. The function will return XML_NO_ERROR on success, in the provided parameter. The function will return XML_NO_ERROR on success,
and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful. and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.
*/ */
XMLError QueryIntValue( int* value ) const; XMLError QueryIntValue( int* value ) const;
/// See QueryIntAttribute /// See QueryIntValue
XMLError QueryUnsignedValue( unsigned int* value ) const; XMLError QueryUnsignedValue( unsigned int* value ) const;
/// See QueryIntAttribute /// See QueryIntValue
XMLError QueryBoolValue( bool* value ) const; XMLError QueryBoolValue( bool* value ) const;
/// See QueryIntAttribute /// See QueryIntValue
XMLError QueryDoubleValue( double* value ) const; XMLError QueryDoubleValue( double* value ) const;
/// See QueryIntAttribute /// See QueryIntValue
XMLError QueryFloatValue( float* value ) const; XMLError QueryFloatValue( float* value ) const;
/// Set the attribute to a string value. /// Set the attribute to a string value.
@ -1069,7 +1086,7 @@ public:
private: private:
enum { BUF_SIZE = 200 }; enum { BUF_SIZE = 200 };
XMLAttribute() : _next( 0 ) {} XMLAttribute() : _next( 0 ), _memPool( 0 ) {}
virtual ~XMLAttribute() {} virtual ~XMLAttribute() {}
XMLAttribute( const XMLAttribute& ); // not supported XMLAttribute( const XMLAttribute& ); // not supported
@ -1089,7 +1106,7 @@ private:
and can contain other elements, text, comments, and unknowns. and can contain other elements, text, comments, and unknowns.
Elements also contain an arbitrary number of attributes. Elements also contain an arbitrary number of attributes.
*/ */
class XMLElement : public XMLNode class TINYXML2_LIB XMLElement : public XMLNode
{ {
friend class XMLBase; friend class XMLBase;
friend class XMLDocument; friend class XMLDocument;
@ -1301,10 +1318,10 @@ public:
const XMLAttribute* FindAttribute( const char* name ) const; const XMLAttribute* FindAttribute( const char* name ) const;
/** Convenience function for easy access to the text inside an element. Although easy /** Convenience function for easy access to the text inside an element. Although easy
and concise, GetText() is limited compared to getting the TiXmlText child and concise, GetText() is limited compared to getting the XMLText child
and accessing it directly. and accessing it directly.
If the first child of 'this' is a TiXmlText, the GetText() If the first child of 'this' is a XMLText, the GetText()
returns the character string of the Text node, else null is returned. returns the character string of the Text node, else null is returned.
This is a convenient method for getting the text of simple contained text: This is a convenient method for getting the text of simple contained text:
@ -1409,7 +1426,7 @@ enum Whitespace {
All Nodes are connected and allocated to a Document. All Nodes are connected and allocated to a Document.
If the Document is deleted, all its Nodes are also deleted. If the Document is deleted, all its Nodes are also deleted.
*/ */
class XMLDocument : public XMLNode class TINYXML2_LIB XMLDocument : public XMLNode
{ {
friend class XMLElement; friend class XMLElement;
public: public:
@ -1431,7 +1448,7 @@ public:
You may optionally pass in the 'nBytes', which is You may optionally pass in the 'nBytes', which is
the number of bytes which will be parsed. If not the number of bytes which will be parsed. If not
specified, TinyXML will assume 'xml' points to a specified, TinyXML-2 will assume 'xml' points to a
null terminated string. null terminated string.
*/ */
XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) ); XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) );
@ -1507,11 +1524,11 @@ public:
Or you can use a printer to print to memory: Or you can use a printer to print to memory:
@verbatim @verbatim
XMLPrinter printer; XMLPrinter printer;
doc->Print( &printer ); doc.Print( &printer );
// printer.CStr() has a const char* to the XML // printer.CStr() has a const char* to the XML
@endverbatim @endverbatim
*/ */
void Print( XMLPrinter* streamer=0 ); void Print( XMLPrinter* streamer=0 ) const;
virtual bool Accept( XMLVisitor* visitor ) const; virtual bool Accept( XMLVisitor* visitor ) const;
/** /**
@ -1546,7 +1563,7 @@ public:
XMLDeclaration* NewDeclaration( const char* text=0 ); XMLDeclaration* NewDeclaration( const char* text=0 );
/** /**
Create a new Unknown associated with Create a new Unknown associated with
this Document. The memory forthe object this Document. The memory for the object
is managed by the Document. is managed by the Document.
*/ */
XMLUnknown* NewUnknown( const char* text ); XMLUnknown* NewUnknown( const char* text );
@ -1614,7 +1631,7 @@ private:
/** /**
A XMLHandle is a class that wraps a node pointer with null checks; this is A XMLHandle is a class that wraps a node pointer with null checks; this is
an incredibly useful thing. Note that XMLHandle is not part of the TinyXML an incredibly useful thing. Note that XMLHandle is not part of the TinyXML-2
DOM structure. It is a separate utility class. DOM structure. It is a separate utility class.
Take an example: Take an example:
@ -1667,7 +1684,7 @@ private:
See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects. See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects.
*/ */
class XMLHandle class TINYXML2_LIB XMLHandle
{ {
public: public:
/// Create a handle from any node (at any depth of the tree.) This can be a null pointer. /// Create a handle from any node (at any depth of the tree.) This can be a null pointer.
@ -1751,7 +1768,7 @@ private:
A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the
same in all regards, except for the 'const' qualifiers. See XMLHandle for API. same in all regards, except for the 'const' qualifiers. See XMLHandle for API.
*/ */
class XMLConstHandle class TINYXML2_LIB XMLConstHandle
{ {
public: public:
XMLConstHandle( const XMLNode* node ) { XMLConstHandle( const XMLNode* node ) {
@ -1829,7 +1846,7 @@ private:
@verbatim @verbatim
XMLPrinter printer; XMLPrinter printer;
doc->Print( &printer ); doc.Print( &printer );
SomeFunction( printer.CStr() ); SomeFunction( printer.CStr() );
@endverbatim @endverbatim
@ -1858,7 +1875,7 @@ private:
printer.CloseElement(); printer.CloseElement();
@endverbatim @endverbatim
*/ */
class XMLPrinter : public XMLVisitor class TINYXML2_LIB XMLPrinter : public XMLVisitor
{ {
public: public:
/** Construct the printer. If the FILE* is specified, /** Construct the printer. If the FILE* is specified,
@ -1964,5 +1981,8 @@ private:
} // tinyxml2 } // tinyxml2
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
#endif // TINYXML2_INCLUDED #endif // TINYXML2_INCLUDED

View File

@ -237,7 +237,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_EXPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4251;4512</DisableSpecificWarnings> <DisableSpecificWarnings>4251;4512</DisableSpecificWarnings>
@ -255,7 +255,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_EXPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4251;4512</DisableSpecificWarnings> <DisableSpecificWarnings>4251;4512</DisableSpecificWarnings>
@ -273,7 +273,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_EXPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4251;4512</DisableSpecificWarnings> <DisableSpecificWarnings>4251;4512</DisableSpecificWarnings>
@ -290,7 +290,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_EXPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4251;4512</DisableSpecificWarnings> <DisableSpecificWarnings>4251;4512</DisableSpecificWarnings>
@ -315,7 +315,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4251;4512</DisableSpecificWarnings> <DisableSpecificWarnings>4251;4512</DisableSpecificWarnings>
<PreprocessorDefinitions>CPPCHECKLIB_EXPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<DebugInformationFormat> <DebugInformationFormat>
</DebugInformationFormat> </DebugInformationFormat>
@ -341,7 +341,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4251;4512</DisableSpecificWarnings> <DisableSpecificWarnings>4251;4512</DisableSpecificWarnings>
<PreprocessorDefinitions>CPPCHECKLIB_EXPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<DebugInformationFormat> <DebugInformationFormat>
</DebugInformationFormat> </DebugInformationFormat>
@ -368,7 +368,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4251;4512</DisableSpecificWarnings> <DisableSpecificWarnings>4251;4512</DisableSpecificWarnings>
<PreprocessorDefinitions>CPPCHECKLIB_EXPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<DebugInformationFormat> <DebugInformationFormat>
</DebugInformationFormat> </DebugInformationFormat>
@ -394,7 +394,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\externals;..\externals\tinyxml;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4251;4512</DisableSpecificWarnings> <DisableSpecificWarnings>4251;4512</DisableSpecificWarnings>
<PreprocessorDefinitions>CPPCHECKLIB_EXPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<DebugInformationFormat> <DebugInformationFormat>
</DebugInformationFormat> </DebugInformationFormat>
@ -411,4 +411,4 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" /> <ImportGroup Label="ExtensionTargets" />
</Project> </Project>

View File

@ -250,7 +250,7 @@
<ClInclude Include="checkassert.h"> <ClInclude Include="checkassert.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="environment.h"> <ClInclude Include="library.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\externals\tinyxml\tinyxml2.h"> <ClInclude Include="..\externals\tinyxml\tinyxml2.h">
@ -260,4 +260,4 @@
<ItemGroup> <ItemGroup>
<ResourceCompile Include="version.rc" /> <ResourceCompile Include="version.rc" />
</ItemGroup> </ItemGroup>
</Project> </Project>