Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ee53e7d49 | ||
|
|
256adb6371 | ||
|
|
98112fcdba | ||
|
|
433f1272d4 | ||
|
|
b59ac45131 | ||
|
|
a0744c8dca | ||
|
|
8f7b87b323 | ||
|
|
268c683fbd |
@@ -10,7 +10,7 @@ include(GNUInstallDirs)
|
|||||||
################################
|
################################
|
||||||
# set lib version here
|
# set lib version here
|
||||||
|
|
||||||
set(GENERIC_LIB_VERSION "2.0.1")
|
set(GENERIC_LIB_VERSION "2.1.0")
|
||||||
set(GENERIC_LIB_SOVERSION "2")
|
set(GENERIC_LIB_SOVERSION "2")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -269,6 +269,14 @@ an XCode project, a Code::Blocks project, and a cmake CMakeLists.txt included to
|
|||||||
The top of tinyxml.h even has a simple g++ command line if you are are *nix and don't want
|
The top of tinyxml.h even has a simple g++ command line if you are are *nix and don't want
|
||||||
to use a build system.
|
to use a build system.
|
||||||
|
|
||||||
|
Versioning
|
||||||
|
----------
|
||||||
|
|
||||||
|
TinyXML-2 uses semantic versioning. http://semver.org/ Releases are now tagged in github.
|
||||||
|
|
||||||
|
Note that the major version will (probably) change fairly rapidly. API changes are fairly
|
||||||
|
common.
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|||||||
@@ -116,3 +116,6 @@ print( "Release note:" )
|
|||||||
print( '1. Build. g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe' )
|
print( '1. Build. g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe' )
|
||||||
print( '2. Commit. git commit -am"setting the version to ' + versionStr + '"' )
|
print( '2. Commit. git commit -am"setting the version to ' + versionStr + '"' )
|
||||||
print( '3. Tag. git tag ' + versionStr )
|
print( '3. Tag. git tag ' + versionStr )
|
||||||
|
print( ' OR git tag -a ' + versionStr + ' -m <tag message>' )
|
||||||
|
print( 'Remember to "git push" both code and tag.' )
|
||||||
|
|
||||||
22
tinyxml2.cpp
22
tinyxml2.cpp
@@ -1855,26 +1855,18 @@ void XMLPrinter::Print( const char* format, ... )
|
|||||||
vfprintf( _fp, format, va );
|
vfprintf( _fp, format, va );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// This seems brutally complex. Haven't figured out a better
|
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
|
||||||
// way on windows.
|
int len = _vscprintf( format, va );
|
||||||
#ifdef _MSC_VER
|
|
||||||
int len = -1;
|
|
||||||
int expand = 1000;
|
|
||||||
while ( len < 0 ) {
|
|
||||||
len = vsnprintf_s( _accumulator.Mem(), _accumulator.Capacity(), _TRUNCATE, format, va );
|
|
||||||
if ( len < 0 ) {
|
|
||||||
expand *= 3/2;
|
|
||||||
_accumulator.PushArr( expand );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
char* p = _buffer.PushArr( len ) - 1;
|
|
||||||
memcpy( p, _accumulator.Mem(), len+1 );
|
|
||||||
#else
|
#else
|
||||||
int len = vsnprintf( 0, 0, format, va );
|
int len = vsnprintf( 0, 0, format, va );
|
||||||
|
#endif
|
||||||
// Close out and re-start the va-args
|
// Close out and re-start the va-args
|
||||||
va_end( va );
|
va_end( va );
|
||||||
va_start( va, format );
|
va_start( va, format );
|
||||||
char* p = _buffer.PushArr( len ) - 1;
|
char* p = _buffer.PushArr( len ) - 1; // back up over the null terminator.
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
|
||||||
|
vsnprintf_s( p, len+1, _TRUNCATE, format, va );
|
||||||
|
#else
|
||||||
vsnprintf( p, len+1, format, va );
|
vsnprintf( p, len+1, format, va );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,8 +120,8 @@ inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )
|
|||||||
http://semver.org/
|
http://semver.org/
|
||||||
*/
|
*/
|
||||||
static const int TIXML2_MAJOR_VERSION = 2;
|
static const int TIXML2_MAJOR_VERSION = 2;
|
||||||
static const int TIXML2_MINOR_VERSION = 0;
|
static const int TIXML2_MINOR_VERSION = 1;
|
||||||
static const int TIXML2_PATCH_VERSION = 1;
|
static const int TIXML2_PATCH_VERSION = 0;
|
||||||
|
|
||||||
namespace tinyxml2
|
namespace tinyxml2
|
||||||
{
|
{
|
||||||
@@ -1964,7 +1964,7 @@ public:
|
|||||||
/** If streaming, start writing an element.
|
/** If streaming, start writing an element.
|
||||||
The element must be closed with CloseElement()
|
The element must be closed with CloseElement()
|
||||||
*/
|
*/
|
||||||
void OpenElement( const char* name, bool compactMode );
|
void OpenElement( const char* name, bool compactMode=false );
|
||||||
/// If streaming, add an attribute to an open element.
|
/// If streaming, add an attribute to an open element.
|
||||||
void PushAttribute( const char* name, const char* value );
|
void PushAttribute( const char* name, const char* value );
|
||||||
void PushAttribute( const char* name, int value );
|
void PushAttribute( const char* name, int value );
|
||||||
@@ -1972,7 +1972,7 @@ public:
|
|||||||
void PushAttribute( const char* name, bool value );
|
void PushAttribute( const char* name, bool value );
|
||||||
void PushAttribute( const char* name, double value );
|
void PushAttribute( const char* name, double value );
|
||||||
/// If streaming, close the Element.
|
/// If streaming, close the Element.
|
||||||
virtual void CloseElement( bool compactMode );
|
virtual void CloseElement( bool compactMode=false );
|
||||||
|
|
||||||
/// Add a text node.
|
/// Add a text node.
|
||||||
void PushText( const char* text, bool cdata=false );
|
void PushText( const char* text, bool cdata=false );
|
||||||
|
|||||||
Reference in New Issue
Block a user