mirror of https://github.com/AxioDL/tinyxml2.git
moving xmls and txts to the resources folder.
This commit is contained in:
parent
f68c438ee2
commit
a2d4e6e943
11
utf8test.xml
11
utf8test.xml
|
@ -1,11 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<document>
|
|
||||||
<English name="name" value="value">The world has many languages</English>
|
|
||||||
<Russian name="название(имя)" value="ценность">Мир имеет много языков</Russian>
|
|
||||||
<Spanish name="el nombre" value="el valor">el mundo tiene muchos idiomas</Spanish>
|
|
||||||
<SimplifiedChinese name="名字" value="价值">世界有很多语言</SimplifiedChinese>
|
|
||||||
<Русский название="name" ценность="value"><имеет></Русский>
|
|
||||||
<汉语 名字="name" 价值="value">世界有很多语言</汉语>
|
|
||||||
<Heavy>"Mëtæl!"</Heavy>
|
|
||||||
<ä>Umlaut Element</ä>
|
|
||||||
</document>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<document>
|
|
||||||
<English name="name" value="value">The world has many languages</English>
|
|
||||||
<Russian name="название(имя)" value="ценность">Мир имеет много языков</Russian>
|
|
||||||
<Spanish name="el nombre" value="el valor">el mundo tiene muchos idiomas</Spanish>
|
|
||||||
<SimplifiedChinese name="名字" value="价值">世界有很多语言</SimplifiedChinese>
|
|
||||||
<Русский название="name" ценность="value"><имеет></Русский>
|
|
||||||
<汉语 名字="name" 价值="value">世界有很多语言</汉语>
|
|
||||||
<Heavy>"Mëtæl!"</Heavy>
|
|
||||||
<ä>Umlaut Element</ä>
|
|
||||||
</document>
|
|
28
xmltest.cpp
28
xmltest.cpp
|
@ -75,7 +75,7 @@ void NullLineEndings( char* p )
|
||||||
int example_1()
|
int example_1()
|
||||||
{
|
{
|
||||||
XMLDocument doc;
|
XMLDocument doc;
|
||||||
doc.LoadFile( "dream.xml" );
|
doc.LoadFile( "resources/dream.xml" );
|
||||||
|
|
||||||
return doc.ErrorID();
|
return doc.ErrorID();
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FILE* fp = fopen( "dream.xml", "r" );
|
FILE* fp = fopen( "resources/dream.xml", "r" );
|
||||||
if ( !fp ) {
|
if ( !fp ) {
|
||||||
printf( "Error opening test file 'dream.xml'.\n"
|
printf( "Error opening test file 'dream.xml'.\n"
|
||||||
"Is your working directory the same as where \n"
|
"Is your working directory the same as where \n"
|
||||||
|
@ -260,9 +260,9 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
// XML2 : 469,073 bytes in 323 allocations
|
// XML2 : 469,073 bytes in 323 allocations
|
||||||
//int newStart = gNew;
|
//int newStart = gNew;
|
||||||
XMLDocument doc;
|
XMLDocument doc;
|
||||||
doc.LoadFile( "dream.xml" );
|
doc.LoadFile( "resources/dream.xml" );
|
||||||
|
|
||||||
doc.SaveFile( "dreamout.xml" );
|
doc.SaveFile( "resources/dreamout.xml" );
|
||||||
doc.PrintError();
|
doc.PrintError();
|
||||||
|
|
||||||
XMLTest( "Dream", "xml version=\"1.0\"",
|
XMLTest( "Dream", "xml version=\"1.0\"",
|
||||||
|
@ -276,7 +276,7 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
doc.LastChild()->LastChild()->LastChild()->LastChild()->LastChildElement()->GetText() );
|
doc.LastChild()->LastChild()->LastChild()->LastChild()->LastChildElement()->GetText() );
|
||||||
|
|
||||||
XMLDocument doc2;
|
XMLDocument doc2;
|
||||||
doc2.LoadFile( "dreamout.xml" );
|
doc2.LoadFile( "resources/dreamout.xml" );
|
||||||
XMLTest( "Dream-out", "xml version=\"1.0\"",
|
XMLTest( "Dream-out", "xml version=\"1.0\"",
|
||||||
doc2.FirstChild()->ToDeclaration()->Value() );
|
doc2.FirstChild()->ToDeclaration()->Value() );
|
||||||
XMLTest( "Dream-out", true, doc2.FirstChild()->NextSibling()->ToUnknown() ? true : false );
|
XMLTest( "Dream-out", true, doc2.FirstChild()->NextSibling()->ToUnknown() ? true : false );
|
||||||
|
@ -352,7 +352,7 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
|
|
||||||
{
|
{
|
||||||
XMLDocument doc;
|
XMLDocument doc;
|
||||||
doc.LoadFile( "utf8test.xml" );
|
doc.LoadFile( "resources/utf8test.xml" );
|
||||||
|
|
||||||
// Get the attribute "value" from the "Russian" element and check it.
|
// Get the attribute "value" from the "Russian" element and check it.
|
||||||
XMLElement* element = doc.FirstChildElement( "document" )->FirstChildElement( "Russian" );
|
XMLElement* element = doc.FirstChildElement( "document" )->FirstChildElement( "Russian" );
|
||||||
|
@ -373,7 +373,7 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
text->Value() );
|
text->Value() );
|
||||||
|
|
||||||
// Now try for a round trip.
|
// Now try for a round trip.
|
||||||
doc.SaveFile( "utf8testout.xml" );
|
doc.SaveFile( "resources/utf8testout.xml" );
|
||||||
|
|
||||||
// Check the round trip.
|
// Check the round trip.
|
||||||
char savedBuf[256];
|
char savedBuf[256];
|
||||||
|
@ -385,8 +385,8 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
#pragma warning ( push )
|
#pragma warning ( push )
|
||||||
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
||||||
#endif
|
#endif
|
||||||
FILE* saved = fopen( "utf8testout.xml", "r" );
|
FILE* saved = fopen( "resources/utf8testout.xml", "r" );
|
||||||
FILE* verify = fopen( "utf8testverify.xml", "r" );
|
FILE* verify = fopen( "resources/utf8testverify.xml", "r" );
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#pragma warning ( pop )
|
#pragma warning ( pop )
|
||||||
#endif
|
#endif
|
||||||
|
@ -506,7 +506,7 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
#pragma warning ( push )
|
#pragma warning ( push )
|
||||||
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
||||||
#endif
|
#endif
|
||||||
FILE* textfile = fopen( "textfile.txt", "w" );
|
FILE* textfile = fopen( "resources/textfile.txt", "w" );
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#pragma warning ( pop )
|
#pragma warning ( pop )
|
||||||
#endif
|
#endif
|
||||||
|
@ -520,7 +520,7 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
#pragma warning ( push )
|
#pragma warning ( push )
|
||||||
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
||||||
#endif
|
#endif
|
||||||
textfile = fopen( "textfile.txt", "r" );
|
textfile = fopen( "resources/textfile.txt", "r" );
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#pragma warning ( pop )
|
#pragma warning ( pop )
|
||||||
#endif
|
#endif
|
||||||
|
@ -589,9 +589,9 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
|
|
||||||
XMLDocument doc;
|
XMLDocument doc;
|
||||||
doc.Parse( doctype );
|
doc.Parse( doctype );
|
||||||
doc.SaveFile( "test7.xml" );
|
doc.SaveFile( "resources/test7.xml" );
|
||||||
doc.DeleteChild( doc.RootElement() );
|
doc.DeleteChild( doc.RootElement() );
|
||||||
doc.LoadFile( "test7.xml" );
|
doc.LoadFile( "resources/test7.xml" );
|
||||||
doc.Print();
|
doc.Print();
|
||||||
|
|
||||||
const XMLUnknown* decl = doc.FirstChild()->NextSibling()->ToUnknown();
|
const XMLUnknown* decl = doc.FirstChild()->NextSibling()->ToUnknown();
|
||||||
|
@ -838,7 +838,7 @@ int main( int /*argc*/, const char ** /*argv*/ )
|
||||||
#pragma warning ( push )
|
#pragma warning ( push )
|
||||||
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
||||||
#endif
|
#endif
|
||||||
FILE* fp = fopen( "dream.xml", "r" );
|
FILE* fp = fopen( "resources/dream.xml", "r" );
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#pragma warning ( pop )
|
#pragma warning ( pop )
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue