337 Commits
2.1.0 ... 4.0.0

Author SHA1 Message Date
Lee Thomason
6ba2a077ed upping the major version. lots of small (incompatible) changes, and the addition of int64 support. 2016-07-17 22:40:43 -07:00
Lee Thomason
af9bce1762 support user data 2016-07-17 22:35:52 -07:00
Lee Thomason
536a4cde37 Merge branch 'master' into int64support 2016-07-17 21:37:39 -07:00
Lee Thomason
098bd1f17a fix project file version 2016-07-17 21:35:10 -07:00
Lee Thomason
53b0727037 Merge pull request #453 from morinim/issue425
Fixes issue #425
2016-07-17 21:33:54 -07:00
Manlio Morini
0f45b2422f Fixes issue #425 2016-07-11 12:14:59 +02:00
Lee Thomason
d7e5f47524 Merge pull request #445 from kurylo/master
Add INCLUDE_DIRECTORIES on the targets for supported cmake versions.
2016-06-23 13:50:24 -07:00
Lukasz Kurylo
2818e67f31 Add INCLUDE_DIRECTORIES on the targets for supported cmake versions. 2016-06-22 19:22:57 +02:00
Lee Thomason
2fe47ead77 Merge pull request #443 from TheZoc/patch-1
Standardized static library output name
2016-06-09 16:25:14 -07:00
Felipe "Zoc" Silveira
04639a59a5 Standardized static library output name
Renamed ```tinyxml2.a``` to ```libtinyxml2.a```, to allow proper linking using the ```-l``` flag on gcc.
2016-06-08 19:11:37 -03:00
Lee Thomason
1889c3e679 try to make gcc happier 2016-06-04 20:22:57 -07:00
Lee Thomason
51c1271797 add int64 support 2016-06-04 20:18:49 -07:00
Lee Thomason
a572db13cf ps3 support 2016-06-04 19:16:24 -07:00
Lee Thomason
8553625730 one successful return type. simplify build on vs2015 2016-06-04 19:10:53 -07:00
Lee Thomason
df4ffc00d6 fix warning up from vs2015 2016-06-04 11:32:46 -07:00
Lee Thomason
41599e2583 Merge branch 'master' of git://github.com/TheZoc/tinyxml2 into TheZoc-master 2016-06-04 11:26:08 -07:00
Lee Thomason
ceb646812a Merge pull request #438 from TheZoc/osx-makefile
Updated Makefile to allow building TinyXML2 as a static library
2016-06-03 07:56:17 -07:00
Lee Thomason
d3f5c318ae remove unused XMLBase 2016-06-03 07:49:35 -07:00
Felipe "Zoc" Silveira
48daa2dd81 Updated Makefile to allow building TinyXML2 as a static library 2016-05-22 00:21:53 -03:00
Lee Thomason
31d6c877bd Merge pull request #435 from ongjunjie/master
minimize file copying on incremental builds
2016-05-14 10:46:04 -07:00
Felipe "Zoc" Silveira
1f16f9ddf5 Updated to VS 2015 2016-05-12 06:31:28 -03:00
Jun Jie
47f9931130 minimize file copying on incremental builds 2016-04-22 13:37:44 +08:00
Lee Thomason
bb4d246f7b update to VS 2013 2016-03-25 20:08:32 -07:00
Lee Thomason
97837e77f4 Merge pull request #428 from wvvelzen/WarningsFix
Fix 2 "Condition is always true" compiler warnings.
2016-03-25 07:41:51 -07:00
Lee Thomason
3d60e25c4a Merge pull request #427 from wvvelzen/bcb6fix
Fix for Borland C++ Builder 6
2016-03-25 07:41:05 -07:00
Wilfred van Velzen
0aeac18ad3 Fix 2 "Condition is always true" compiler warnings. 2016-03-25 14:14:03 +01:00
Wilfred van Velzen
67abee5610 Fix for Borland C++ Builder 6 2016-03-25 14:01:15 +01:00
Lee Thomason
fe5dbdb817 Merge pull request #414 from ReadmeCritic/master
Correct the capitalization of Xcode in README
2016-03-24 07:49:15 -07:00
Lee Thomason
d175e9de0b Merge pull request #413 from Darksun2010/master
space misses in the comment of CMakeLists.txt
2016-02-17 11:39:22 -08:00
ReadmeCritic
ff714133bc Correct the capitalization of Xcode in README 2016-02-17 09:24:03 -08:00
Darksun
6bf8a07587 space misses in the comment of CMakeLists.txt 2016-02-16 16:10:57 +08:00
Lee Thomason
c8dad95d44 Merge pull request #410 from Dmitry-Me/assertForFTellReturn
Assert to ensure ftell() behaves as expected by later code
2016-02-09 08:39:14 -08:00
Dmitry-Me
96b110d25e Assert to ensure ftell() behaves as expected by later code 2016-02-09 15:12:40 +03:00
Lee Thomason
9ff6654174 Merge pull request #407 from JarleStrand/fix-deletechild
Error fix DeleteChild
2016-01-04 07:40:22 -08:00
Jarle Strand
81abfd6d4c Error fix DeleteChild
Added call to Unlink in XMLNode::DeleteChild() so that references to
node are removed before memory is unallocated. This will ensure the
child is removed from parent and that no pointers are referring to the
unallocated memory. (Code is now aligned with the code in
XMLNode::DeleteChildren() )
2015-12-27 17:30:04 +01:00
Lee Thomason
9c8582c7c3 Merge pull request #401 from Dmitry-Me/assertForNonNullString
Assertion in StrPair::SetStr()
2015-12-09 11:36:59 -08:00
Dmitry-Me
0515fa9d27 Assertion in StrPair::SetStr() 2015-12-09 11:54:06 +03:00
Lee Thomason
f47b20f114 fix readme syntax 2015-10-19 22:55:32 -07:00
Lee Thomason
dffea5747b remove mystery comment 2015-10-19 22:51:49 -07:00
Lee Thomason
fe5b7a5cac Merge pull request #393 from Dmitry-Me/fixSetTextDescription
Fix SetText() description spelling
2015-10-19 17:13:45 -07:00
Dmitry-Me
9e9c85b3ae Fix SetText() description spelling 2015-10-19 18:04:46 +03:00
Lee Thomason
7bc9201322 remove static-assert accidentally checked in. 2015-10-09 14:45:08 -07:00
Lee Thomason
598a88d9fd used stdlib strncmp function 2015-10-09 14:42:12 -07:00
Lee Thomason
e4c0738318 Merge pull request #383 from Chocobo1/travis
CI improvements
2015-10-09 11:28:55 -07:00
Chocobo1
f2c6b118da readme.md: add CI build status badges 2015-10-02 22:09:12 +08:00
Chocobo1
a58de11b42 Add appveyor.yml 2015-10-02 18:08:48 +08:00
Chocobo1
87a8e71c20 TravisCI: support osx build 2015-10-02 17:53:31 +08:00
Lee Thomason
e4f8ba89d0 Merge pull request #381 from ya1gaurav/patch-1
Travis also support clang.
2015-09-29 19:50:14 -07:00
Lee Thomason
a589da416c Merge pull request #380 from Dmitry-Me/getRidOfWtypeLimits
Get rid of -Wtype-limits warning
2015-09-29 19:49:46 -07:00
Gaurav
60af433d31 Travis also support clang.
Add clang compiler to travis build support.
2015-09-28 13:32:30 +05:30
Dmitry-Me
901fed5f19 Get rid of -Wtype-limits warning 2015-09-25 10:29:51 +03:00
Lee Thomason
2aee5e1b37 Merge pull request #379 from renu555/renu555-patch-5
Build with travis CI on every pull request or commit
2015-09-24 10:31:39 -07:00
Lee Thomason
27eb078329 Merge pull request #372 from jasjuang/master
add in support for sudo make uninstall
2015-09-24 10:23:04 -07:00
renu555
d7f2cce11f Create .travis.yml 2015-09-24 14:02:02 +05:30
Lee Thomason
8ac308d433 Merge pull request #376 from renu555/renu555-patch-1
Build tinyxml2 as static library
2015-09-21 07:40:39 -07:00
renu555
871d72f3a8 Build tinyxml2 as static library
By Default shared libs are built
To build static library also configure  cmake with -DBUILD_STATIC_LIBS:BOOL=ON
To build only static library configure cmake with -DBILD_SHARED_LIBS:BOOL=OFF -DBUILD_STATIC_LIBS:BOOL=ON
2015-09-18 13:39:51 +05:30
Lee Thomason
b5d51e8f90 Merge pull request #371 from PKEuS/master
Declared *PRINTF wrappers as static
2015-08-20 07:37:00 -07:00
jasjuang
f6002e6a99 add in support for sudo make uninstall 2015-08-15 16:50:55 -07:00
PKEuS
cac75789ba Declared *PRINTF wrappers as static 2015-08-15 18:19:53 +02:00
Lee Thomason
2beb560a3e Merge pull request #367 from Dmitry-Me/preAssertsToEnsureNoBufferLeaks
Asserts to ensure old buffer is not leaked when allocating a new one
2015-08-14 13:57:53 -07:00
Dmitry-Me
96f38cca95 Asserts to ensure old buffer is not leaked when allocating a new one 2015-08-10 16:45:12 +03:00
Lee Thomason
bb8fd3c29c Merge pull request #364 from PKEuS/master
Moved include of <cstdarg> to cpp file
2015-08-07 15:51:02 -07:00
Lee Thomason
7ae888a601 Merge pull request #363 from Dmitry-Me/outputLengthAsserts
Asserts for formatted output length
2015-08-07 15:50:16 -07:00
Lee Thomason
d101a9b1a6 Merge pull request #366 from yang-le/master
add *.o to .gitignore
2015-08-07 15:46:51 -07:00
Yang Le
14d5490618 add *.o to .gitignore 2015-08-06 22:38:48 +08:00
Philipp Kloke
358202c77a Moved include of <cstdarg> to cpp file 2015-07-30 16:02:26 +02:00
Dmitry-Me
1d32e586d5 Asserts for formatted output length 2015-07-27 17:11:51 +03:00
Lee Thomason
78fca3db83 Merge pull request #361 from RossBencina/master
fix compiler warning (XCode 4.6.1 x86_64) tinyxml2.cpp:2146:77: Impli…
2015-07-23 17:00:05 -07:00
Lee Thomason
fd6ad7e3a7 Merge pull request #362 from Dmitry-Me/useElementName
Use "name" for element name
2015-07-23 16:59:20 -07:00
Dmitry-Me
886ad9787c Use "name" for element name 2015-07-22 11:00:51 +03:00
Ross Bencina
e7fa0e159e fix compiler warning (XCode 4.6.1 x86_64) tinyxml2.cpp:2146:77: Implicit conversion loses integer precision: 'const size_t' (aka 'const unsigned long') to 'const int' 2015-07-22 16:58:05 +10:00
Lee Thomason
eb89ef6f0d Merge pull request #360 from Dmitry-Me/documentConsistencyAsserts
Document consistency asserts
2015-07-21 16:20:12 -07:00
Dmitry-Me
66487eb8f9 Document consistency asserts 2015-07-20 18:21:04 +03:00
Lee Thomason
400e5b2d60 Merge pull request #358 from Dmitry-Me/betterDocumentWarningSuppression
Better document warning suppression code
2015-07-06 14:17:30 -07:00
Dmitry-Me
8dd493b268 Better document warning suppression code 2015-07-02 13:59:30 +03:00
Lee Thomason
4824e95bc0 Merge pull request #343 from Dmitry-Me/checkEntityWasPrinted
Ensure proper pattern was found and printed
2015-07-01 14:18:15 -07:00
Lee Thomason
70fd52a574 Merge pull request #354 from Dmitry-Me/properCapsVisualStudio
Proper capitalize Visual Studio in comment
2015-06-23 16:30:01 -07:00
Dmitry-Me
1ca593c4ca Proper capitalize Visual Studio in comment 2015-06-22 12:49:32 +03:00
Lee Thomason
aebaeea687 Merge pull request #353 from Dmitry-Me/unselessConst
Useless const
2015-06-19 16:55:19 -07:00
Lee Thomason
73f08a3185 Merge pull request #352 from Dmitry-Me/consistencyAsserts
Consistency asserts
2015-06-19 16:54:54 -07:00
Lee Thomason
aa8566b137 fix a macro version check 2015-06-19 16:52:40 -07:00
Dmitry-Me
7865aad09b Useless const 2015-06-19 16:23:35 +03:00
Dmitry-Me
2f5a103992 Consistency asserts 2015-06-18 16:40:09 +03:00
Lee Thomason
53db4a6cf4 move to cpp file. 2015-06-11 22:52:08 -07:00
pffang
1527cf4b2f Patch for Visual Studio 2003 and earlier.
This patch will be easy to extend in the future.
2015-06-09 13:57:11 +08:00
Lee Thomason
2b2649e1e4 Merge pull request #349 from Dmitry-Me/properHandleSmallBufferOnCe
Don't use -1 as buffer length
2015-06-08 17:14:14 -07:00
Dmitry-Me
687bf8211f Don't use -1 as buffer length 2015-06-08 18:06:44 +03:00
Dmitry-Me
39c399a0f2 Ensure proper pattern was found and printed 2015-05-28 15:32:27 +03:00
Lee Thomason
91f2dcfb5c Merge pull request #342 from Dmitry-Me/testErrorNames
Test error name is non-empty for the whole range
2015-05-26 11:09:12 -07:00
Lee Thomason
32de9f02f5 Merge pull request #341 from Dmitry-Me/cleanupComment
Remove redundant comment, fix typo and formatting
2015-05-26 09:18:55 -07:00
Dmitry-Me
a1beddf486 Test error name is non-empty for the whole range 2015-05-26 16:19:21 +03:00
Dmitry-Me
962083b9d1 Remove redundant comment, fix typo and formatting 2015-05-26 11:38:30 +03:00
Lee Thomason
735ce51124 Merge pull request #339 from Dmitry-Me/properFixGccSignCompare
Proper fix gcc -Wsign-compare
2015-05-25 10:40:45 -07:00
Dmitry-Me
ca86a0fa2a Proper fix gcc -Wsign-compare 2015-05-25 11:29:14 +03:00
Lee Thomason
c879a4d48c Merge pull request #338 from Dmitry-Me/removeAmbiguousEnumItems
Get rid of two distinct enum items with same same
2015-05-22 11:09:33 -07:00
Lee Thomason
949ae37e0a Merge pull request #337 from Dmitry-Me/checkEntityFoundExplicitly
Explicitly check entity was not found
2015-05-22 11:08:31 -07:00
Lee Thomason
03d0f4ea25 Merge branch 'SirR4T-assert-fires-when-calling-XMLDocument--Value' 2015-05-22 11:07:58 -07:00
Lee Thomason
8549202800 clean up Value of XMLDocument 2015-05-22 11:07:45 -07:00
Lee Thomason
c52aa55a86 Merge branch 'SirR4T-patch-1' 2015-05-22 11:00:59 -07:00
Lee Thomason
7a93b33160 tighten up the error checks 2015-05-22 11:00:32 -07:00
Lee Thomason
2ecc203835 Merge branch 'patch-1' of https://github.com/SirR4T/tinyxml2 into SirR4T-patch-1 2015-05-22 10:57:00 -07:00
Dmitry-Me
5420e547d3 Get rid of two distinct enum items with same same 2015-05-20 10:51:26 +03:00
Dmitry-Me
764545e02a Explicitly check entity was not found 2015-05-20 10:29:24 +03:00
Sarat Addepalli
3df007ef9d Fix and use correct pointers and types.
Should have been `XMLDeclaration* decl = ...` instead of `XMLElement* ele = ...`
2015-05-20 10:43:51 +05:30
Sarat Addepalli
96b4346660 Remove unnecessary cast in XMLNode::Value() 2015-05-20 10:36:06 +05:30
Sarat Addepalli
d608c561e0 Fix up xmltest.cpp
Fixed coding style in XMLTest(), and removed unused variable in testcase.
2015-05-20 10:19:00 +05:30
Lee Thomason
ff53d7172c Merge pull request #335 from SirR4T/SirR4T-add-DEBUG-macro-in-CMakeLists_txt
Define the `DEBUG` macro in CMakeLists.txt
2015-05-19 09:37:33 -07:00
Lee Thomason
1bf04fd755 Merge pull request #330 from Dmitry-Me/avoidUnneededPrinterCreation
Avoid unneeded printer object creation
2015-05-19 09:31:41 -07:00
Sarat Addepalli
9afd1d0ceb Clarify meaning of 'empty'
When `XMLDocument::Value()` is called, we intend to return NULL (`( const char* )0`). State that explicitly in the documentation, so as to disambiguate between "empty string" (`""`) and NULL.
2015-05-19 12:56:27 +05:30
Sarat Addepalli
9c3122b89b Bypass asserts for XMLDocument::Value()
When the node is an XMLDocument, bypass calling the `_value.GetStr()` function, since we know we have to return `( const char* )0` inevitably.

