Imported Upstream version 8.0.0 upstream/8.0.0
authorJinWang An <jinwang.an@samsung.com>
Fri, 30 Oct 2020 05:35:38 +0000 (14:35 +0900)
committerJinWang An <jinwang.an@samsung.com>
Fri, 30 Oct 2020 05:35:38 +0000 (14:35 +0900)
.gitignore
CMakeLists.txt
dox
readme.md
tinyxml2.cpp
tinyxml2.h
tinyxml2/test.vcxproj
tinyxml2/tinyxml2.vcxproj
xmltest.cpp

index 1456145e19fec3f847e8f01592fc7a0973e21ca6..3d324410a15e3b20fe3c1e210c14075d94405b3a 100644 (file)
@@ -18,3 +18,5 @@ tinyxml2/temp/
 *.o
 *.vc.db
 *.vc.opendb
+libtinyxml2.a
+xmltest
index 3eedc48332f7c641c8499c68db5814e810d5340d..9f9ab07cb85c6453183202188008f85231f31ecb 100644 (file)
@@ -21,8 +21,8 @@ include(CTest)
 ################################\r
 # set lib version here\r
 \r
-set(GENERIC_LIB_VERSION "7.1.0")\r
-set(GENERIC_LIB_SOVERSION "7")\r
+set(GENERIC_LIB_VERSION "8.0.0")\r
+set(GENERIC_LIB_SOVERSION "8")\r
 \r
 ################################\r
 # Add definitions\r
@@ -79,9 +79,15 @@ export(TARGETS tinyxml2
 \r
 install(TARGETS tinyxml2\r
         EXPORT ${CMAKE_PROJECT_NAME}Targets\r
-        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\r
-        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\r
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})\r
+        RUNTIME \r
+                DESTINATION ${CMAKE_INSTALL_BINDIR}\r
+                COMPONENT tinyxml2_runtime\r
+        LIBRARY \r
+                DESTINATION ${CMAKE_INSTALL_LIBDIR}\r
+                COMPONENT tinyxml2_libraries\r
+        ARCHIVE \r
+                DESTINATION ${CMAKE_INSTALL_LIBDIR}\r
+                COMPONENT tinyxml2_libraries)\r
 \r
 if(BUILD_TESTING AND BUILD_TESTS)\r
   add_executable(xmltest xmltest.cpp)\r
@@ -98,10 +104,10 @@ if(BUILD_TESTING AND BUILD_TESTS)
   add_test(NAME xmltest COMMAND xmltest WORKING_DIRECTORY $<TARGET_FILE_DIR:xmltest>)\r
 endif()\r
 \r
-install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})\r
+install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT tinyxml2_headers)\r
 \r
 configure_file(tinyxml2.pc.in tinyxml2.pc @ONLY)\r
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)\r
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT tinyxml2_config)\r
 \r
 # uninstall target\r
 if(NOT TARGET uninstall)\r
@@ -129,7 +135,9 @@ write_basic_package_version_file(
 install(FILES\r
         ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake\r
         ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake\r
-        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME})\r
+        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}\r
+        COMPONENT tinyxml2_config)\r
 \r
 install(EXPORT ${CMAKE_PROJECT_NAME}Targets NAMESPACE tinyxml2::\r
-        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME})\r
+        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}\r
+        COMPONENT tinyxml2_config)\r
diff --git a/dox b/dox
index d954a2065d02e6f457fbb2ac3eebe28497398e50..feebfba39ddee4d70bb298e2c1fa74f9993fdf3d 100644 (file)
--- a/dox
+++ b/dox
@@ -38,7 +38,7 @@ PROJECT_NAME           = "TinyXML-2"
 # could be handy for archiving the generated documentation or if some version\r
 # control system is used.\r
 \r
-PROJECT_NUMBER = 7.1.0\r
+PROJECT_NUMBER = 8.0.0\r
 \r
 # Using the PROJECT_BRIEF tag one can provide an optional one line description\r
 # for a project that appears at the top of each page and should give viewer a\r
