update the readme

This commit is contained in:
Lee Thomason
2018-04-06 15:49:47 -07:00
parent c1424ee4e1
commit 3cdaf8b15e

View File

@@ -63,40 +63,28 @@ TinyXML-1 vs. TinyXML-2
-----------------------
TinyXML-2 is now the focus of all development, well tested, and your
best choice unless you have a requirement to maintain TinyXML-1 code.
best choice between the two APIs. At this point, unless you are maintaining
legacy code, you should choose TinyXML-2.
TinyXML-2 uses a similar API to TinyXML-1 and the same
rich test cases. But the implementation of the parser is completely re-written
to make it more appropriate for use in a game. It uses less memory, is faster,
and uses far fewer memory allocations.
TinyXML-2 has no requirement for STL, but has also dropped all STL support. All
strings are query and set as 'const char*'. This allows the use of internal
allocators, and keeps the code much simpler.
Both parsers:
1. Simple to use with similar APIs.
2. DOM based parser.
3. UTF-8 Unicode support. http://en.wikipedia.org/wiki/UTF-8
Advantages of TinyXML-2
1. The focus of all future dev.
2. Many fewer memory allocation (1/10th to 1/100th), uses less memory
(about 40% of TinyXML-1), and faster.
3. No STL requirement.
4. More modern C++, including a proper namespace.
5. Proper and useful handling of whitespace
Advantages of TinyXML-1
1. Support for some C++ STL conventions: streams and strings
2. Very mature and well debugged code base.
TinyXML-2 has no requirement or support for STL. By returning `const char*`
TinyXML-2 can be much more efficient with memory usage. (TinyXML-1 did support
and use STL, but consumed much more memory for the DOM representation.)
Features
--------
### Code Page
TinyXML-2 uses UTF-8 exclusively when interpreting XML. All XML is assumed to
be UTF-8.
Filenames for loading / saving are passed unchanged to the underlying OS.
### Memory Model
An XMLDocument is a C++ object like any other, that can be on the stack, or
@@ -166,7 +154,7 @@ cannot be parsed correctly. In addition, all nodes (elements, declarations,
text, comments etc.) and attributes have a line number recorded as they are parsed.
This allows an application that performs additional validation of the parsed
XML document (e.g. application-implemented DTD validation) to report
line number information in it's errors.
line number information for error messages.
### Entities
@@ -275,10 +263,10 @@ There are 2 files in TinyXML-2:
And additionally a test file:
* xmltest.cpp
Simply compile and run. There is a visual studio 2015 project included, a simple Makefile,
Simply compile and run. There is a visual studio 2017 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.
The top of tinyxml.h even has a simple g++ command line if you are are Unix/Linuk/BSD and
don't want to use a build system.
Versioning
----------