This fixes #323
2015-05-19 12:49:32 +05:30
Sarat Addepalli
13b2d73427 Add null-checks in XMLTest()
When either `expected` or `found` is `NULL`, `XMLTest()` will segfault on `strcmp()`.
This patch adds null-checks, and passes the test if both `expected` and `found` are `NULL`.
2015-05-19 12:44:57 +05:30
Sarat Addepalli
a7edb883f0 Add a test case for issue #323
When compiled in "debug mode", this test case verifies that an assert is fired, when `XMLDocument::Value()` is called.
2015-05-19 12:39:27 +05:30
Sarat Addepalli
39a77dd825 Define the DEBUG macro in CMakeLists.txt
Fixes #334
2015-05-19 12:27:59 +05:30
Sarat Addepalli
8e85afa406 Fix whitespaces in xmltest.cpp 2015-05-19 09:07:03 +05:30
Sarat Addepalli
2f0d173f94 Fix whitespaces in tinyxml2.cpp 2015-05-19 09:02:16 +05:30
Sarat Addepalli
a0f499dda1 Fix ParseDeep() to close issue #332
If the node to be added is an XML Declaration, then check if the document has any children already.
XML Declarations can only be the FirstChild() s of an XML Document.
2015-05-18 09:25:17 +05:30
Sarat Addepalli
2bb6bb5bee Add a test case for issue #332
XML Declarations can occur only at the beginning of an XML Document.
Parse() should throw an error, for not well-formed XML Documents.
2015-05-18 09:16:34 +05:30
Dmitry-Me
67c429e4b4 Avoid unneeded printer object creation 2015-05-08 18:08:18 +03:00
Lee Thomason
e5e5541af6 Merge pull request #328 from Dmitry-Me/firstCheckThenConvert
First check, then convert
2015-05-07 13:54:31 -07:00
Dmitry-Me
72801b8b20 First check, then convert 2015-05-07 09:41:39 +03:00
Lee Thomason
89df56c046 Merge pull request #327 from Dmitry-Me/ensureFileSizeFitsInSizeT
Ensure file contents fit into size_t range
2015-05-06 16:40:01 -07:00
Dmitry-Me
2a8b1f5789 Ensure file contents fit into size_t range 2015-04-30 14:58:57 +03:00
Lee Thomason
882e89e601 Merge pull request #326 from Dmitry-Me/cleanupPointersComparison
Unify pointers comparison, consistency asserts
2015-04-27 16:57:37 -07:00
Lee Thomason
a295da4302 Merge pull request #324 from Dmitry-Me/checkWithoutClangTautological
Range check without clang "always true" warning
2015-04-27 16:56:24 -07:00
Dmitry-Me
69d521d354 Unify pointers comparison, consistency asserts 2015-04-20 18:05:53 +03:00
Dmitry-Me
2ad4320339 Range check without clang "always true" warning 2015-04-16 12:18:58 +03:00
Lee Thomason
4f0c2ffcab fix 'always true' warning 2015-04-13 13:58:20 -07:00
Lee Thomason
70f2c740c0 Merge pull request #322 from Dmitry-Me/detectParsingErrorEarlier
Detect parsing error earlier when looking at end of tag
2015-04-13 13:43:07 -07:00
Dmitry-Me
ccd267a782 Detect parsing error earlier when looking at end of tag 2015-04-10 15:42:54 +03:00
Lee Thomason
9f24acd369 Merge pull request #321 from Dmitry-Me/dontLeakTheElement
Don't leak the element
2015-04-09 14:49:59 -07:00
Lee Thomason
e3932d6b7f Merge pull request #319 from Dmitry-Me/getRidOfNull
Get rid of NULL, cleanup formatting
2015-04-09 14:49:25 -07:00
Lee Thomason
5ea4f3cb77 Merge pull request #315 from Dmitry-Me/orderPatternsAsTheyAreSearched
Order patterns the same way they are searched
2015-04-09 14:48:44 -07:00
Lee Thomason
2d39158eaa Merge pull request #317 from Dmitry-Me/moreConsistencyAsserts
More consistency asserts
2015-04-09 14:48:18 -07:00
Dmitry-Me
5daa54cf2b Don't leak the element 2015-04-08 17:45:07 +03:00
Dmitry-Me
e76b8519d1 Get rid of NULL, cleanup formatting 2015-04-08 13:41:40 +03:00
Dmitry-Me
9614f8ff74 More consistency asserts 2015-04-08 10:06:06 +03:00
Lee Thomason
4a0392dd9d Merge pull request #314 from Dmitry-Me/ensureEnumIsPrintedProperly
Ensure enum is printed properly
2015-04-07 09:55:18 -07:00
Lee Thomason
0aa957a352 Merge pull request #313 from Dmitry-Me/shouldBeNoErrorInitially
Test there's no error initially, proper swap "found" and "expected"
2015-04-07 09:53:24 -07:00
Dmitry-Me
400f1199ea Ensure enum is printed properly 2015-04-07 11:51:21 +03:00
Dmitry-Me
32533ca9c2 Test there's no error initially, proper swap "found" and "expected" 2015-04-07 10:37:39 +03:00
Lee Thomason
a1a4a13825 Merge pull request #312 from Dmitry-Me/newDocumentMustBeEmpty
Document must be initially empty
2015-04-06 14:26:23 -07:00
Lee Thomason
4034395d1a Merge pull request #311 from Dmitry-Me/betterParameterName
Better parameter name
2015-04-06 14:25:57 -07:00
Lee Thomason
2a2ed16ce1 Merge pull request #310 from Dmitry-Me/moreConst
Const qualifiers where access is const, unify formatting
2015-04-06 14:25:37 -07:00
Lee Thomason
1881344cb6 Merge pull request #309 from Dmitry-Me/makeParseDeepProtected
Make ParseDeep() protected
2015-04-06 14:25:00 -07:00
Dmitry-Me
48b5df0b9b Document must be initially empty 2015-04-06 18:20:25 +03:00
Dmitry-Me
040092215d Better parameter name 2015-04-06 18:07:18 +03:00
Dmitry-Me
2667aab551 Const qualifiers where access is const, unify formatting 2015-04-03 10:56:59 +03:00
Dmitry-Me
9b0f17753d Make ParseDeep() protected 2015-04-03 10:37:31 +03:00
Lee Thomason
51b33321be Merge pull request #308 from Dmitry-Me/mergePrintCalls
Merge Print() calls
2015-04-02 13:27:50 -07:00
Lee Thomason
8c067ab730 Merge pull request #307 from Dmitry-Me/simplifyOverengineeredCode
Simplify overengineered code
2015-04-02 13:27:17 -07:00
Lee Thomason
fb33e99a77 Merge pull request #306 from Dmitry-Me/printSubstringEntirely
Print entire substring instead of each character
2015-04-02 13:26:50 -07:00
Dmitry-Me
6a79c17c87 Merge Print() calls 2015-03-31 12:18:17 +03:00
Dmitry-Me
8d4e0ec528 Simplify overengineered code 2015-03-30 12:58:28 +03:00
Dmitry-Me
c505e136da Order patterns the same way they are searched 2015-03-30 09:54:36 +03:00
Dmitry-Me
d95172ba47 Print entire substring instead of each character 2015-03-30 08:11:18 +03:00
Lee Thomason
28c7c8c14f Merge pull request #305 from Dmitry-Me/errorShouldBeClearedAfterLoad
If LoadFile() fails then subsequent successful LoadFile() must clear the error
2015-03-26 11:19:28 -07:00
Lee Thomason
55c7879352 Merge branch 'Haloric-Issue-302' 2015-03-26 11:18:42 -07:00
Lee Thomason
f657783cf2 merge fix for save file error 2015-03-26 11:18:21 -07:00
Dmitry-Me
d9852a53af If LoadFile() fails then subsequent successful LoadFile() must clear the error 2015-03-25 10:17:49 +03:00
Lee Thomason
ea21390f28 Merge branch 'Haloric-Issue299' 2015-03-24 11:18:12 -07:00
Lee Thomason
3ccb1cec29 minor formatting cleanup 2015-03-24 11:17:44 -07:00
Ant Mitchell
189198f19c Issue 302: clear any previous save error 2015-03-24 16:20:36 +00:00
Ant Mitchell
148cc1a0a5 Issue 299 - test for code changes 2015-03-24 15:12:35 +00:00
Ant Mitchell
7e744771ad Issue299 - Allow Accept() to work with element trees that are not
linked in to the owning document.
2015-03-24 14:33:28 +00:00
Lee Thomason
32cca51ac5 Merge pull request #300 from davidsanfal/master
Add biicode support to TinyXML-2
2015-03-20 21:29:37 -07:00
Lee Thomason
01969dcde2 Merge remote-tracking branch 'origin/master' 2015-03-17 21:31:57 -07:00
Lee Thomason
1977a7258c setting the version to 3.0.0 2015-03-17 21:30:01 -07:00
Lee Thomason
2b1e18185c Merge pull request #298 from Dmitry-Me/fixCommentTypo
Fix comment typo
2015-03-16 11:57:38 -07:00
Lee Thomason
5ea1cf33f3 Merge pull request #297 from Dmitry-Me/betterAssertsInParsing
Better asserts in parsing
2015-03-16 11:57:13 -07:00
David
4633c3aa27 add biicode support 2015-03-16 10:41:00 +01:00
Dmitry-Me
2f465c412a Fix comment typo 2015-03-16 11:08:23 +03:00
Dmitry-Me
3dc797b2a4 Better asserts in parsing 2015-03-16 11:06:46 +03:00
Lee Thomason
b53aaa885d set the version to 2.3.0 2015-03-15 16:18:35 -07:00
Lee Thomason
245bee08d6 Merge pull request #296 from Dmitry-Me/assertForImpossibleCase
Assert for impossible case
2015-03-15 16:14:12 -07:00
Lee Thomason
80647bde2e Merge remote-tracking branch 'origin/master' 2015-03-15 16:12:51 -07:00
Lee Thomason
7265b763fc merge change; add extra assert 2015-03-15 16:11:47 -07:00
Lee Thomason
ed9aa5a48e Merge pull request #293 from Dmitry-Me/resolveIssue291
Resolve crash when printing malformed entities - issue 291
2015-03-15 16:06:42 -07:00
Dmitry-Me
33bb764d12 Assert for impossible case 2015-03-14 17:14:00 +03:00
Dmitry-Me
bab9b6d59c More asserts in numbers parsing 2015-03-14 16:41:46 +03:00
Dmitry-Me
6f51c803a1 Resolve crash when printing malformed entities - issue 291 2015-03-14 13:25:03 +03:00
Lee Thomason
0f922e7c9a Merge pull request #289 from Dmitry-Me/fixNullPointerDereference
Fix null pointer dereference planted in PR287 and reported in PR288
2015-03-05 10:36:31 -08:00
Dmitry-Me
9fcb876d3b Fix null pointer dereference planted in PR287 and reported in PR288 2015-03-05 17:53:34 +03:00
Lee Thomason
f12ece06fa Merge pull request #287 from Dmitry-Me/preAndPostAssertsInIdentify
Add and make use of pre- and post-asserts in XMLDocument::Identify()
2015-03-04 15:38:37 -08:00
Dmitry-Me
023846628d Add and make use of pre- and post-asserts in XMLDocument::Identify() 2015-03-03 16:02:13 +03:00
Lee Thomason
1354ffabb6 Merge pull request #284 from Dmitry-Me/testDocumentBeforeClearing
Test document had content to clear
2015-02-09 12:12:10 -08:00
Dmitry-Me
aaa4ceab5e Test document had content to clear 2015-02-06 16:00:46 +03:00
Lee Thomason
03824c305d Merge pull request #280 from Dmitry-Me/moveDeclarationToFirstUse
Move declaration to actual first use
2015-01-19 15:38:04 -08:00
Dmitry-Me
6acc9a5469 Move declaration to actual first use 2015-01-15 13:27:47 +03:00
Lee Thomason
b733c26bfe Merge pull request #278 from Dmitry-Me/wrongBoundConstraints
Use proper constraints for int variable
2015-01-13 21:45:29 -08:00
Lee Thomason
2875d842de Merge pull request #277 from Dmitry-Me/preAssertsToClarifyBufferUsage
Pre-asserts to clarify buffer usage
2015-01-13 21:44:54 -08:00
Lee Thomason
e94bde04d2 Merge pull request #276 from Dmitry-Me/removeRedundantParametersList
Remove redundant parameters list
2015-01-13 21:44:10 -08:00
Dmitry-Me
ed7a7dc985 Use proper constraints for int variable 2015-01-14 08:36:12 +03:00
Dmitry-Me
30bdc9735b Pre-asserts to clarify buffer usage 2015-01-14 08:32:23 +03:00
Dmitry-Me
9a5a48dbd2 Remove redundant parameters list 2015-01-14 08:27:32 +03:00
Lee Thomason
38b49ae042 Merge pull request #275 from Dmitry-Me/moreOverflowChecks
More overflow checks
2015-01-13 13:40:25 -08:00
Lee Thomason
d95716bd79 Merge pull request #273 from Dmitry-Me/moreChecksInUtfConversion
More checks inside UTF conversion
2015-01-13 13:39:46 -08:00
Lee Thomason
22f34982dc Merge pull request #271 from JayXon/optimizeLogo
lossless optimization on logo
2015-01-13 13:39:02 -08:00
Dmitry-Me
74fb870c36 More overflow checks 2015-01-13 10:27:36 +03:00
Lee Thomason
7e67bc89de minor formatting changes 2015-01-12 14:05:12 -08:00
Lee Thomason
ba7d9df976 Merge pull request #272 from Dmitry-Me/properTreatStrchrPostConditions
strchr() can only find what is was asked for
2015-01-12 13:58:15 -08:00
Dmitry-Me
bbaf1e1498 More checks inside UTF conversion 2015-01-12 14:07:10 +03:00
Dmitry-Me
9f56e12c16 strchr() can only find what is was asked for 2015-01-12 10:07:54 +03:00
JayXon
778b391286 lossless optimization on logo
was
325 KB (333,465 bytes)
now
209 KB (214,977 bytes)
2015-01-10 01:46:26 -05:00
Lee Thomason
d15686653a Merge pull request #269 from Dmitry-Me/makeFormattingConsistent
Fix formatting, get rid of useless if-else chain
2015-01-09 16:57:17 -08:00
Lee Thomason
f802660f7d Merge pull request #268 from Dmitry-Me/avoidRepeatedComparisons
Get rid of repeated comparisons
2015-01-09 16:56:40 -08:00
Lee Thomason
e4fe285427 Merge pull request #267 from Dmitry-Me/prohibitCopyAndAssignment
Prohibit copy and assigment where they are not supported
2015-01-09 16:55:27 -08:00
Lee Thomason
b389252931 Merge pull request #264 from Dmitry-Me/makeProhibitedStuffPrivate
Prohibited operations should be declared private
2015-01-09 16:55:07 -08:00
Lee Thomason
e53740ec6a Merge pull request #263 from Dmitry-Me/useProperConstCast
Use explicit const_cast
2015-01-09 14:29:05 -08:00
Dmitry-Me
257e11b25b Fix formatting, get rid of useless if-else chain 2015-01-09 15:50:47 +03:00
Dmitry-Me
3ae4f3eb3c Get rid of repeated comparisons 2015-01-09 15:44:16 +03:00
Dmitry-Me
3e0af3793e Prohibit copy and assigment where they are not supported 2015-01-09 15:30:00 +03:00
Dmitry-Me
f547a99619 Prohibited operations should be declared private 2015-01-09 15:17:09 +03:00
Dmitry-Me
e28be7530c Use explicit const_cast 2015-01-09 14:59:30 +03:00
Lee Thomason
3cebdc4fac clean up function names. clean up pointer 2015-01-05 17:16:28 -08:00
Lee Thomason
75b4e23957 Merge pull request #260 from Dmitry-Me/placeChecksInMoreNaturalOrder
Rearrange checks in more natural order
2015-01-05 17:07:50 -08:00
Lee Thomason
6e504e9baf Merge pull request #259 from Dmitry-Me/preAndPostAssertsInGetStr
Pointer asserts in GetStr()
2015-01-05 17:07:06 -08:00
Lee Thomason
59946f6f1a Merge pull request #258 from Dmitry-Me/clarifyIsNameStart
Clarify IsNameStartChar() - resolve issue 250
2015-01-05 17:06:30 -08:00
Lee Thomason
625402a01f Merge pull request #257 from Dmitry-Me/reusePreInsertMagic
Reuse pre-insert manipulations
2015-01-05 17:05:23 -08:00
Lee Thomason
56223ddaea Merge pull request #256 from Dmitry-Me/reuseParseAdjustments
Reuse code with pre-parse adjustments
2015-01-05 17:04:04 -08:00
Lee Thomason
deccff765f Merge pull request #254 from JayXon/onlyCheckElementPointerOnce
Only check ele pointer once
2015-01-05 17:00:43 -08:00
Dmitry-Me
7a7e5dc525 Rearrange checks in more natural order 2015-01-01 17:58:35 +03:00
Dmitry-Me
5ffa73e979 Pointer asserts in GetStr() 2015-01-01 17:47:40 +03:00
Dmitry-Me
ea617f9380 Clarify IsNameStartChar() - resolve issue 250 2015-01-01 16:32:01 +03:00
Dmitry-Me
74e394023a Reuse pre-insert manipulations 2015-01-01 16:26:17 +03:00
Dmitry-Me
97476b7b9e Reuse code with pre-parse adjustments 2015-01-01 16:15:57 +03:00
Lee Thomason
b4e81b014e Merge pull request #253 from Dmitry-Me/getRidOfC4127InAssert
Suppress C4127 in asserts
2014-12-26 16:25:14 -08:00
Lee Thomason
6d12b7bc3d Merge pull request #252 from Dmitry-Me/moreAdequateTestForEmpty
Better tests for empty document
2014-12-26 16:22:25 -08:00
Lee Thomason
5f06297230 Merge pull request #248 from JayXon/simplifyParseName
Simplify ParseName
2014-12-26 16:18:46 -08:00
Lee Thomason
9af6ccb3da fix whitespace conflict 2014-12-26 12:22:30 -08:00
Lee Thomason
78120c2a1e Merge pull request #249 from Dmitry-Me/unifySkipWhiteSpaceCallsAddAsserts
Unify SkipWhiteSpace()/ReadBOM() calls, add asserts
2014-12-26 12:22:55 -08:00
Lee Thomason
ac503ea88a Merge remote-tracking branch 'origin/master' 2014-12-26 12:20:18 -08:00
Lee Thomason
20806ce4e4 add an extra assert 2014-12-26 12:20:07 -08:00
JayXon
e4bf6e360d Only check ele pointer once 2014-12-26 01:00:24 -05:00
Dmitry-Me
4bcbf142a8 Suppress C4127 in asserts 2014-12-25 19:05:18 +03:00
Dmitry-Me
588bb8de49 Better tests for empty document 2014-12-25 18:59:18 +03:00
JayXon
ee525dba4d Simplify ParseName
Only the first char needs to be checked with IsNameStartChar, so check
it before the loop.
2014-12-24 04:01:42 -05:00
Dmitry-Me
bb836dce57 Unify SkipWhiteSpace()/ReadBOM() calls, add asserts 2014-12-24 11:54:05 +03:00
Lee Thomason
69242c4b9b Merge pull request #247 from Dmitry-Me/combineCheckWithDependentCall
Move the check into dependent call
2014-12-23 13:16:11 -08:00
Lee Thomason
ffee345723 Merge pull request #246 from Dmitry-Me/moveVariableDeclaration
Move variable declaration closer to where it's needed
2014-12-23 13:12:38 -08:00
Dmitry-Me
a092bc1f5a Move the check into dependent call 2014-12-23 17:57:05 +03:00
Dmitry-Me
5b4a5169e3 Move variable declaration closer to where it's needed 2014-12-23 17:36:28 +03:00
Lee Thomason
eaddfd8768 Merge pull request #245 from Dmitry-Me/ensureCapacityPreAsserts
Pre-asserts to ensure no overflow happens
2014-12-22 11:27:43 -08:00
Lee Thomason
4e5900c5e8 Merge pull request #244 from Dmitry-Me/unifyCharacterCasts
Unify character casts, reorganize checks
2014-12-22 11:26:52 -08:00
Lee Thomason
0b4bdd2a47 Merge pull request #243 from JayXon/simplify_node_logic
Simplify node logic
2014-12-22 11:22:47 -08:00
Dmitry-Me
9fae869124 Pre-asserts to ensure no overflow happens 2014-12-22 17:59:59 +03:00
Dmitry-Me
8b67d741d4 Unify character casts, reorganize checks 2014-12-22 11:35:12 +03:00
Lee Thomason
ebb0c8f904 fix compiler warning 2014-12-17 10:50:32 -08:00
Lee Thomason
7334f9efab fix a clang warning 2014-12-17 10:43:48 -08:00
Lee Thomason
cd011bc1b7 start working through memory bugs 2014-12-17 10:41:34 -08:00
JayXon
dbfdd8fdd5 Simplify node logic 2014-12-12 20:07:14 -05:00
Lee Thomason
ee2c46928e Merge pull request #240 from Dmitry-Me/simplifyNodeOwnershipTracking
Even more pointer pre-asserts
2014-12-12 15:37:22 -08:00
Dmitry-Me
ed2a407a88 Add more pointer pre-asserts 2014-12-12 10:38:48 +03:00
Lee Thomason
b38d29a8c5 Merge pull request #241 from Dmitry-Me/validatePoolBlockSizeBeforeAllocation
Validate pool block has the right size before calling placement new
2014-12-11 15:25:20 -08:00
Dmitry-Me
e6a95ce50e Validate pool block has the right size before calling placement new 2014-12-10 09:10:27 +03:00
Lee Thomason
f0e8fac4ee Merge pull request #239 from Dmitry-Me/addMorePointerAsserts
More pointer pre-asserts
2014-12-09 11:14:16 -08:00
Lee Thomason
489e5f30a2 Merge pull request #238 from Dmitry-Me/dontImplicitlyConvertErrorID
Should not check errorID with implicit conversion
2014-12-09 11:03:49 -08:00
Dmitry-Me
abb2d046d0 More pointers pre-asserts 2014-12-09 12:59:31 +03:00
Dmitry-Me
9bcd9c7674 Should not check errorID with implicit conversion 2014-12-09 10:58:14 +03:00
Lee Thomason
e6328b81f7 Merge pull request #237 from Dmitry-Me/resolveIssue176
Resolve issue 176
2014-12-08 11:56:17 -08:00
Dmitry-Me
a317bd66a6 Resolve issue 176 2014-12-08 10:35:37 +03:00
Lee Thomason
5c5307013a Merge pull request #235 from Dmitry-Me/reuseFindAttribute
Reuse const FindAttribute for non-const version thereof
2014-12-05 10:26:57 -08:00
Dmitry-Me
1227d51ed0 Reuse const FindAttribute for non-const version thereof 2014-12-05 13:41:45 +03:00
Lee Thomason
7254cf7e57 Merge pull request #234 from Dmitry-Me/errorCheckingNeverWorked
Error checking never actually checked anything
2014-11-28 13:54:55 -08:00
Dmitry-Me
ab37df8d67 Error checking never actually checked anything 2014-11-28 12:08:36 +03:00
Lee Thomason
2114e47453 Merge pull request #230 from antonindrawan/master
Compile TinyXml2 with the Dinkum C++ of QNX 6.5 and QNX 6.6.
2014-11-27 22:34:34 -08:00
Lee Thomason
18f5d7f133 Merge branch 'Dmitry-Me-properStrPairAssignment' 2014-11-27 22:31:37 -08:00
Lee Thomason
2965880447 switch to using pointer, not reference 2014-11-27 22:31:11 -08:00
Anton Indrawan
8a0006ceda Compile TinyXml2 with the Dinkum C++ of QNX 6.5 and QNX 6.6. Processed review comment from leethomason 2014-11-20 18:27:07 +01:00
Anton Indrawan
f59e2d6a89 Compile TinyXml2 with the Dinkum C++ of QNX 6.5 and QNX 6.6.
When we include c++ headers, we have to use explicit std::
2014-11-18 20:50:42 +01:00
Lee Thomason
f5d1d9ead2 Merge remote-tracking branch 'origin/master' 2014-11-15 17:56:08 -08:00
Lee Thomason
b2ec17dd5f very minor cleanup of commented out code 2014-11-15 17:55:40 -08:00
Lee Thomason
a94fc98396 Merge pull request #229 from xantares/test
Rename test, fixed cmake warning.
2014-11-15 17:55:14 -08:00
Lee Thomason
c82446c81e Merge pull request #228 from xantares/shared
Use BUILD_SHARED_LIBS cmake standard.
2014-11-15 17:55:04 -08:00
Lee Thomason
03494b189c Merge remote-tracking branch 'origin/master' into Dmitry-Me-properStrPairAssignment 2014-11-15 17:50:17 -08:00
Lee Thomason
575f190412 fix merge of operator= 2014-11-15 17:50:15 -08:00
Lee Thomason
327d5c142e Merge branch 'properStrPairAssignment' of https://github.com/Dmitry-Me/tinyxml2 into Dmitry-Me-properStrPairAssignment 2014-11-15 17:46:23 -08:00
Lee Thomason
92e521b431 add simple test for not-crashing 2014-11-15 17:45:51 -08:00
xantares
0b2c22bd46 Rename test, fixed cmake warning. 2014-11-14 19:46:18 +01:00
xantares
c8ec6fcab4 Use BUILD_SHARED_LIBS cmake standard. 2014-11-14 19:40:58 +01:00
Dmitry-Me
08b40dd8a5 Implement "move" equivalent of assignment operator for StrPair 2014-11-10 11:17:21 +03:00
Lee Thomason
1cd7e7422c Merge pull request #226 from Dmitry-Me/addPreAssertFixComment
Add pre-assert, fix comment
2014-11-08 16:58:16 -08:00
Dmitry-Me
66d2a84715 Add pre-assert, fix comment 2014-11-08 15:24:52 +03:00
Lee Thomason
97cfa03865 Merge pull request #221 from Dmitry-Me/reuseIsWhiteSpace
Reuse IsWhiteSpace(), move comment.
2014-10-31 15:55:20 -07:00
Dmitry-Me
fa20b227a3 Reuse IsWhiteSpace(), move comment. 2014-10-31 12:53:04 +03:00
Lee Thomason
0826e9632f Merge pull request #220 from tolga9009/patch-1
removing accidentally added newline
2014-10-30 16:49:10 -07:00
Tolga Cakir
78eee7299f removing accidentally added newline 2014-10-30 23:08:39 +01:00
Lee Thomason
4de01a9489 Merge pull request #218 from Dmitry-Me/enableLeakTracing
Enable dump of debug heap memory leaks
2014-10-30 14:17:34 -07:00
Lee Thomason
f07b952296 fix issue 184. clean up xcode project. 2014-10-30 13:25:12 -07:00
Dmitry-Me
99916599da Enable dump of debug heap memory leaks 2014-10-23 11:37:03 +04:00
Lee Thomason
d211bb1351 Merge pull request #216 from Dmitry-Me/removeRepeatedIndexAccesses
Bind reference to avoid repeated accesses by index
2014-10-01 14:22:38 -07:00
Dmitry-Me
d048f1e8e3 Bind reference to avoid repeated accesses by index 2014-10-01 10:30:16 +04:00
Lee Thomason
0895e78549 Merge pull request #215 from Dmitry-Me/duplicateVirtualCalls2
Remove unneeded virtual calls
2014-09-29 16:19:00 -07:00
Dmitry-Me
097339a099 Remove unneeded virtual calls 2014-09-29 13:20:29 +04:00
Lee Thomason
f2496f5824 Merge pull request #214 from Dmitry-Me/duplicateVirtualCalls
Eliminate repeated virtual calls
2014-09-27 15:58:19 -07:00
Lee Thomason
853de8169b Merge pull request #213 from Dmitry-Me/likelyWrongSignature
Function signature is most likely wrong
2014-09-27 15:57:53 -07:00
Lee Thomason
869f1487e2 Merge pull request #212 from Dmitry-Me/reuseConstForNonConst
Reuse const version for non-const one
2014-09-27 15:56:42 -07:00
Dmitry-Me
6d202ff20e Eliminate repeated virtual calls 2014-09-26 14:21:00 +04:00
Dmitry-Me
72bb0ecc39 Function signature is most likely wrong 2014-09-24 16:14:24 +04:00
Dmitry-Me
9de541f465 Reuse const version for non-const one 2014-09-24 14:21:36 +04:00
Lee Thomason
b0776aeead Merge pull request #210 from Dmitry-Me/removeUnneededCast
Remove unneeded cast, reduce duplication, move declarations to their fir...
2014-09-23 16:52:51 -07:00
Dmitry-Me
9fb2b0f42c Remove unneeded cast, reduce duplication, move declarations to their first use. 2014-09-23 17:27:39 +04:00
Lee Thomason
5321a0e21f setting the version to 2.2.0 2014-09-14 12:47:24 -07:00
Lee Thomason
c755667aa0 add an error message 2014-09-14 12:39:42 -07:00
Lee Thomason
331596e83c clean up the scope and names of the error code. 2014-09-11 14:56:43 -07:00
numatrumpet
cd8550c29c Without using preprocessor 2014-09-08 16:59:39 +09:00
numatrumpet
9f52ad5289 Makefile is recovered to original version 2014-09-08 16:41:33 +09:00
numatrumpet
003368429f ErrorNames is not implemented by vector<string> but *char[] 2014-09-08 16:36:28 +09:00
numatrumpet
8f5d3f8e80 make works correctly when using clang++ 2014-09-06 23:09:14 +09:00
numatrumpet
bb5ffac22d Using C++11, XMLUtil::ToErrorName(XMLError) returns the name of error type 2014-09-06 22:56:46 +09:00
Lee Thomason
fb732f97d4 Merge pull request #205 from Dmitry-Me/moveDefinitionsToLoopHeaders
Move loop variable definition into loop headers
2014-09-04 12:59:25 -07:00
Dmitry-Me
3659fe1d33 Move loop variable definition into loop headers 2014-09-04 11:33:49 +04:00
Lee Thomason
cf6d886903 Merge pull request #204 from Dmitry-Me/convertMacrosIntoFunctions
Convert DELETE_X macros into functions
2014-09-03 21:53:54 -07:00
Dmitry-Me
e3225b1c64 Convert DELETE_X macros into functions 2014-09-03 11:03:11 +04:00
Lee Thomason
30152836da Merge pull request #202 from Dmitry-Me/removeRepeatedVirtualCalls
Remove repeated virtual calls
2014-08-28 04:53:51 -07:00
Lee Thomason
83a6d8c373 Merge remote-tracking branch 'origin/master' 2014-08-27 14:45:53 -07:00
Lee Thomason
d526944e3c removed unused _accumulator 2014-08-27 14:45:35 -07:00
Dmitry-Me
b6b4e82626 Remove repeated virtual calls 2014-08-27 17:17:47 +04:00
Lee Thomason
59b9aaea43 Merge pull request #200 from Dmitry-Me/removeObsoleteComment
Remove obsolete comment
2014-08-25 13:46:37 -07:00
Dmitry-Me
ec19a0e513 Remove obsolete comment 2014-08-25 11:05:55 +04:00
Lee Thomason
b6ea923f0f Merge branch 'Dmitry-Me-makeCodeMoreDefensive' 2014-08-23 16:16:38 -07:00
Dmitry-Me
63f3de1a3c Make code more defensive
* initialize out-parameter for cases the callee fails to
* add assert for length being within range
* replace post-assert with pre-assert