index 7dad55d52298cc6fab43f93872194b3a729224bd..e9933aa577b2b1b1661e784f2ad1181016d013c8 100644 (file)
--- a/readme.md
+++ b/readme.md
@@ -262,11 +262,24 @@ There are 2 files in TinyXML-2:
 And additionally a test file:
 * xmltest.cpp
 
-Simply compile and run. There is a visual studio 2017 project included, a simple Makefile,
+Simply compile and run. There is a visual studio 2019 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 using Unix/Linux/BSD and
 don't want to use a build system.
 
+Building TinyXML-2 - Using vcpkg
+--------------------------------
+
+You can download and install TinyXML-2 using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
+
+    git clone https://github.com/Microsoft/vcpkg.git
+    cd vcpkg
+    ./bootstrap-vcpkg.sh
+    ./vcpkg integrate install
+    ./vcpkg install tinyxml2
+
+The TinyXML-2 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
+
 Versioning
 ----------
 
index 6b799171a99fcb138a05a6d84759f3875d736e77..9e7ff1a62ab5b8d534236f262c02625a6f34cde6 100755 (executable)
@@ -617,17 +617,17 @@ bool XMLUtil::ToBool( const char* str, bool* value )
         *value = (ival==0) ? false : true;\r
         return true;\r
     }\r
-    static const char* TRUE[] = { "true", "True", "TRUE", 0 };\r
-    static const char* FALSE[] = { "false", "False", "FALSE", 0 };\r
+    static const char* TRUE_VALS[] = { "true", "True", "TRUE", 0 };\r
+    static const char* FALSE_VALS[] = { "false", "False", "FALSE", 0 };\r
 \r