Also replace the loop with an equivalent memcpy() call
2014-08-21 12:33:19 +04:00
Lee Thomason
dc50a31758 Merge pull request #197 from Dmitry-Me/dontAdjustStartWhenNeedsDelete
Assert when trying to adjust _start in "needs delete" mode.
2014-08-20 10:03:43 -07:00
Dmitry-Me
67a5bb0ac1 Assert when trying to adjust _start in "needs delete" mode. 2014-08-20 10:01:53 +04:00
Lee Thomason
0b26702ac9 Merge pull request #196 from Dmitry-Me/wrapFopenCalls
Wrap fopen()/fopen_s() calls to avoid duplication
2014-08-19 11:18:52 -07:00
Dmitry-Me
01578db56b Wrap fopen()/fopen_s() calls to avoid duplication 2014-08-19 10:18:48 +04:00
Lee Thomason
2af5679b26 Merge pull request #194 from Dmitry-Me/fixCStyleCast
Replace C-style cast with static_cast
2014-08-17 14:55:39 -07:00
Dmitry-Me
5657176b61 Replace C-style cast with static_cast 2014-08-15 11:03:47 +04:00
Lee Thomason
73c822c201 Merge pull request #193 from Dmitry-Me/shouldCheckFtellForError
Check ftell() result for error code before using it.
2014-08-14 16:46:13 -07:00
Dmitry-Me
acb9c9c260 Check ftell() result for error code before using it. 2014-08-04 09:49:25 +04:00
Lee Thomason
fca00d0ebc Merge pull request #191 from Dmitry-Me/dontIgnoreFgetcReturnValue
fgetc() is not required to clear the error indicator on success
2014-08-03 11:17:04 -07:00
Dmitry-Me
08e7f7be59 fgetc() is not required to clear the error indicator on success 2014-07-31 15:19:14 +04:00
Lee Thomason
84bd9624c6 Merge pull request #190 from pffang/master
WinCE Compatibility Fix
2014-07-12 11:22:30 -07:00
pffang
91d34a0989 WinCE Compatibility Fix 2014-07-10 10:02:35 +08:00
Lee Thomason
cf33e37d25 Merge pull request #187 from amai2012/master
Fix compiler warning: extra ';' after member function definition
2014-05-20 13:56:47 -07:00
Alexander Mai
d740b64044 Fix compiler warning: extra ';' after member function definition 2014-05-20 22:04:42 +02:00
Lee Thomason
500fb6aa21 Merge pull request #181 from eserdem/master
Fixed _CRT_SECURE_NO_WARNINGS macro redefinition warning
2014-04-17 10:07:50 -07:00
Serhat Eser Erdem
ca5d684a2b Fixed _CRT_SECURE_NO_WARNINGS macro redefinition warning 2014-04-17 14:06:15 +02:00
18 changed files with 1402 additions and 589 deletions