-    for (int i = 0; TRUE[i]; ++i) {\r
-        if (StringEqual(str, TRUE[i])) {\r
+    for (int i = 0; TRUE_VALS[i]; ++i) {\r
+        if (StringEqual(str, TRUE_VALS[i])) {\r
             *value = true;\r
             return true;\r
         }\r
     }\r
-    for (int i = 0; FALSE[i]; ++i) {\r
-        if (StringEqual(str, FALSE[i])) {\r
+    for (int i = 0; FALSE_VALS[i]; ++i) {\r
+        if (StringEqual(str, FALSE_VALS[i])) {\r
             *value = false;\r
             return true;\r
         }\r
@@ -1961,6 +1961,39 @@ XMLAttribute* XMLElement::CreateAttribute()
     return attrib;\r
 }\r
 \r
+\r
+XMLElement* XMLElement::InsertNewChildElement(const char* name)\r
+{\r
+    XMLElement* node = _document->NewElement(name);\r
+    return InsertEndChild(node) ? node : 0;\r
+}\r
+\r
+XMLComment* XMLElement::InsertNewComment(const char* comment)\r
+{\r
+    XMLComment* node = _document->NewComment(comment);\r
+    return InsertEndChild(node) ? node : 0;\r
+}\r
+\r
+XMLText* XMLElement::InsertNewText(const char* text)\r
+{\r
+    XMLText* node = _document->NewText(text);\r
+    return InsertEndChild(node) ? node : 0;\r
+}\r
+\r
+XMLDeclaration* XMLElement::InsertNewDeclaration(const char* text)\r
+{\r
+    XMLDeclaration* node = _document->NewDeclaration(text);\r
+    return InsertEndChild(node) ? node : 0;\r
+}\r
+\r
+XMLUnknown* XMLElement::InsertNewUnknown(const char* text)\r
+{\r
+    XMLUnknown* node = _document->NewUnknown(text);\r
+    return InsertEndChild(node) ? node : 0;\r
+}\r
+\r
+\r
+\r
 //\r
 //     <ele></ele>\r
 //     <ele>foo<b>bar</b></ele>\r
@@ -2101,7 +2134,7 @@ XMLDocument::~XMLDocument()
 }\r
 \r
 \r
-void XMLDocument::MarkInUse(XMLNode* node)\r
+void XMLDocument::MarkInUse(const XMLNode* const node)\r
 {\r
        TIXMLASSERT(node);\r
        TIXMLASSERT(node->_parent == 0);\r
@@ -2635,8 +2668,6 @@ void XMLPrinter::OpenElement( const char* name, bool compactMode )
 \r
     if ( _textDepth < 0 && !_firstElement && !compactMode ) {\r
         Putc( '\n' );\r
-    }\r
-    if ( !compactMode ) {\r
         PrintSpace( _depth );\r
     }\r
 \r
index a432f7ee70b90b8b6e4bce74caedaed36f8a2e52..1beadaa543e85ed842837026a000e4de6e2cb719 100755 (executable)
@@ -98,12 +98,12 @@ distribution.
 /* Versioning, past 1.0.14:\r
        http://semver.org/\r
 */\r
-static const int TIXML2_MAJOR_VERSION = 7;\r
-static const int TIXML2_MINOR_VERSION = 1;\r
+static const int TIXML2_MAJOR_VERSION = 8;\r
+static const int TIXML2_MINOR_VERSION = 0;\r
 static const int TIXML2_PATCH_VERSION = 0;\r
 \r
-#define TINYXML2_MAJOR_VERSION 7\r
-#define TINYXML2_MINOR_VERSION 1\r
+#define TINYXML2_MAJOR_VERSION 8\r
+#define TINYXML2_MINOR_VERSION 0\r
 #define TINYXML2_PATCH_VERSION 0\r
 \r
 // A fixed element depth limit is problematic. There needs to be a\r
@@ -562,7 +562,7 @@ public:
         TIXMLASSERT( p );\r
         return p;\r
     }\r
-    static char* SkipWhiteSpace( char* p, int* curLineNumPtr )                         {\r
+    static char* SkipWhiteSpace( char* const p, int* curLineNumPtr ) {\r
         return const_cast<char*>( SkipWhiteSpace( const_cast<const char*>(p), curLineNumPtr ) );\r
     }\r
 \r
@@ -600,7 +600,7 @@ public:
         return strncmp( p, q, nChar ) == 0;\r
     }\r
 \r
-    inline static bool IsUTF8Continuation( char p ) {\r
+    inline static bool IsUTF8Continuation( const char p ) {\r
         return ( p & 0x80 ) != 0;\r
     }\r
 \r
@@ -1640,7 +1640,22 @@ public:
        /// See QueryIntText()\r
        double DoubleText(double defaultValue = 0) const;\r
        /// See QueryIntText()\r
-       float FloatText(float defaultValue = 0) const;\r
+    float FloatText(float defaultValue = 0) const;\r
+\r
+    /**\r
+        Convenience method to create a new XMLElement and add it as last (right)\r
+        child of this node. Returns the created and inserted element.\r
+    */\r
+    XMLElement* InsertNewChildElement(const char* name);\r
+    /// See InsertNewChildElement()\r
+    XMLComment* InsertNewComment(const char* comment);\r
+    /// See InsertNewChildElement()\r
+    XMLText* InsertNewText(const char* text);\r
+    /// See InsertNewChildElement()\r
+    XMLDeclaration* InsertNewDeclaration(const char* text);\r
+    /// See InsertNewChildElement()\r
+    XMLUnknown* InsertNewUnknown(const char* text);\r
+\r
 \r
     // internal:\r
     enum ElementClosingType {\r
@@ -1894,7 +1909,7 @@ public:
     char* Identify( char* p, XMLNode** node );\r
 \r
        // internal\r
-       void MarkInUse(XMLNode*);\r
+       void MarkInUse(const XMLNode* const);\r
 \r
     virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const   {\r
         return 0;\r
index 02bec853fc4618df952bb85469f9085f12455148..df15660052f52eefd986aa5ff2ee5243a4431b8f 100644 (file)
   <PropertyGroup Label="Globals">\r
     <ProjectGuid>{E8FB2712-8666-4662-A5B8-2B5B0FB1A260}</ProjectGuid>\r
     <RootNamespace>test</RootNamespace>\r
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>\r
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
     <CharacterSet>Unicode</CharacterSet>\r
index 5a7b7ee0e0b2a87bc9816d7f3e6977af0512b7cd..4e34f976a547b4db597ad309eca85845bb856dea 100755 (executable)
     <ProjectGuid>{D1C528B6-AA02-4D29-9D61-DC08E317A70D}</ProjectGuid>\r
     <Keyword>Win32Proj</Keyword>\r
     <RootNamespace>tinyxml2</RootNamespace>\r
-    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>\r
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'" Label="Configuration">\r
     <ConfigurationType>DynamicLibrary</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'" Label="Configuration">\r
     <ConfigurationType>DynamicLibrary</ConfigurationType>\r
     <UseDebugLibraries>true</UseDebugLibraries>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'" Label="Configuration">\r
     <ConfigurationType>DynamicLibrary</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'" Label="Configuration">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'" Label="Configuration">\r
     <ConfigurationType>DynamicLibrary</ConfigurationType>\r
     <UseDebugLibraries>false</UseDebugLibraries>\r
     <WholeProgramOptimization>true</WholeProgramOptimization>\r
     <CharacterSet>Unicode</CharacterSet>\r
-    <PlatformToolset>v141</PlatformToolset>\r
+    <PlatformToolset>v142</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
     <ConfigurationType>StaticLibrary</ConfigurationType>\r
index 5a075472b93df292d5b0a20453ca8bf89550b5bb..adcba6de61dc3d1998bd34e5f1122dac27479ed6 100755 (executable)
@@ -968,8 +968,8 @@ int main( int argc, const char ** argv )
                        printer.PushAttribute("attrib-int", int(1));\r
                        printer.PushAttribute("attrib-unsigned", unsigned(2));\r
                        printer.PushAttribute("attrib-int64", int64_t(3));\r
-            printer.PushAttribute("attrib-uint64", uint64_t(37));\r
-            printer.PushAttribute("attrib-bool", true);\r
+                       printer.PushAttribute("attrib-uint64", uint64_t(37));\r
+                       printer.PushAttribute("attrib-bool", true);\r
                        printer.PushAttribute("attrib-double", 4.0);\r
                        printer.CloseElement();\r
                        fclose(printerfp);\r
@@ -989,14 +989,111 @@ int main( int argc, const char ** argv )
                        XMLTest("attrib-unsigned", unsigned(2), attrib->UnsignedValue(), true);\r
                        attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-int64");\r
                        XMLTest("attrib-int64", int64_t(3), attrib->Int64Value(), true);\r
-            attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-uint64");\r
-            XMLTest("attrib-uint64", uint64_t(37), attrib->Unsigned64Value(), true);\r
-            attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-bool");\r
+                       attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-uint64");\r
+                       XMLTest("attrib-uint64", uint64_t(37), attrib->Unsigned64Value(), true);\r
+                       attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-bool");\r
                        XMLTest("attrib-bool", true, attrib->BoolValue(), true);\r
                        attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-double");\r
                        XMLTest("attrib-double", 4.0, attrib->DoubleValue(), true);\r
                }\r
+               // Add API_testcatse :PushDeclaration();PushText();PushComment()\r
+               {\r
+                       FILE* fp1 = fopen("resources/out/printer_1.xml", "w");\r
+                       XMLPrinter printer(fp1);\r
+\r
+                       printer.PushDeclaration("version = '1.0' enconding = 'utf-8'");\r
+\r
+                       printer.OpenElement("foo");\r
+                       printer.PushAttribute("attrib-text", "text");\r
+\r
+                       printer.OpenElement("text");\r
+                       printer.PushText("Tinyxml2");\r
+                       printer.CloseElement();\r
+\r
+                       printer.OpenElement("int");\r
+                       printer.PushText(int(11));\r
+                       printer.CloseElement();\r
+\r
+                       printer.OpenElement("unsigned");\r
+                       printer.PushText(unsigned(12));\r
+                       printer.CloseElement();\r
+\r
+                       printer.OpenElement("int64_t");\r
+                       printer.PushText(int64_t(13));\r
+                       printer.CloseElement();\r
+\r
+                       printer.OpenElement("uint64_t");\r
+                       printer.PushText(uint64_t(14));\r
+                       printer.CloseElement();\r
+\r
+                       printer.OpenElement("bool");\r
+                       printer.PushText(true);\r
+                       printer.CloseElement();\r
+\r
+                       printer.OpenElement("float");\r
+                       printer.PushText("1.56");\r
+                       printer.CloseElement();\r
+\r
+                       printer.OpenElement("double");\r
+                       printer.PushText("12.12");\r
+                       printer.CloseElement();\r
 \r
+                       printer.OpenElement("comment");\r
+                       printer.PushComment("this is Tinyxml2");\r
+                       printer.CloseElement();\r
+\r
+                       printer.CloseElement();\r
+                       fclose(fp1);\r
+               }\r
+               {\r
+                       XMLDocument doc;\r
+                       doc.LoadFile("resources/out/printer_1.xml");\r
+                       XMLTest("XMLPrinter Stream mode: load", XML_SUCCESS, doc.ErrorID(), true);\r
+\r
+                       const XMLDocument& cdoc = doc;\r
+\r
+                       const  XMLElement* root = cdoc.FirstChildElement("foo");\r
+\r
+                       const char* text_value;\r
+                       text_value = root->FirstChildElement("text")->GetText();\r
+                       XMLTest("PushText( const char* text, bool cdata=false ) test", "Tinyxml2", text_value);\r
+\r
+                       int  int_value;\r
+                       int_value = root->FirstChildElement("int")->IntText();\r
+                       XMLTest("PushText( int value ) test", 11, int_value);\r
+\r
+                       unsigned  unsigned_value;\r
+                       unsigned_value = root->FirstChildElement("unsigned")->UnsignedText();\r
+                       XMLTest("PushText( unsigned value ) test", (unsigned)12, unsigned_value);\r
+\r
+                       int64_t  int64_t_value;\r
+                       int64_t_value = root->FirstChildElement("int64_t")->Int64Text();\r
+                       XMLTest("PushText( int64_t value ) test", (int64_t) 13, int64_t_value);\r
+\r
+                       uint64_t uint64_t_value;\r
+                       uint64_t_value = root->FirstChildElement("uint64_t")->Unsigned64Text();\r
+                       XMLTest("PushText( uint64_t value ) test", (uint64_t) 14, uint64_t_value);\r
+\r
+                       float  float_value;\r
+                       float_value = root->FirstChildElement("float")->FloatText();\r
+                       XMLTest("PushText( float value ) test", 1.56f, float_value);\r
+\r
+                       double double_value;\r
+                       double_value = root->FirstChildElement("double")->DoubleText();\r
+                       XMLTest("PushText( double value ) test", 12.12, double_value);\r
+\r
+                       bool bool_value;\r
+                       bool_value = root->FirstChildElement("bool")->BoolText();\r
+                       XMLTest("PushText( bool value ) test", true, bool_value);\r
+\r
+                       const XMLComment* comment = root->FirstChildElement("comment")->FirstChild()->ToComment();\r
+                       const char* comment_value = comment->Value();\r
+                       XMLTest("PushComment() test", "this is Tinyxml2", comment_value);\r
+\r
+                       const XMLDeclaration* declaration = cdoc.FirstChild()->ToDeclaration();\r
+                       const char* declaration_value = declaration->Value();\r
+                       XMLTest("PushDeclaration() test", "version = '1.0' enconding = 'utf-8'", declaration_value);\r
+               }\r
        }\r
 \r
 \r
@@ -1290,7 +1387,7 @@ int main( int argc, const char ** argv )
        }\r
 \r
        {\r
-               // trying to repro ]1874301]. If it doesn't go into an infinite loop, all is well.\r
+               // trying to repro [1874301]. If it doesn't go into an infinite loop, all is well.\r
                unsigned char buf[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?><feed><![CDATA[Test XMLblablablalblbl";\r
                buf[60] = 239;\r
                buf[61] = 0;\r