1
.gitignore vendored
View File

@@ -11,3 +11,4 @@ tinyxml2/tinyxml2-cbp/obj/
*.user
*.depend
*.layout
*.o

15
.travis.yml Normal file
View File

@@ -0,0 +1,15 @@
language: cpp
os:
- linux
- osx
compiler:
- g++
- clang
before_script: cmake .
script:
- make -j3
- ./xmltest

View File

@@ -1,3 +1,10 @@
IF(BIICODE)
ADD_BIICODE_TARGETS()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/resources)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/resources DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
ENDIF()
RETURN()
ENDIF(BIICODE)
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
cmake_policy(VERSION 2.6)
@@ -10,8 +17,8 @@ include(GNUInstallDirs)
################################
# set lib version here
set(GENERIC_LIB_VERSION "2.1.0")
set(GENERIC_LIB_SOVERSION "2")
set(GENERIC_LIB_VERSION "4.0.0")
set(GENERIC_LIB_SOVERSION "4")
################################
@@ -23,19 +30,20 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/.")
# Add custom target to copy all data
set(TARGET_DATA_COPY DATA_COPY)
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(
${TARGET_DATA_COPY}
COMMAND ${CMAKE_COMMAND} -E echo "In source build")
else(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
make_directory(${CMAKE_CURRENT_BINARY_DIR}/resources/)
add_custom_target(
${TARGET_DATA_COPY}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/resources/dream.xml ${CMAKE_CURRENT_BINARY_DIR}/resources/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/resources/empty.xml ${CMAKE_CURRENT_BINARY_DIR}/resources/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/resources/utf8test.xml ${CMAKE_CURRENT_BINARY_DIR}/resources/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/resources/utf8testverify.xml ${CMAKE_CURRENT_BINARY_DIR}/resources/)
endif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
set(DATA_COPY_FILES)
if(NOT ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
foreach(data dream.xml empty.xml utf8test.xml utf8testverify.xml)
set(DATA_COPY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/resources/${data})
set(DATA_COPY_DEST ${CMAKE_CURRENT_BINARY_DIR}/resources/${data})
add_custom_command(
OUTPUT ${DATA_COPY_DEST}
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${DATA_COPY_SRC} ${DATA_COPY_DEST}
DEPENDS ${DATA_COPY_SRC})
list(APPEND DATA_COPY_FILES ${DATA_COPY_DEST})
endforeach(data)
endif(NOT ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(${TARGET_DATA_COPY} DEPENDS ${DATA_COPY_FILES})
################################
# Add definitions
@@ -44,35 +52,66 @@ if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
################################
# Add targets
set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libraries")
if(BUILD_STATIC_LIBS)
add_library(tinyxml2static STATIC tinyxml2.cpp tinyxml2.h)
set_target_properties(tinyxml2static PROPERTIES OUTPUT_NAME tinyxml2)
endif(BUILD_STATIC_LIBS)
# By Default shared libray is being built
# To build static libs also - Do cmake . -DBUILD_STATIC_LIBS:BOOL=ON
# User can choose not to build shared library by using cmake -BUILD_SHARED_LIBS:BOOL:OFF
# To build only static libs use cmake . -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_STATIC_LIBS:BOOL=ON
option(BUILD_SHARED_LIBS "build as shared library" ON)
option(BUILD_STATIC_LIBS "build as static library" OFF)
if(BUILD_SHARED_LIBS)
add_library(tinyxml2 SHARED tinyxml2.cpp tinyxml2.h)
set_target_properties(tinyxml2 PROPERTIES
COMPILE_DEFINITIONS "TINYXML2_EXPORT"
VERSION "${GENERIC_LIB_VERSION}"
SOVERSION "${GENERIC_LIB_SOVERSION}")
add_executable(test xmltest.cpp)
add_dependencies(test tinyxml2)
add_dependencies(test ${TARGET_DATA_COPY})
target_link_libraries(test tinyxml2)
if(DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
target_include_directories(tinyxml2 INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/.")
endif()
install(TARGETS tinyxml2
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if(BUILD_STATIC_LIBS)
install(TARGETS tinyxml2 tinyxml2static
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
add_library(tinyxml2_static STATIC tinyxml2.cpp tinyxml2.h)
set_target_properties(tinyxml2_static PROPERTIES
COMPILE_DEFINITONS "TINYXML2_EXPORT"
VERSION "${GENERIC_LIB_VERSION}"
SOVERSION "${GENERIC_LIB_SOVERSION}")
set_target_properties( tinyxml2_static PROPERTIES OUTPUT_NAME tinyxml2 )
if(DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
target_include_directories(tinyxml2_static INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/.")
endif()
install(TARGETS tinyxml2_static
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
add_executable(xmltest xmltest.cpp)
if(BUILD_SHARED_LIBS)
add_dependencies(xmltest tinyxml2)
add_dependencies(xmltest ${TARGET_DATA_COPY})
target_link_libraries(xmltest tinyxml2)
else(BUILD_STATIC_LIBS)
install(TARGETS tinyxml2
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif(BUILD_STATIC_LIBS)
add_dependencies(xmltest tinyxml2_static)
add_dependencies(xmltest ${TARGET_DATA_COPY})
target_link_libraries(xmltest tinyxml2_static)
endif()
install(TARGETS DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
foreach(p LIB INCLUDE)
@@ -85,4 +124,13 @@ endforeach()
configure_file(tinyxml2.pc.in tinyxml2.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
#add_test(test ${SAMPLE_NAME} COMMAND $<TARGET_FILE:${SAMPLE_NAME}>)
#add_test(xmltest ${SAMPLE_NAME} COMMAND $<TARGET_FILE:${SAMPLE_NAME}>)
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)

View File

@@ -1,6 +1,19 @@
all: xmltest
xmltest: xmltest.cpp tinyxml2.cpp tinyxml2.h
all: xmltest staticlib
rebuild: clean all
xmltest: xmltest.cpp libtinyxml2.a
clean:
$(RM) *.o xmltest libtinyxml2.a
test: clean xmltest
./xmltest
clean:
rm -f *.o xmltest
staticlib: libtinyxml2.a
libtinyxml2.a: tinyxml2.o
$(AR) $(ARFLAGS)s $@ $^
tinyxml2.o: tinyxml2.cpp tinyxml2.h

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

After

Width:  |  Height:  |  Size: 210 KiB

7
appveyor.yml Normal file
View File

@@ -0,0 +1,7 @@
before_build:
- cmake .
build_script:
- msbuild tinyxml2.sln /m /p:Configuration=Release /t:ALL_BUILD
- copy Release\xmltest.exe .\ && copy Release\tinyxml2.dll .\
- xmltest.exe

7
biicode.conf Normal file
View File

@@ -0,0 +1,7 @@
# Biicode configuration file
[paths]
/
[dependencies]
xmltest.cpp + resources/*.xml

21
cmake_uninstall.cmake.in Normal file
View File

@@ -0,0 +1,21 @@
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)

View File

@@ -65,7 +65,7 @@ public:
protected:
virtual void CloseElement () {
if (_elementJustOpened && !isVoidElement (_stack.PeekTop())) {
SealElement();
SealElementIfJustOpened();
}
XMLPrinter::CloseElement();
}

2
dox
View File

@@ -38,7 +38,7 @@ PROJECT_NAME = "TinyXML-2"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 2.1.0
PROJECT_NUMBER = 4.0.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@@ -1,4 +1,4 @@
TinyXML-2
TinyXML-2 [![TravisCI Status](https://travis-ci.org/leethomason/tinyxml2.svg?branch=master)](https://travis-ci.org/leethomason/tinyxml2) [![AppVeyor Status](https://ci.appveyor.com/api/projects/status/github/leethomason/tinyxml2?branch=master&svg=true)](https://ci.appveyor.com/project/leethomason/tinyxml2)
=========
![TinyXML-2 Logo](http://www.grinninglizard.com/tinyxml2/TinyXML2_small.png)
@@ -177,7 +177,7 @@ will have the Value() of "Far & Away" when queried from the XMLText object,
and will be written back to the XML stream/file as an ampersand.
Additionally, any character can be specified by its Unicode code point:
The syntax "&#xA0;" or "&#160;" are both to the non-breaking space characher.
The syntax `&#xA0;` or `&#160;` are both to the non-breaking space character.
This is called a 'numeric character reference'. Any numeric character reference
that isn't one of the special entities above, will be read, but written as a
regular code point. The output is correct, but the entity syntax isn't preserved.
@@ -264,8 +264,8 @@ There are 2 files in TinyXML-2:
And additionally a test file:
* xmltest.cpp
Simply compile and run. There is a visual studio 2010 project included, a simple Makefile,
an XCode project, a Code::Blocks project, and a cmake CMakeLists.txt included to help you.
Simply compile and run. There is a visual studio 2015 project included, a simple Makefile,
an Xcode project, a Code::Blocks project, and a cmake CMakeLists.txt included to help you.
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.

View File

@@ -116,6 +116,8 @@ print( "Release note:" )
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( '3. Tag. git tag ' + versionStr )
print( ' OR git tag -a ' + versionStr + ' -m <tag message>' )
print( 'Remember to "git push" both code and tag.' )
print( ' OR git tag -a ' + versionStr + ' -m [tag message]' )
print( 'Remember to "git push" both code and tag. For the tag:' )
print( 'git push origin [tagname]')

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-Dll|Win32">
<Configuration>Debug-Dll</Configuration>
@@ -37,51 +37,60 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{E8FB2712-8666-4662-A5B8-2B5B0FB1A260}</ProjectGuid>
<RootNamespace>test</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<CharacterSet>Unicode</CharacterSet>
@@ -125,29 +134,25 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'">
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'">
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
<IntDir>$(SolutionDir)$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
<IntDir>$(SolutionDir)$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'">
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'">
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
<IntDir>$(SolutionDir)$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
<IntDir>$(SolutionDir)$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'">
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-Dll|Win32">
<Configuration>Debug-Dll</Configuration>
@@ -38,51 +38,60 @@
<ProjectGuid>{D1C528B6-AA02-4D29-9D61-DC08E317A70D}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>tinyxml2</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ConfigurationType>StaticLibrary</ConfigurationType>
@@ -132,13 +141,9 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'">
<LinkIncremental>true</LinkIncremental>
@@ -152,13 +157,9 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'">
<LinkIncremental>false</LinkIncremental>

View File

@@ -96,6 +96,9 @@
/* Begin PBXProject section */
037AE058151CCC5200E0F29F /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0610;
};
buildConfigurationList = 037AE05B151CCC5200E0F29F /* Build configuration list for PBXProject "tinyxml2" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
@@ -134,6 +137,8 @@
buildSettings = {
CONFIGURATION_BUILD_DIR = "$(SYMROOT)/Debug";
COPY_PHASE_STRIP = NO;
"GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = DEBUG;
ONLY_ACTIVE_ARCH = YES;
SYMROOT = build;
};
name = Debug;
@@ -156,6 +161,7 @@
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = /usr/local/bin;
MACOSX_DEPLOYMENT_TARGET = "";
PREBINDING = NO;
PRODUCT_NAME = xmltest;
};
@@ -171,6 +177,7 @@
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_MODEL_TUNING = G5;
INSTALL_PATH = /usr/local/bin;
MACOSX_DEPLOYMENT_TARGET = "";
PREBINDING = NO;
PRODUCT_NAME = tinyxml2;
ZERO_LINK = NO;

View File

@@ -1,5 +1,7 @@
#if defined( _MSC_VER )
#define _CRT_SECURE_NO_WARNINGS // This test file is not intended to be secure.
#if !defined( _CRT_SECURE_NO_WARNINGS )
#define _CRT_SECURE_NO_WARNINGS // This test file is not intended to be secure.
#endif
#endif
#include "tinyxml2.h"
@@ -21,13 +23,20 @@
#endif
using namespace tinyxml2;
using namespace std;
int gPass = 0;
int gFail = 0;
bool XMLTest (const char* testString, const char* expected, const char* found, bool echo=true, bool extraNL=false )
{
bool pass = !strcmp( expected, found );
bool pass;
if ( !expected && !found )
pass = true;
else if ( !expected || !found )
pass = false;
else
pass = !strcmp( expected, found );
if ( pass )
printf ("[pass]");
else
@@ -277,6 +286,8 @@ int main( int argc, const char ** argv )
{
#if defined( _MSC_VER ) && defined( DEBUG )
_CrtMemCheckpoint( &startMemState );
// Enable MS Visual C++ debug heap memory leaks dump on exit
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
#endif
#if defined(_MSC_VER) || defined(MINGW32) || defined(__MINGW32__)
@@ -290,14 +301,18 @@ int main( int argc, const char ** argv )
mkdir( "resources/out/", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
#endif
{
TIXMLASSERT( true );
}
if ( argc > 1 ) {
XMLDocument* doc = new XMLDocument();
clock_t startTime = clock();
doc->LoadFile( argv[1] );
clock_t loadTime = clock();
clock_t loadTime = clock();
int errorID = doc->ErrorID();
delete doc; doc = 0;
clock_t deleteTime = clock();
clock_t deleteTime = clock();
printf( "Test file '%s' loaded. ErrorID=%d\n", argv[1], errorID );
if ( !errorID ) {
@@ -401,6 +416,7 @@ int main( int argc, const char ** argv )
}
element->InsertEndChild( sub[2] );
XMLNode* comment = element->InsertFirstChild( doc->NewComment( "comment" ) );
comment->SetUserData((void*)2);
element->InsertAfterChild( comment, sub[0] );
element->InsertAfterChild( sub[0], sub[1] );
sub[2]->InsertFirstChild( doc->NewText( "& Text!" ));
@@ -410,6 +426,7 @@ int main( int argc, const char ** argv )
XMLTest( "Programmatic DOM", 2, doc->FirstChildElement()->LastChildElement( "sub" )->IntAttribute( "attrib" ) );
XMLTest( "Programmatic DOM", "& Text!",
doc->FirstChildElement()->LastChildElement( "sub" )->FirstChild()->ToText()->Value() );
XMLTest("User data", 2, (int)comment->GetUserData());
// And now deletion:
element->DeleteChild( sub[2] );
@@ -498,13 +515,13 @@ int main( int argc, const char ** argv )
double dVal;
result = ele->QueryDoubleAttribute( "attr0", &dVal );
XMLTest( "Query attribute: int as double", result, (int)XML_NO_ERROR );
XMLTest( "Query attribute: int as double", result, (int)XML_SUCCESS);
XMLTest( "Query attribute: int as double", (int)dVal, 1 );
result = ele->QueryDoubleAttribute( "attr1", &dVal );
XMLTest( "Query attribute: double as double", result, (int)XML_NO_ERROR );
XMLTest( "Query attribute: double as double", result, (int)XML_SUCCESS);
XMLTest( "Query attribute: double as double", (int)dVal, 2 );
result = ele->QueryIntAttribute( "attr1", &iVal );
XMLTest( "Query attribute: double as int", result, (int)XML_NO_ERROR );
XMLTest( "Query attribute: double as int", result, (int)XML_SUCCESS);
XMLTest( "Query attribute: double as int", iVal, 2 );
result = ele->QueryIntAttribute( "attr2", &iVal );
XMLTest( "Query attribute: not a number", result, (int)XML_WRONG_ATTRIBUTE_TYPE );
@@ -671,6 +688,107 @@ int main( int argc, const char ** argv )
XMLTest( "SetText types", "1.5", element->GetText() );
}
// ---------- Attributes ---------
{
static const int64_t BIG = -123456789012345678;
XMLDocument doc;
XMLElement* element = doc.NewElement("element");
doc.InsertFirstChild(element);
{
element->SetAttribute("attrib", int(-100));
int v = 0;
element->QueryIntAttribute("attrib", &v);
XMLTest("Attribute: int", -100, v, true);
element->QueryAttribute("attrib", &v);
XMLTest("Attribute: int", -100, v, true);
}
{
element->SetAttribute("attrib", unsigned(100));
unsigned v = 0;
element->QueryUnsignedAttribute("attrib", &v);
XMLTest("Attribute: unsigned", unsigned(100), v, true);
element->QueryAttribute("attrib", &v);
XMLTest("Attribute: unsigned", unsigned(100), v, true);
}
{
element->SetAttribute("attrib", BIG);
int64_t v = 0;
element->QueryInt64Attribute("attrib", &v);
XMLTest("Attribute: int64_t", BIG, v, true);
element->QueryAttribute("attrib", &v);
XMLTest("Attribute: int64_t", BIG, v, true);
}
{
element->SetAttribute("attrib", true);
bool v = false;
element->QueryBoolAttribute("attrib", &v);
XMLTest("Attribute: bool", true, v, true);
element->QueryAttribute("attrib", &v);
XMLTest("Attribute: bool", true, v, true);
}
{
element->SetAttribute("attrib", 100.0);
double v = 0;
element->QueryDoubleAttribute("attrib", &v);
XMLTest("Attribute: double", 100.0, v, true);
element->QueryAttribute("attrib", &v);
XMLTest("Attribute: double", 100.0, v, true);
}
{
element->SetAttribute("attrib", 100.0f);
float v = 0;
element->QueryFloatAttribute("attrib", &v);
XMLTest("Attribute: float", 100.0f, v, true);
element->QueryAttribute("attrib", &v);
XMLTest("Attribute: float", 100.0f, v, true);
}
{
element->SetText(BIG);
int64_t v = 0;
element->QueryInt64Text(&v);
XMLTest("Element: int64_t", BIG, v, true);
}
}
// ---------- XMLPrinter stream mode ------
{
{
FILE* printerfp = fopen("resources/printer.xml", "w");
XMLPrinter printer(printerfp);
printer.OpenElement("foo");
printer.PushAttribute("attrib-text", "text");
printer.PushAttribute("attrib-int", int(1));
printer.PushAttribute("attrib-unsigned", unsigned(2));
printer.PushAttribute("attrib-int64", int64_t(3));
printer.PushAttribute("attrib-bool", true);
printer.PushAttribute("attrib-double", 4.0);
printer.CloseElement();
fclose(printerfp);
}
{
XMLDocument doc;
doc.LoadFile("resources/printer.xml");
XMLTest("XMLPrinter Stream mode: load", doc.ErrorID(), XML_SUCCESS, true);
const XMLDocument& cdoc = doc;
const XMLAttribute* attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-text");
XMLTest("attrib-text", "text", attrib->Value(), true);
attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-int");
XMLTest("attrib-int", int(1), attrib->IntValue(), true);
attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-unsigned");
XMLTest("attrib-unsigned", unsigned(2), attrib->UnsignedValue(), true);
attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-int64");
XMLTest("attrib-int64", int64_t(3), attrib->Int64Value(), true);
attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-bool");
XMLTest("attrib-bool", true, attrib->BoolValue(), true);
attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-double");
XMLTest("attrib-double", 4.0, attrib->DoubleValue(), true);
}
}
// ---------- CDATA ---------------
{
@@ -858,12 +976,20 @@ int main( int argc, const char ** argv )
{
// Empty documents should return TIXML_XML_ERROR_PARSING_EMPTY, bug 1070717
const char* str = " ";
const char* str = "";
XMLDocument doc;
doc.Parse( str );
XMLTest( "Empty document error", XML_ERROR_EMPTY_DOCUMENT, doc.ErrorID() );
}
{
// Documents with all whitespaces should return TIXML_XML_ERROR_PARSING_EMPTY, bug 1070717
const char* str = " ";
XMLDocument doc;
doc.Parse( str );
XMLTest( "All whitespaces document error", XML_ERROR_EMPTY_DOCUMENT, doc.ErrorID() );
}
{
// Low entities
XMLDocument doc;
@@ -980,7 +1106,7 @@ int main( int argc, const char ** argv )
{
// This shouldn't crash.
XMLDocument doc;
if(XML_NO_ERROR != doc.LoadFile( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ))
if(XML_SUCCESS != doc.LoadFile( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ))
{
doc.PrintError();
}
@@ -1150,7 +1276,11 @@ int main( int argc, const char ** argv )
{
XMLDocument doc;
XMLTest( "Document is initially empty", doc.NoChildren(), true );
doc.Clear();
XMLTest( "Empty is empty after Clear()", doc.NoChildren(), true );
doc.LoadFile( "resources/dream.xml" );
XMLTest( "Document has something to Clear()", doc.NoChildren(), false );
doc.Clear();
XMLTest( "Document Clear()'s", doc.NoChildren(), true );
}
@@ -1220,6 +1350,8 @@ int main( int argc, const char ** argv )
XMLDocument doc;
XMLError error = doc.LoadFile( "resources/empty.xml" );
XMLTest( "Loading an empty file", XML_ERROR_EMPTY_DOCUMENT, error );
XMLTest( "Loading an empty file and ErrorName as string", "XML_ERROR_EMPTY_DOCUMENT", doc.ErrorName() );
doc.PrintError();
}
{
@@ -1227,7 +1359,7 @@ int main( int argc, const char ** argv )
static const char* xml_bom_preservation = "\xef\xbb\xbf<element/>\n";
{
XMLDocument doc;
XMLTest( "BOM preservation (parse)", XML_NO_ERROR, doc.Parse( xml_bom_preservation ), false );
XMLTest( "BOM preservation (parse)", XML_SUCCESS, doc.Parse( xml_bom_preservation ), false );
XMLPrinter printer;
doc.Print( &printer );
@@ -1325,6 +1457,14 @@ int main( int argc, const char ** argv )
doc.Print();
}
{
// Test that it doesn't crash.
const char* xml = "<?xml version=\"1.0\"?><root><sample><field0><1</field0><field1>2</field1></sample></root>";
XMLDocument doc;
doc.Parse(xml);
doc.PrintError();
}
#if 1
// the question being explored is what kind of print to use:
// https://github.com/leethomason/tinyxml2/issues/63
@@ -1360,42 +1500,149 @@ int main( int argc, const char ** argv )
}
#endif
{
// Issue #184
// If it doesn't assert, it passes. Caused by objects
// getting created during parsing which are then
// inaccessible in the memory pools.
{
XMLDocument doc;
doc.Parse("<?xml version=\"1.0\" encoding=\"UTF-8\"?><test>");
}
{
XMLDocument doc;
doc.Parse("<?xml version=\"1.0\" encoding=\"UTF-8\"?><test>");
doc.Clear();
}
}
{
// If this doesn't assert in DEBUG, all is well.
tinyxml2::XMLDocument doc;
tinyxml2::XMLElement *pRoot = doc.NewElement("Root");
doc.DeleteNode(pRoot);
}
// ----------- Performance tracking --------------
{
// Should not assert in DEBUG
XMLPrinter printer;
}
{
// Issue 291. Should not crash
const char* xml = "&#0</a>";
XMLDocument doc;
doc.Parse( xml );
XMLPrinter printer;
doc.Print( &printer );
}
{
// Issue 299. Can print elements that are not linked in.
// Will crash if issue not fixed.
XMLDocument doc;
XMLElement* newElement = doc.NewElement( "printme" );
XMLPrinter printer;
newElement->Accept( &printer );
// Delete the node to avoid possible memory leak report in debug output
doc.DeleteNode( newElement );
}
{
// Issue 302. Clear errors from LoadFile/SaveFile
XMLDocument doc;
XMLTest( "Issue 302. Should be no error initially", "XML_SUCCESS", doc.ErrorName() );
doc.SaveFile( "./no/such/path/pretty.xml" );
XMLTest( "Issue 302. Fail to save", "XML_ERROR_FILE_COULD_NOT_BE_OPENED", doc.ErrorName() );
doc.SaveFile( "./resources/out/compact.xml", true );
XMLTest( "Issue 302. Subsequent success in saving", "XML_SUCCESS", doc.ErrorName() );
}
{
// If a document fails to load then subsequent
// successful loads should clear the error
XMLDocument doc;
XMLTest( "Should be no error initially", false, doc.Error() );
doc.LoadFile( "resources/no-such-file.xml" );
XMLTest( "No such file - should fail", true, doc.Error() );
doc.LoadFile( "resources/dream.xml" );
XMLTest( "Error should be cleared", false, doc.Error() );
}
{
// Check that declarations are parsed only as the FirstChild
const char* xml0 = "<?xml version=\"1.0\" ?>"
" <!-- xml version=\"1.1\" -->"
"<first />";
const char* xml1 = "<?xml version=\"1.0\" ?>"
" <?xml version=\"1.1\" ?>"
"<first />";
const char* xml2 = "<first />"
"<?xml version=\"1.0\" ?>";
XMLDocument doc;
doc.Parse(xml0);
XMLTest("Test that the code changes do not affect normal parsing", doc.Error(), false);
doc.Parse(xml1);
XMLTest("Test that the second declaration throws an error", doc.ErrorID(), XML_ERROR_PARSING_DECLARATION);
doc.Parse(xml2);
XMLTest("Test that declaration after a child throws an error", doc.ErrorID(), XML_ERROR_PARSING_DECLARATION);
}
{
// No matter - before or after successfully parsing a text -
// calling XMLDocument::Value() causes an assert in debug.
const char* validXml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"
"<first />"
"<second />";
XMLDocument* doc = new XMLDocument();
XMLTest( "XMLDocument::Value() returns null?", NULL, doc->Value() );
doc->Parse( validXml );
XMLTest( "XMLDocument::Value() returns null?", NULL, doc->Value() );
delete doc;
}
{
XMLDocument doc;
for( int i = 0; i < XML_ERROR_COUNT; i++ ) {
doc.SetError( (XMLError)i, 0, 0 );
doc.ErrorName();
}
}
// ----------- Performance tracking --------------
{
#if defined( _MSC_VER )
__int64 start, end, freq;
QueryPerformanceFrequency( (LARGE_INTEGER*) &freq );
QueryPerformanceFrequency((LARGE_INTEGER*)&freq);
#endif
FILE* fp = fopen( "resources/dream.xml", "r" );
fseek( fp, 0, SEEK_END );
long size = ftell( fp );
fseek( fp, 0, SEEK_SET );
FILE* perfFP = fopen("resources/dream.xml", "r");
fseek(perfFP, 0, SEEK_END);
long size = ftell(fp);
fseek(perfFP, 0, SEEK_SET);
char* mem = new char[size+1];
fread( mem, size, 1, fp );
fclose( fp );
char* mem = new char[size + 1];
fread(mem, size, 1, perfFP);
fclose(perfFP);
mem[size] = 0;
#if defined( _MSC_VER )
QueryPerformanceCounter( (LARGE_INTEGER*) &start );
QueryPerformanceCounter((LARGE_INTEGER*)&start);
#else
clock_t cstart = clock();
#endif
static const int COUNT = 10;
for( int i=0; i<COUNT; ++i ) {
for (int i = 0; i < COUNT; ++i) {
XMLDocument doc;
doc.Parse( mem );
doc.Parse(mem);
}
#if defined( _MSC_VER )
QueryPerformanceCounter( (LARGE_INTEGER*) &end );
QueryPerformanceCounter((LARGE_INTEGER*)&end);
#else
clock_t cend = clock();
#endif
delete [] mem;
delete[] mem;
static const char* note =
#ifdef DEBUG
@@ -1405,20 +1652,18 @@ int main( int argc, const char ** argv )
#endif
#if defined( _MSC_VER )
printf( "\nParsing %s of dream.xml: %.3f milli-seconds\n", note, 1000.0 * (double)(end-start) / ( (double)freq * (double)COUNT) );
printf("\nParsing %s of dream.xml: %.3f milli-seconds\n", note, 1000.0 * (double)(end - start) / ((double)freq * (double)COUNT));
#else
printf( "\nParsing %s of dream.xml: %.3f milli-seconds\n", note, (double)(cend - cstart)/(double)COUNT );
printf("\nParsing %s of dream.xml: %.3f milli-seconds\n", note, (double)(cend - cstart) / (double)COUNT);
#endif
}
#if defined( _MSC_VER ) && defined( DEBUG )
_CrtMemCheckpoint( &endMemState );
//_CrtMemDumpStatistics( &endMemState );
_CrtMemState diffMemState;
_CrtMemDifference( &diffMemState, &startMemState, &endMemState );
_CrtMemDumpStatistics( &diffMemState );
//printf( "new total=%d\n", gNewTotal );
#endif
printf ("\nPass %d, Fail %d\n", gPass, gFail);