TinyXml: Main Page

  • Main Page
  • Namespaces
  • Classes
  • Files
  • Related Pages

TinyXml Documentation

2.5.3

TinyXML

TinyXML is a simple, small, C++ XML parser that can be easily integrated into other programs.

What it does.

In brief, TinyXML parses an XML document, and builds from that a Document Object Model (DOM) that can be read, modified, and saved.

XML stands for "eXtensible Markup Language." It allows you to create your own document markups. Where HTML does a very good job of marking documents for browsers, XML allows you to define any kind of document markup, for example a document that describes a "to do" list for an organizer application. XML is a very structured and convenient format. All those random file formats created to store application data can all be replaced with XML. One parser for everything.

The best place for the complete, correct, and quite frankly hard to read spec is at http://www.w3.org/TR/2004/REC-xml-20040204/. An intro to XML (that I really like) can be found at http://skew.org/xml/tutorial.

There are different ways to access and interact with XML data. TinyXML uses a Document Object Model (DOM), meaning the XML data is parsed into a C++ objects that can be browsed and manipulated, and then written to disk or another output stream. You can also construct an XML document from scratch with C++ objects and write this to disk or another output stream.

TinyXML is designed to be easy and fast to learn. It is two headers and four cpp files. Simply add these to your project and off you go. There is an example file - xmltest.cpp - to get you started.

TinyXML is released under the ZLib license, so you can use it in open source or commercial code. The details of the license are at the top of every source file.

TinyXML attempts to be a flexible parser, but with truly correct and compliant XML output. TinyXML should compile on any reasonably C++ compliant system. It does not rely on exceptions or RTTI. It can be compiled with or without STL support. TinyXML fully supports the UTF-8 encoding, and the first 64k character entities.

What it doesn't do.

TinyXML doesn't parse or use DTDs (Document Type Definitions) or XSLs (eXtensible Stylesheet Language.) There are other parsers out there (check out www.sourceforge.org, search for XML) that are much more fully featured. But they are also much bigger, take longer to set up in your project, have a higher learning curve, and often have a more restrictive license. If you are working with browsers or have more complete XML needs, TinyXML is not the parser for you.

The following DTD syntax will not parse at this time in TinyXML:

    <!DOCTYPE Archiv [
     <!ELEMENT Comment (#PCDATA)>
    ]>

because TinyXML sees this as a !DOCTYPE node with an illegally embedded !ELEMENT node. This may be addressed in the future.

Tutorials.

For the impatient, here are some tutorials to get you going. A great way to get started, but it is worth your time to read this (very short) manual completely.

  • TinyXML++ Tutorial
  • TinyXML Tutorial

Code Status.

TinyXML is mature, tested code. It is very stable. If you find bugs, please file a bug report on the sourceforge web site (www.sourceforge.net/projects/tinyxml). We'll get them straightened out as soon as possible.

There are some areas of improvement; please check sourceforge if you are interested in working on TinyXML.

Related Projects

TinyXML projects you may find useful! (Descriptions provided by the projects.)

  • TinyXPath (http://tinyxpath.sourceforge.net). TinyXPath is a small footprint XPath syntax decoder, written in C++.
  • TinyXML++ (http://code.google.com/p/ticpp/). TinyXML++ is a completely new interface to TinyXML that uses MANY of the C++ strengths. Templates, exceptions, and much better error handling.

Features

Using STL

TinyXML can be compiled to use or not use STL. When using STL, TinyXML uses the std::string class, and fully supports std::istream, std::ostream, operator<<, and operator>>. Many API methods have both 'const char*' and 'const std::string&' forms.

When STL support is compiled out, no STL files are included whatsoever. All the string classes are implemented by TinyXML itself. API methods all use the 'const char*' form for input.

Use the compile time define:

TIXML_USE_STL

to compile one version or the other. This can be passed by the compiler, or set as the first line of "tinyxml.h".

Note: If compiling the test code in Linux, setting the environment variable TINYXML_USE_STL=YES/NO will control STL compilation. In the Windows project file, STL and non STL targets are provided. In your project, It's probably easiest to add the line "#define TIXML_USE_STL" as the first line of tinyxml.h.

UTF-8

TinyXML supports UTF-8 allowing to manipulate XML files in any language. TinyXML also supports "legacy mode" - the encoding used before UTF-8 support and probably best described as "extended ascii".

Normally, TinyXML will try to detect the correct encoding and use it. However, by setting the value of TIXML_DEFAULT_ENCODING in the header file, TinyXML can be forced to always use one encoding.

TinyXML will assume Legacy Mode until one of the following occurs:

  1. If the non-standard but common "UTF-8 lead bytes" (0xef 0xbb 0xbf) begin the file or data stream, TinyXML will read it as UTF-8.
  2. If the declaration tag is read, and it has an encoding="UTF-8", then TinyXML will read it as UTF-8.
  3. If the declaration tag is read, and it has no encoding specified, then TinyXML will read it as UTF-8.
  4. If the declaration tag is read, and it has an encoding="something else", then TinyXML will read it as Legacy Mode. In legacy mode, TinyXML will work as it did before. It's not clear what that mode does exactly, but old content should keep working.
  5. Until one of the above criteria is met, TinyXML runs in Legacy Mode.

What happens if the encoding is incorrectly set or detected? TinyXML will try to read and pass through text seen as improperly encoded. You may get some strange results or mangled characters. You may want to force TinyXML to the correct mode.

You may force TinyXML to Legacy Mode by using LoadFile( TIXML_ENCODING_LEGACY ) or LoadFile( filename, TIXML_ENCODING_LEGACY ). You may force it to use legacy mode all the time by setting TIXML_DEFAULT_ENCODING = TIXML_ENCODING_LEGACY. Likewise, you may force it to TIXML_ENCODING_UTF8 with the same technique.

For English users, using English XML, UTF-8 is the same as low-ASCII. You don't need to be aware of UTF-8 or change your code in any way. You can think of UTF-8 as a "superset" of ASCII.

UTF-8 is not a double byte format - but it is a standard encoding of Unicode! TinyXML does not use or directly support wchar, TCHAR, or Microsoft's _UNICODE at this time. It is common to see the term "Unicode" improperly refer to UTF-16, a wide byte encoding of unicode. This is a source of confusion.

For "high-ascii" languages - everything not English, pretty much - TinyXML can handle all languages, at the same time, as long as the XML is encoded in UTF-8. That can be a little tricky, older programs and operating systems tend to use the "default" or "traditional" code page. Many apps (and almost all modern ones) can output UTF-8, but older or stubborn (or just broken) ones still output text in the default code page.

For example, Japanese systems traditionally use SHIFT-JIS encoding. Text encoded as SHIFT-JIS can not be read by TinyXML. A good text editor can import SHIFT-JIS and then save as UTF-8.

The Skew.org link does a great job covering the encoding issue.

The test file "utf8test.xml" is an XML containing English, Spanish, Russian, and Simplified Chinese. (Hopefully they are translated correctly). The file "utf8test.gif" is a screen capture of the XML file, rendered in IE. Note that if you don't have the correct fonts (Simplified Chinese or Russian) on your system, you won't see output that matches the GIF file even if you can parse it correctly. Also note that (at least on my Windows machine) console output is in a Western code page, so that Print() or printf() cannot correctly display the file. This is not a bug in TinyXML - just an OS issue. No data is lost or destroyed by TinyXML. The console just doesn't render UTF-8.

Entities

TinyXML recognizes the pre-defined "character entities", meaning special characters. Namely:

    &amp;	&
    &lt;	<
    &gt;	>
    &quot;	"
    &apos;	'

These are recognized when the XML document is read, and translated to there UTF-8 equivalents. For instance, text with the XML of:

    Far &amp; Away

will have the Value() of "Far & Away" when queried from the TiXmlText object, and will be written back to the XML stream/file as an ampersand. Older versions of TinyXML "preserved" character entities, but the newer versions will translate them into characters.

Additionally, any character can be specified by its Unicode code point: The syntax "&#xA0;" or "&#160;" are both to the non-breaking space characher.

Printing

TinyXML can print output in several different ways that all have strengths and limitations.

  • Print( FILE* ). Output to a std-C stream, which includes all C files as well as stdout.
    • "Pretty prints", but you don't have control over printing options.
    • The output is streamed directly to the FILE object, so there is no memory overhead in the TinyXML code.
    • used by Print() and SaveFile()

  • operator<<. Output to a c++ stream.
    • Integrates with standart C++ iostreams.
    • Outputs in "network printing" mode without line breaks. Good for network transmission and moving XML between C++ objects, but hard for a human to read.

  • TiXmlPrinter. Output to a std::string or memory buffer.
    • API is less concise
    • Future printing options will be put here.
    • Printing may change slightly in future versions as it is refined and expanded.

Streams

With TIXML_USE_STL on TinyXML supports C++ streams (operator <<,>>) streams as well as C (FILE*) streams. There are some differences that you may need to be aware of.

C style output:

  • based on FILE*
  • the Print() and SaveFile() methods

Generates formatted output, with plenty of white space, intended to be as human-readable as possible. They are very fast, and tolerant of ill formed XML documents. For example, an XML document that contains 2 root elements and 2 declarations, will still print.

C style input:

  • based on FILE*
  • the Parse() and LoadFile() methods

A fast, tolerant read. Use whenever you don't need the C++ streams.

C++ style output:

  • based on std::ostream
  • operator<<

Generates condensed output, intended for network transmission rather than readability. Depending on your system's implementation of the ostream class, these may be somewhat slower. (Or may not.) Not tolerant of ill formed XML: a document should contain the correct one root element. Additional root level elements will not be streamed out.

C++ style input:

  • based on std::istream
  • operator>>

Reads XML from a stream, making it useful for network transmission. The tricky part is knowing when the XML document is complete, since there will almost certainly be other data in the stream. TinyXML will assume the XML data is complete after it reads the root element. Put another way, documents that are ill-constructed with more than one root element will not read correctly. Also note that operator>> is somewhat slower than Parse, due to both implementation of the STL and limitations of TinyXML.

White space

The world simply does not agree on whether white space should be kept, or condensed. For example, pretend the '_' is a space, and look at "Hello____world". HTML, and at least some XML parsers, will interpret this as "Hello_world". They condense white space. Some XML parsers do not, and will leave it as "Hello____world". (Remember to keep pretending the _ is a space.) Others suggest that __Hello___world__ should become Hello___world.

It's an issue that hasn't been resolved to my satisfaction. TinyXML supports the first 2 approaches. Call TiXmlBase::SetCondenseWhiteSpace( bool ) to set the desired behavior. The default is to condense white space.

If you change the default, you should call TiXmlBase::SetCondenseWhiteSpace( bool ) before making any calls to Parse XML data, and I don't recommend changing it after it has been set.

Handles

Where browsing an XML document in a robust way, it is important to check for null returns from method calls. An error safe implementation can generate a lot of code like:

TiXmlElement* root = document.FirstChildElement( "Document" );
if ( root )
{
    TiXmlElement* element = root->FirstChildElement( "Element" );
    if ( element )
    {
        TiXmlElement* child = element->FirstChildElement( "Child" );
        if ( child )
        {
            TiXmlElement* child2 = child->NextSiblingElement( "Child" );
            if ( child2 )
            {
                // Finally do something useful.

Handles have been introduced to clean this up. Using the TiXmlHandle class, the previous code reduces to:

TiXmlHandle docHandle( &document );
TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement();
if ( child2 )
{
    // do something useful

Which is much easier to deal with. See TiXmlHandle for more information.

Row and Column tracking

Being able to track nodes and attributes back to their origin location in source files can be very important for some applications. Additionally, knowing where parsing errors occured in the original source can be very time saving.

TinyXML can tracks the row and column origin of all nodes and attributes in a text file. The TiXmlBase::Row() and TiXmlBase::Column() methods return the origin of the node in the source text. The correct tabs can be configured in TiXmlDocument::SetTabSize().

Using and Installing

To Compile and Run xmltest:

A Linux Makefile and a Windows Visual C++ .dsw file is provided. Simply compile and run. It will write the file demotest.xml to your disk and generate output on the screen. It also tests walking the DOM by printing out the number of nodes found using different techniques.

The Linux makefile is very generic and runs on many systems - it is currently tested on mingw and MacOSX. You do not need to run 'make depend'. The dependecies have been hard coded.

Windows project file for VC6

  • tinyxml: tinyxml library, non-STL
  • tinyxmlSTL: tinyxml library, STL
  • tinyXmlTest: test app, non-STL
  • tinyXmlTestSTL: test app, STL

Makefile

At the top of the makefile you can set:

PROFILE, DEBUG, and TINYXML_USE_STL. Details (such that they are) are in the makefile.

In the tinyxml directory, type "make clean" then "make". The executable file 'xmltest' will be created.

To Use in an Application:

Add tinyxml.cpp, tinyxml.h, tinyxmlerror.cpp, tinyxmlparser.cpp, tinystr.cpp, and tinystr.h to your project or make file. That's it! It should compile on any reasonably compliant C++ system. You do not need to enable exceptions or RTTI for TinyXML.

How TinyXML works.

An example is probably the best way to go. Take:

    <?xml version="1.0" standalone=no>
    <!-- Our to do list data -->
    <ToDo>
        <Item priority="1"> Go to the <bold>Toy store!</bold></Item>
        <Item priority="2"> Do bills</Item>
    </ToDo>

Its not much of a To Do list, but it will do. To read this file (say "demo.xml") you would create a document, and parse it in:

    TiXmlDocument doc( "demo.xml" );
    doc.LoadFile();

And its ready to go. Now lets look at some lines and how they relate to the DOM.

<?xml version="1.0" standalone=no>

The first line is a declaration, and gets turned into the TiXmlDeclaration class. It will be the first child of the document node.

This is the only directive/special tag parsed by by TinyXML. Generally directive tags are stored in TiXmlUnknown so the commands wont be lost when it is saved back to disk.

<!-- Our to do list data -->

A comment. Will become a TiXmlComment object.

<ToDo>

The "ToDo" tag defines a TiXmlElement object. This one does not have any attributes, but does contain 2 other elements.

<Item priority="1">

Creates another TiXmlElement which is a child of the "ToDo" element. This element has 1 attribute, with the name "priority" and the value "1".

Go to the

A TiXmlText. This is a leaf node and cannot contain other nodes. It is a child of the "Item" TiXmlElement.

<bold>

Another TiXmlElement, this one a child of the "Item" element.

Etc.

Looking at the entire object tree, you end up with:

TiXmlDocument					"demo.xml"
    TiXmlDeclaration			"version='1.0'" "standalone=no"
    TiXmlComment				" Our to do list data"
    TiXmlElement				"ToDo"
        TiXmlElement			"Item" Attribtutes: priority = 1
            TiXmlText			"Go to the "
            TiXmlElement		"bold"
                TiXmlText		"Toy store!"
        TiXmlElement			"Item" Attributes: priority=2
            TiXmlText			"Do bills"

Documentation

The documentation is build with Doxygen, using the 'dox' configuration file.

License

TinyXML is released under the zlib license:

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.

References

The World Wide Web Consortium is the definitive standard body for XML, and there web pages contain huge amounts of information.

The definitive spec: http://www.w3.org/TR/2004/REC-xml-20040204/

I also recommend "XML Pocket Reference" by Robert Eckstein and published by OReilly...the book that got the whole thing started.

Contributors, Contacts, and a Brief History

Thanks very much to everyone who sends suggestions, bugs, ideas, and encouragement. It all helps, and makes this project fun. A special thanks to the contributors on the web pages that keep it lively.

So many people have sent in bugs and ideas, that rather than list here we try to give credit due in the "changes.txt" file.

TinyXML was originally written by Lee Thomason. (Often the "I" still in the documentation.) Lee reviews changes and releases new versions, with the help of Yves Berquin, Andrew Ellerton, and the tinyXml community.

We appreciate your suggestions, and would love to know if you use TinyXML. Hopefully you will enjoy it and find it useful. Please post questions, comments, file bugs, or contact us at:

www.sourceforge.net/projects/tinyxml

Lee Thomason, Yves Berquin, Andrew Ellerton

Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: TinyXML++ Tutorial

  • Files
  • Related Pages
index

TinyXML++ Tutorial

Take a look here

TinyXML++

This is a work in progress.

Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: TinyXML++

index » TinyXML++ Tutorial

TinyXML++

General Concepts

The TinyXML++ classes are all wrappers around the corresponding classes within TinyXML.

There is no reason to create TinyXML++ objects on the heap, using new, because the memory is managed for you. If you choose to use new to create TinyXML++ objects, you will always need to use delete to clean up.

Basically, TinyXML++ objects are just wrappers around TinyXML pointers.

Goals

  • Simplify the use and interface of TinyXml, using C++ concepts.
    • Use exceptions for error handling, so there are no return codes to check
    • Use templates for automatic type conversion
    • Use STL style iterators to move through nodes and attributes

Details

Use exceptions for error handling

When using the original TinyXML, every function returns a value indicating success or failure. A programmer would have to check that value to ensure the function succeeded.

Example:

 Load a document
TiXmlDocument doc( pFilename );
if ( !doc.LoadFile() ) return;

 Get a node
TiXmlElement* pElem = doc.FirstChildElement();
if ( !pElem ) return;

 Get the node we want
pElem = pElem->NextSibling();
if ( !pElem ) return;

 do something useful here

An alternative was to use TiXmlHandle, which allows for function chaining by checking the intermediate function return values:

Example:

 Load a document
TiXmlDocument doc(pFilename);
if (!doc.LoadFile()) return;

 Make a document handle
TiXmlHandle hDoc(&doc);

 Get an element by using the handle to chain calls
 Note the conversion of the TiXmlHandle to the TiXmlElement* - .Element()
TiXmlElement* pElem = hDoc.FirstChildElement().NextSibling().Element();
if ( !pElem ) return;

 do something useful here

With TinyXML++, if there is an error during a function call, it throws an exception. This means that a programmer can assume that every function is successful, as long as the functions are enclosed in a try-catch block.

Example:

try
{
 Load a document
    ticpp::Document doc( pFilename );
    doc.LoadFile();

 Get an element by chaining calls - no return values to check, no TiXmlHandle
    ticpp::Element* pElem = doc.FirstChildElement()->NextSibling();

 do something useful here
}
catch( ticpp::Exception& ex )
{
 If any function has an error, execution will enter here.
 Report the error
    std::cout << ex.what();
}

Use templates for automatic type conversion

When using TinyXML, a programmer either needs to convert values to and from strings, or choose from one of many overloads to get the value in the desired type.

Example:

 Load a document
TiXmlDocument doc( pFilename );
if ( !doc.LoadFile() ) return;

 Get a node
TiXmlElement* pElem = doc.FirstChildElement();
if ( !pElem ) return;

 Get the node we want
pElem = pElem->NextSibling();
if ( !pElem ) return;

 Get the attribute as a string, convert to int
const char* pszAttr = pElem->Attribute( "myAttribute" );
int attr = atoi( pszAttr );

 Get the attribute as an int
int attr2;
if ( TIXML_SUCCESS != pElem->QueryIntAttribute( "myAttribute", &attr2 ) )
{
    return;
}

 Get the attribute as a double
double attr3;
if ( TIXML_SUCCESS != pElem->QueryDoubleAttribute( "myAttribute", &attr3 ) )
{
    return;
}

 Get the attribute as a float
float attr4;
if ( TIXML_SUCCESS != pElem->QueryFloatAttribute( "myAttribute", &attr4 ) )
{
    return;
}

TinyXML++ uses templates for automatic type conversion.

Example:

try
{
 Load a document
    ticpp::Document doc( pFilename );
    doc.LoadFile();

 Get an element by chaining calls - no return values to check, no TiXmlHandle
    ticpp::Element* pElem = doc.FirstChildElement()->NextSibling();

 GetAttribute can determine the type of the pointer, and convert automatically

 Get the attribute as a string
    std::string attr;
    pElem->GetAttribute( "myAttribute", &attr );

 Get the attribute as an int
    int attr2;
    pElem->GetAttribute( "myAttribute", &attr2 );

 Get the attribute as an float
    float attr3;
    pElem->GetAttribute( "myAttribute", &attr3 );

 Get the attribute as an double
    double attr4;
    pElem->GetAttribute( "myAttribute", &attr4 );

 Get the attribute as an bool
    bool attr5;
    pElem->GetAttribute( "myAttribute", &attr5 );

}
catch( ticpp::Exception& ex )
{
 If any function has an error, execution will enter here.
 Report the error
    std::cout << ex.what();
}

Use STL style iterators to move through nodes and attributes

TinyXML has two ways to iterate:

First Method:

    for( child = parent->FirstChild( false ); child; child = child->NextSibling( false ) )

Second Method:

    child = 0;
    while( child = parent->IterateChildren( child ) )

Although both methods work quite well, the syntax is not familiar. TinyXML++ introduces iterators:

ticpp::Iterator< ticpp::Node > child;
for ( child = child.begin( parent ); child != child.end(); child++ )

Iterators have the added advantage of filtering by type:

 Only iterates through Comment nodes
ticpp::Iterator< ticpp::Comment > child;
for ( child = child.begin( parent ); child != child.end(); child++ )

 Only iterates through Element nodes with value "ElementValue"
ticpp::Iterator< ticpp::Element > child( "ElementValue" );
for ( child = child.begin( parent ); child != child.end(); child++ )

Finally, Iterators also work with Attributes

ticpp::Iterator< ticpp::Attribute > attribute;
for ( attribute = attribute.begin( element ); attribute != attribute.end(); attribute++ )
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: TinyXML Tutorial

index

TinyXML Tutorial

What is this?

This tutorial has a few tips and suggestions on how to use TinyXML effectively.

I've also tried to include some C++ tips like how to convert strings to integers and vice versa. This isn't anything to do with TinyXML itself, but it may helpful for your project so I've put it in anyway.

If you don't know basic C++ concepts this tutorial won't be useful. Likewise if you don't know what a DOM is, look elsewhere first.

Before we start

Some example XML datasets/files will be used.

example1.xml:

<?xml version="1.0" ?>
<Hello>World</Hello>

example2.xml:

<?xml version="1.0" ?>
<poetry>
    <verse>
        Alas
          Great World
            Alas (again)
    </verse>
</poetry>

example3.xml:

<?xml version="1.0" ?>
<shapes>
    <circle name="int-based" x="20" y="30" r="50" />
    <point name="float-based" x="3.5" y="52.1" />
</shapes>

example4.xml

<?xml version="1.0" ?>
<MyApp>
    <!-- Settings for MyApp -->
    <Messages>
        <Welcome>Welcome to MyApp</Welcome>
        <Farewell>Thank you for using MyApp</Farewell>
    </Messages>
    <Windows>
        <Window name="MainFrame" x="5" y="15" w="400" h="250" />
    </Windows>
    <Connection ip="192.168.0.1" timeout="123.456000" />
</MyApp>

Getting Started

Load XML from a file

The simplest way to load a file into a TinyXML DOM is:

TiXmlDocument doc( "demo.xml" );
doc.LoadFile();

A more real-world usage is shown below. This will load the file and display the contents to STDOUT:

// load the named file and dump its structure to STDOUT
void dump_to_stdout(const char* pFilename)
{
    TiXmlDocument doc(pFilename);
    bool loadOkay = doc.LoadFile();
    if (loadOkay)
    {
        printf("\n%s:\n", pFilename);
        dump_to_stdout( &doc ); // defined later in the tutorial
    }
    else
    {
        printf("Failed to load file \"%s\"\n", pFilename);
    }
}

A simple demonstration of this function is to use a main like this:

int main(void)
{
    dump_to_stdout("example1.xml");
    return 0;
}

Recall that Example 1 XML is:

<?xml version="1.0" ?>
<Hello>World</Hello>

Running the program with this XML will display this in the console/DOS window:

DOCUMENT
+ DECLARATION
+ ELEMENT Hello
  + TEXT[World]

The ``dump_to_stdout`` function is defined later in this tutorial and is useful if you want to understand recursive traversal of a DOM.

Building Documents Programatically

This is how to build Example 1 pragmatically:

void build_simple_doc( )
{
    // Make xml: <?xml ..><Hello>World</Hello>
    TiXmlDocument doc;
    TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" );
    TiXmlElement * element = new TiXmlElement( "Hello" );
    TiXmlText * text = new TiXmlText( "World" );
    element->LinkEndChild( text );
    doc.LinkEndChild( decl );
    doc.LinkEndChild( element );
    doc.SaveFile( "madeByHand.xml" );
}

This can be loaded and displayed on the console with:

dump_to_stdout("madeByHand.xml"); // this func defined later in the tutorial

and you'll see it is identical to Example 1:

madeByHand.xml:
Document
+ Declaration
+ Element [Hello]
  + Text: [World]

This code produces exactly the same XML DOM but it shows a different ordering to node creation and linking:

void write_simple_doc2( )
{
    // same as write_simple_doc1 but add each node
    // as early as possible into the tree.

    TiXmlDocument doc;
    TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" );
    doc.LinkEndChild( decl );

    TiXmlElement * element = new TiXmlElement( "Hello" );
    doc.LinkEndChild( element );

    TiXmlText * text = new TiXmlText( "World" );
    element->LinkEndChild( text );

    doc.SaveFile( "madeByHand2.xml" );
}

Both of these produce the same XML, namely:

<?xml version="1.0" ?>
<Hello>World</Hello>

Or in structure form:

DOCUMENT
+ DECLARATION
+ ELEMENT Hello
  + TEXT[World]

Attributes

Given an existing node, settings attributes is easy:

window = new TiXmlElement( "Demo" );
window->SetAttribute("name", "Circle");
window->SetAttribute("x", 5);
window->SetAttribute("y", 15);
window->SetDoubleAttribute("radius", 3.14159);

You can it also work with the TiXmlAttribute objects if you want.

The following code shows one way (not the only way) to get all attributes of an element, print the name and string value, and if the value can be converted to an integer or double, print that value too:

// print all attributes of pElement.
// returns the number of attributes printed
int dump_attribs_to_stdout(TiXmlElement* pElement, unsigned int indent)
{
    if ( !pElement ) return 0;

    TiXmlAttribute* pAttrib=pElement->FirstAttribute();
    int i=0;
    int ival;
    double dval;
    const char* pIndent=getIndent(indent);
    printf("\n");
    while (pAttrib)
    {
        printf( "%s%s: value=[%s]", pIndent, pAttrib->Name(), pAttrib->Value());

        if (pAttrib->QueryIntValue(&ival)==TIXML_SUCCESS)    printf( " int=%d", ival);
        if (pAttrib->QueryDoubleValue(&dval)==TIXML_SUCCESS) printf( " d=%1.1f", dval);
        printf( "\n" );
        i++;
        pAttrib=pAttrib->Next();
    }
    return i;
}

Writing a document to a file

Writing a pre-built DOM to a file is trivial:

doc.SaveFile( saveFilename );

Recall, for example, example 4:

<?xml version="1.0" ?>
<MyApp>
    <!-- Settings for MyApp -->
    <Messages>
        <Welcome>Welcome to MyApp</Welcome>
        <Farewell>Thank you for using MyApp</Farewell>
    </Messages>
    <Windows>
        <Window name="MainFrame" x="5" y="15" w="400" h="250" />
    </Windows>
    <Connection ip="192.168.0.1" timeout="123.456000" />
</MyApp>

The following function builds this DOM and writes the file "appsettings.xml":

void write_app_settings_doc( )
{
    TiXmlDocument doc;
    TiXmlElement* msg;
     TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" );
    doc.LinkEndChild( decl );

    TiXmlElement * root = new TiXmlElement( "MyApp" );
    doc.LinkEndChild( root );

    TiXmlComment * comment = new TiXmlComment();
    comment->SetValue(" Settings for MyApp " );
    root->LinkEndChild( comment );

    TiXmlElement * msgs = new TiXmlElement( "Messages" );
    root->LinkEndChild( msgs );

    msg = new TiXmlElement( "Welcome" );
    msg->LinkEndChild( new TiXmlText( "Welcome to MyApp" ));
    msgs->LinkEndChild( msg );

    msg = new TiXmlElement( "Farewell" );
    msg->LinkEndChild( new TiXmlText( "Thank you for using MyApp" ));
    msgs->LinkEndChild( msg );

    TiXmlElement * windows = new TiXmlElement( "Windows" );
    root->LinkEndChild( windows );

    TiXmlElement * window;
    window = new TiXmlElement( "Window" );
    windows->LinkEndChild( window );
    window->SetAttribute("name", "MainFrame");
    window->SetAttribute("x", 5);
    window->SetAttribute("y", 15);
    window->SetAttribute("w", 400);
    window->SetAttribute("h", 250);

    TiXmlElement * cxn = new TiXmlElement( "Connection" );
    root->LinkEndChild( cxn );
    cxn->SetAttribute("ip", "192.168.0.1");
    cxn->SetDoubleAttribute("timeout", 123.456); // floating point attrib

    dump_to_stdout( &doc );
    doc.SaveFile( "appsettings.xml" );
}

The dump_to_stdout function will show this structure:

Document
+ Declaration
+ Element [MyApp]
 (No attributes)
  + Comment: [ Settings for MyApp ]
  + Element [Messages]
 (No attributes)
    + Element [Welcome]
 (No attributes)
      + Text: [Welcome to MyApp]
    + Element [Farewell]
 (No attributes)
      + Text: [Thank you for using MyApp]
  + Element [Windows]
 (No attributes)
    + Element [Window]
      + name: value=[MainFrame]
      + x: value=[5] int=5 d=5.0
      + y: value=[15] int=15 d=15.0
      + w: value=[400] int=400 d=400.0
      + h: value=[250] int=250 d=250.0
      5 attributes
  + Element [Connection]
    + ip: value=[192.168.0.1] int=192 d=192.2
    + timeout: value=[123.456000] int=123 d=123.5
    2 attributes

I was surprised that TinyXml, by default, writes the XML in what other APIs call a "pretty" format - it modifies the whitespace of text of elements that contain other nodes so that writing the tree includes an indication of nesting level.

I haven't looked yet to see if there is a way to turn off indenting when writing a file - its bound to be easy.

[Lee: It's easy in STL mode, just use cout << myDoc. Non-STL mode is always in "pretty" format. Adding a switch would be a nice feature and has been requested.]

XML to/from C++ objects

Intro

This example assumes you're loading and saving your app settings in an XML file, e.g. something like example4.xml.

There are a number of ways to do this. For example, look into the TinyBind project at http://sourceforge.net/projects/tinybind

This section shows a plain-old approach to loading and saving a basic object structure using XML.

Set up your object classes

Start off with some basic classes like these:

#include <string>
#include <map>
using namespace std;

typedef std::map<std::string,std::string> MessageMap;

// a basic window abstraction - demo purposes only
class WindowSettings
{
public:
    int x,y,w,h;
    string name;

    WindowSettings()
        : x(0), y(0), w(100), h(100), name("Untitled")
    {
    }

    WindowSettings(int x, int y, int w, int h, const string& name)
    {
        this->x=x;
        this->y=y;
        this->w=w;
        this->h=h;
        this->name=name;
    }
};

class ConnectionSettings
{
public:
    string ip;
    double timeout;
};

class AppSettings
{
public:
    string m_name;
    MessageMap m_messages;
    list<WindowSettings> m_windows;
    ConnectionSettings m_connection;

    AppSettings() {}

    void save(const char* pFilename);
    void load(const char* pFilename);

    // just to show how to do it
    void setDemoValues()
    {
        m_name="MyApp";
        m_messages.clear();
        m_messages["Welcome"]="Welcome to "+m_name;
        m_messages["Farewell"]="Thank you for using "+m_name;
        m_windows.clear();
        m_windows.push_back(WindowSettings(15,15,400,250,"Main"));
        m_connection.ip="Unknown";
        m_connection.timeout=123.456;
    }
};

This is a basic main() that shows how to create a default settings object tree, save it and load it again:

int main(void)
{
    AppSettings settings;

    settings.save("appsettings2.xml");
    settings.load("appsettings2.xml");
    return 0;
}

The following main() shows creation, modification, saving and then loading of a settings structure:

int main(void)
{
    // block: customise and save settings
    {
        AppSettings settings;
        settings.m_name="HitchHikerApp";
        settings.m_messages["Welcome"]="Don't Panic";
        settings.m_messages["Farewell"]="Thanks for all the fish";
        settings.m_windows.push_back(WindowSettings(15,25,300,250,"BookFrame"));
        settings.m_connection.ip="192.168.0.77";
        settings.m_connection.timeout=42.0;

        settings.save("appsettings2.xml");
    }

    // block: load settings
    {
        AppSettings settings;
        settings.load("appsettings2.xml");
        printf("%s: %s\n", settings.m_name.c_str(),
            settings.m_messages["Welcome"].c_str());
        WindowSettings & w=settings.m_windows.front();
        printf("%s: Show window '%s' at %d,%d (%d x %d)\n",
            settings.m_name.c_str(), w.name.c_str(), w.x, w.y, w.w, w.h);
        printf("%s: %s\n", settings.m_name.c_str(), settings.m_messages["Farewell"].c_str());
    }
    return 0;
}

When the save() and load() are completed (see below), running this main() displays on the console:

HitchHikerApp: Don't Panic
HitchHikerApp: Show window 'BookFrame' at 15,25 (300 x 100)
HitchHikerApp: Thanks for all the fish

Encode C++ state as XML

There are lots of different ways to approach saving this to a file. Here's one:

void AppSettings::save(const char* pFilename)
{
    TiXmlDocument doc;
    TiXmlElement* msg;
    TiXmlComment * comment;
    string s;
     TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" );
    doc.LinkEndChild( decl );

    TiXmlElement * root = new TiXmlElement(m_name.c_str());
    doc.LinkEndChild( root );

    comment = new TiXmlComment();
    s=" Settings for "+m_name+" ";
    comment->SetValue(s.c_str());
    root->LinkEndChild( comment );

    // block: messages
    {
        MessageMap::iterator iter;

        TiXmlElement * msgs = new TiXmlElement( "Messages" );
        root->LinkEndChild( msgs );

        for (iter=m_messages.begin(); iter != m_messages.end(); iter++)
        {
            const string & key=(*iter).first;
            const string & value=(*iter).second;
            msg = new TiXmlElement(key.c_str());
            msg->LinkEndChild( new TiXmlText(value.c_str()));
            msgs->LinkEndChild( msg );
        }
    }

    // block: windows
    {
        TiXmlElement * windowsNode = new TiXmlElement( "Windows" );
        root->LinkEndChild( windowsNode );

        list<WindowSettings>::iterator iter;

        for (iter=m_windows.begin(); iter != m_windows.end(); iter++)
        {
            const WindowSettings& w=*iter;

            TiXmlElement * window;
            window = new TiXmlElement( "Window" );
            windowsNode->LinkEndChild( window );
            window->SetAttribute("name", w.name.c_str());
            window->SetAttribute("x", w.x);
            window->SetAttribute("y", w.y);
            window->SetAttribute("w", w.w);
            window->SetAttribute("h", w.h);
        }
    }

    // block: connection
    {
        TiXmlElement * cxn = new TiXmlElement( "Connection" );
        root->LinkEndChild( cxn );
        cxn->SetAttribute("ip", m_connection.ip.c_str());
        cxn->SetDoubleAttribute("timeout", m_connection.timeout);
    }

    doc.SaveFile(pFilename);
}

Running this with the modified main produces this file:

<?xml version="1.0" ?>
<HitchHikerApp>
    <!-- Settings for HitchHikerApp -->
    <Messages>
        <Farewell>Thanks for all the fish</Farewell>
        <Welcome>Don&apos;t Panic</Welcome>
    </Messages>
    <Windows>
        <Window name="BookFrame" x="15" y="25" w="300" h="250" />
    </Windows>
    <Connection ip="192.168.0.77" timeout="42.000000" />
</HitchHikerApp>

Decoding state from XML

As with encoding objects, there are a number of approaches to decoding XML into your own C++ object structure. The following approach uses TiXmlHandles.

void AppSettings::load(const char* pFilename)
{
    TiXmlDocument doc(pFilename);
    if (!doc.LoadFile()) return;

    TiXmlHandle hDoc(&doc);
    TiXmlElement* pElem;
    TiXmlHandle hRoot(0);

    // block: name
    {
        pElem=hDoc.FirstChildElement().Element();
        // should always have a valid root but handle gracefully if it does
        if (!pElem) return;
        m_name=pElem->Value();

        // save this for later
        hRoot=TiXmlHandle(pElem);
    }

    // block: string table
    {
        m_messages.clear(); // trash existing table

        pElem=hRoot.FirstChild( "Messages" ).FirstChild().Element();
        for( pElem; pElem; pElem=pElem->NextSiblingElement())
        {
            const char *pKey=pElem->Value();
            const char *pText=pElem->GetText();
            if (pKey && pText)
            {
                m_messages[pKey]=pText;
            }
        }
    }

    // block: windows
    {
        m_windows.clear(); // trash existing list

        TiXmlElement* pWindowNode=hRoot.FirstChild( "Windows" ).FirstChild().Element();
        for( pWindowNode; pWindowNode; pWindowNode=pWindowNode->NextSiblingElement())
        {
            WindowSettings w;
            const char *pName=pWindowNode->Attribute("name");
            if (pName) w.name=pName;

            pWindowNode->QueryIntAttribute("x", &w.x); // If this fails, original value is left as-is
            pWindowNode->QueryIntAttribute("y", &w.y);
            pWindowNode->QueryIntAttribute("w", &w.w);
            pWindowNode->QueryIntAttribute("hh", &w.h);

            m_windows.push_back(w);
        }
    }

    // block: connection
    {
        pElem=hRoot.FirstChild("Connection").Element();
        if (pElem)
        {
            m_connection.ip=pElem->Attribute("ip");
            pElem->QueryDoubleAttribute("timeout",&m_connection.timeout);
        }
    }
}

Full listing for dump_to_stdout

Below is a copy-and-paste demo program for loading arbitrary XML files and dumping the structure to STDOUT using the recursive traversal listed above.

// tutorial demo program
#include "stdafx.h"
#include "tinyxml.h"

// ----------------------------------------------------------------------
// STDOUT dump and indenting utility functions
// ----------------------------------------------------------------------
const unsigned int NUM_INDENTS_PER_SPACE=2;

const char * getIndent( unsigned int numIndents )
{
    static const char * pINDENT="                                      + ";
    static const unsigned int LENGTH=strlen( pINDENT );
    unsigned int n=numIndents*NUM_INDENTS_PER_SPACE;
    if ( n > LENGTH ) n = LENGTH;

    return &pINDENT[ LENGTH-n ];
}

// same as getIndent but no "+" at the end
const char * getIndentAlt( unsigned int numIndents )
{
    static const char * pINDENT="                                        ";
    static const unsigned int LENGTH=strlen( pINDENT );
    unsigned int n=numIndents*NUM_INDENTS_PER_SPACE;
    if ( n > LENGTH ) n = LENGTH;

    return &pINDENT[ LENGTH-n ];
}

int dump_attribs_to_stdout(TiXmlElement* pElement, unsigned int indent)
{
    if ( !pElement ) return 0;

    TiXmlAttribute* pAttrib=pElement->FirstAttribute();
    int i=0;
    int ival;
    double dval;
    const char* pIndent=getIndent(indent);
    printf("\n");
    while (pAttrib)
    {
        printf( "%s%s: value=[%s]", pIndent, pAttrib->Name(), pAttrib->Value());

        if (pAttrib->QueryIntValue(&ival)==TIXML_SUCCESS)    printf( " int=%d", ival);
        if (pAttrib->QueryDoubleValue(&dval)==TIXML_SUCCESS) printf( " d=%1.1f", dval);
        printf( "\n" );
        i++;
        pAttrib=pAttrib->Next();
    }
    return i;
}

void dump_to_stdout( TiXmlNode* pParent, unsigned int indent = 0 )
{
    if ( !pParent ) return;

    TiXmlNode* pChild;
    TiXmlText* pText;
    int t = pParent->Type();
    printf( "%s", getIndent(indent));
    int num;

    switch ( t )
    {
    case TiXmlNode::DOCUMENT:
        printf( "Document" );
        break;

    case TiXmlNode::ELEMENT:
        printf( "Element [%s]", pParent->Value() );
        num=dump_attribs_to_stdout(pParent->ToElement(), indent+1);
        switch(num)
        {
            case 0:  printf( " (No attributes)"); break;
            case 1:  printf( "%s1 attribute", getIndentAlt(indent)); break;
            default: printf( "%s%d attributes", getIndentAlt(indent), num); break;
        }
        break;

    case TiXmlNode::COMMENT:
        printf( "Comment: [%s]", pParent->Value());
        break;

    case TiXmlNode::UNKNOWN:
        printf( "Unknown" );
        break;

    case TiXmlNode::TEXT:
        pText = pParent->ToText();
        printf( "Text: [%s]", pText->Value() );
        break;

    case TiXmlNode::DECLARATION:
        printf( "Declaration" );
        break;
    default:
        break;
    }
    printf( "\n" );
    for ( pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling())
    {
        dump_to_stdout( pChild, indent+1 );
    }
}

// load the named file and dump its structure to STDOUT
void dump_to_stdout(const char* pFilename)
{
    TiXmlDocument doc(pFilename);
    bool loadOkay = doc.LoadFile();
    if (loadOkay)
    {
        printf("\n%s:\n", pFilename);
        dump_to_stdout( &doc ); // defined later in the tutorial
    }
    else
    {
        printf("Failed to load file \"%s\"\n", pFilename);
    }
}

// ----------------------------------------------------------------------
// main() for printing files named on the command line
// ----------------------------------------------------------------------
int main(int argc, char* argv[])
{
    for (int i=1; i<argc; i++)
    {
        dump_to_stdout(argv[i]);
    }
    return 0;
}

Run this from the command line or a DOS window, e.g.:

C:\dev\tinyxml> Debug\tinyxml_1.exe example1.xml

example1.xml:
Document
+ Declaration
+ Element [Hello]
 (No attributes)
  + Text: [World]

Authors and Changes

  • Written by Ellers, April, May, June 2005
  • Minor edits and integration into doc system, Lee Thomason September 2005
  • Updated by Ellers, October 2005
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Class List

  • Class List
  • Class Hierarchy
  • Class Members

TinyXml Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
ticpp::Attribute | Wrapper around TiXmlAttribute
ticpp::Base | Wrapper around TiXmlBase
ticpp::Comment | Wrapper around TiXmlComment
ticpp::Declaration | Wrapper around TiXmlDeclaration
ticpp::Document | Wrapper around TiXmlDocument
ticpp::Element | Wrapper around TiXmlElement
ticpp::Exception | This is a ticpp exception class
ticpp::Iterator< T > | Iterator for conveniently stepping through Nodes and Attributes
ticpp::Node | Wrapper around TiXmlNode
ticpp::NodeImp< T > | Implementation of Node wrapper
ticpp::StylesheetReference | Wrapper around TiXmlStylesheetReference
ticpp::Text | Wrapper around TiXmlText
TiCppRC | Base class for reference counting functionality
TiXmlAttribute | An attribute is a name-value pair
TiXmlBase | TiXmlBase is a base class for every class in TinyXml
TiXmlComment | An XML comment
TiXmlDeclaration | In correct XML the declaration is the first entry in the file
TiXmlDocument | Always the top level node
TiXmlElement | The element is a container class
TiXmlHandle | A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thing
TiXmlNode | The parent class for everything in the Document Object Model
TiXmlPrinter | Print to memory functionality
TiXmlStylesheetReference | A stylesheet reference looks like this:
TiXmlText | XML text
TiXmlUnknown | Any tag that tinyXml doesn't recognize is saved as an unknown
TiXmlVisitor | If you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks
ticpp::Visitor | Wrapper around TiXmlVisitor
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: ticpp::Attribute Class Reference

  • Class Hierarchy
  • Class Members
ticpp::Attribute

ticpp::Attribute Class Reference

Wrapper around TiXmlAttribute. More...

#include <ticpp.h>

Inheritance diagram for ticpp::Attribute:

ticpp::Base

List of all members.

Public Member Functions

Attribute ()
Construct an empty attribute.
Attribute (const std::string &name, const std::string &value)
Construct an attribute with name and value.
template<class T>
void | GetValue (T *value) const
Get the value of this attribute Uses Base::FromString to convert TiXmlAttribute::ValueStr from a std::string, and puts it in the passed pointer.
std::string | Value () const
Get the value of this attribute.
template<class T>
void | SetValue (const T &value)
Set the value of this node.
template<class T>
void | GetName (T *name) const
Get the value of this attribute Uses Base::FromString to convert TiXmlAttribute::Name from a std::string, and puts it in the passed pointer.
std::string | Name () const
Get the value of this attribute.
template<class T>
void | SetName (const T &name)
Set the value of this attribute.
Attribute * | Next (bool throwIfNoAttribute=true) const
Get the next sibling attribute in the DOM.
Attribute * | Previous (bool throwIfNoAttribute=true) const
Get the previous sibling attribute in the DOM.
virtual void | Print (FILE *file, int depth) const
All TinyXml classes can print themselves to a filestream.

Detailed Description

Wrapper around TiXmlAttribute.

Constructor & Destructor Documentation

ticpp::Attribute::Attribute | ( | const std::string & | name,
 |  | const std::string & | value
 | ) |  |

Construct an attribute with name and value.

Parameters:
name | The name of the attribute
value | The value of the attribute

Member Function Documentation

template<class T>
void ticpp::Attribute::GetValue ( T * value ) const [inline]

Get the value of this attribute Uses Base::FromString to convert TiXmlAttribute::ValueStr from a std::string, and puts it in the passed pointer.

Parameters:
value [OUT] A pointer to fill with the value

std::string ticpp::Attribute::Value ( ) const

Get the value of this attribute.

Simple wrapper for TiXmlAttribute::ValueStr.

See also:
GetValue

template<class T>
void ticpp::Attribute::SetValue ( const T & value ) [inline]

Set the value of this node.

Uses Base::ToString to convert value to a std::string, then calls TiXmlAttribute::SetValue.

Parameters:
value The value to set

template<class T>
void ticpp::Attribute::GetName ( T * name ) const [inline]

Get the value of this attribute Uses Base::FromString to convert TiXmlAttribute::Name from a std::string, and puts it in the passed pointer.

Parameters:
name [OUT] A pointer to fill with the name

std::string ticpp::Attribute::Name ( ) const

Get the value of this attribute.

Simple wrapper for TiXmlAttribute::Name.

See also:
GetName

template<class T>
void ticpp::Attribute::SetName ( const T & name ) [inline]

Set the value of this attribute.

Uses Base::ToString to convert name to a std::string, then calls TiXmlAttribute::SetName.

Parameters:
name The name to set

The documentation for this class was generated from the following file:
  • ticpp.h
Generated on Tue Oct 2 10:39:50 2007 for TinyXml by doxygen 1.5.3


TinyXml: ticpp::Base Class Reference

ticpp::Base

ticpp::Base Class Reference

Wrapper around TiXmlBase. More...

#include <ticpp.h>

Inheritance diagram for ticpp::Base:

ticpp::Attribute ticpp::Node ticpp::NodeImp< T > ticpp::NodeImp< TiXmlComment > ticpp::NodeImp< TiXmlDeclaration > ticpp::NodeImp< TiXmlDocument > ticpp::NodeImp< TiXmlElement > ticpp::NodeImp< TiXmlStylesheetReference > ticpp::NodeImp< TiXmlText > ticpp::Comment ticpp::Declaration ticpp::Document ticpp::Element ticpp::StylesheetReference ticpp::Text

List of all members.

Public Member Functions

template<class T>
std::string | ToString (const T &value) const
Converts any class with a proper overload of the << opertor to a std::string.
template<class T>
void | FromString (const std::string &temp, T *out) const
Converts a std::string to any class with a proper overload of the >> opertor.
void | FromString (const std::string &temp, std::string *out) const
Specialization for std::string.
int | Row () const
Return the position, in the original source file, of this node or attribute.
int | Column () const
Return the position, in the original source file, of this node or attribute.
virtual | ~Base ()
Destructor.

Protected Attributes

TiCppRCImp * | m_impRC
Holds status of internal TiXmlPointer - use this to determine if object has been deleted already.
std::vector< Base * > | m_spawnedWrappers
Remember all wrappers that we've created with 'new' - ( e.g.

Detailed Description

Wrapper around TiXmlBase.

Member Function Documentation

template<class T>
std::string ticpp::Base::ToString ( const T & value ) const [inline]

Converts any class with a proper overload of the << opertor to a std::string.

Parameters:
value The value to be converted
Exceptions:
Exception When value cannot be converted to a std::string

template<class T>
void ticpp::Base::FromString | ( | const std::string & | temp,
 |  | T * | out |
 | ) |  |  | const [inline]

Converts a std::string to any class with a proper overload of the >> opertor.

Parameters:
temp | The string to be converted
out | [OUT] The container for the returned value
Exceptions:
Exception When temp cannot be converted to the target type

int ticpp::Base::Row ( ) const [inline]

Return the position, in the original source file, of this node or attribute.

Wrapper around TiXmlBase::Row()

int ticpp::Base::Column ( ) const [inline]

Return the position, in the original source file, of this node or attribute.

Wrapper around TiXmlBase::Row()

Member Data Documentation

std::vector< Base* > ticpp::Base::m_spawnedWrappers [mutable, protected]

Remember all wrappers that we've created with 'new' - ( e.g.

NodeFactory, FirstChildElement, etc. )

The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: ticpp::Comment Class Reference

ticpp::Comment

ticpp::Comment Class Reference

Wrapper around TiXmlComment. More...

#include <ticpp.h>

Inheritance diagram for ticpp::Comment:

ticpp::NodeImp< TiXmlComment > ticpp::Node ticpp::Base

List of all members.

Public Member Functions

Comment ()
Constructor.
Comment (TiXmlComment *comment)
Constructor.
Comment (const std::string &comment)
Constructor.

Detailed Description

Wrapper around TiXmlComment.
The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: ticpp::Declaration Class Reference

ticpp::Declaration

ticpp::Declaration Class Reference

Wrapper around TiXmlDeclaration. More...

#include <ticpp.h>

Inheritance diagram for ticpp::Declaration:

ticpp::NodeImp< TiXmlDeclaration > ticpp::Node ticpp::Base

List of all members.

Public Member Functions

Declaration ()
Default Constructor.
Declaration (TiXmlDeclaration *declaration)
Constructor.
Declaration (const std::string &version, const std::string &encoding, const std::string &standalone)
Constructor.
std::string | Version () const
Version.
std::string | Encoding () const
Encoding.
std::string | Standalone () const
StandAlone.

Detailed Description

Wrapper around TiXmlDeclaration.

Constructor & Destructor Documentation

ticpp::Declaration::Declaration ( )

Default Constructor.

Construct an empty declaration.

Member Function Documentation

std::string ticpp::Declaration::Version ( ) const

Version.

Will return an empty string if none was found.

std::string ticpp::Declaration::Encoding ( ) const

Encoding.

Will return an empty string if none was found.

std::string ticpp::Declaration::Standalone ( ) const

StandAlone.

Is this a standalone document?

The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: ticpp::Document Class Reference

ticpp::Document

ticpp::Document Class Reference

Wrapper around TiXmlDocument. More...

#include <ticpp.h>

Inheritance diagram for ticpp::Document:

ticpp::NodeImp< TiXmlDocument > ticpp::Node ticpp::Base

List of all members.

Public Member Functions

Document ()
Default Constructor.
Document (TiXmlDocument *document)
Constructor.
Document (const char *documentName)
Constructor.
Document (const std::string &documentName)
Constructor.
void | LoadFile (TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Load a file using the current document value.
void | SaveFile () const
Save a file using the current document value.
void | LoadFile (const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Load a file using the given filename.
void | LoadFile (const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Load a file using the given filename.

Throws if load is unsuccessful.

Parameters:
filename | File to load.
encoding | Sets the documents encoding.
See also:
TiXmlEncoding
Exceptions:
Exception

void | SaveFile (const std::string &filename) const
Save a file using the given filename.
void | Parse (const std::string &xml, bool throwIfParseError=true, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Parse the given xml data.

Detailed Description

Wrapper around TiXmlDocument.

Constructor & Destructor Documentation

ticpp::Document::Document ( )

Default Constructor.

Create an empty document, that has no name.

ticpp::Document::Document ( const std::string & documentName )

Constructor.

Create a document with a name. The name of the document is also the filename of the xml.

Parameters:
documentName Name to set in the Document.

Member Function Documentation

void ticpp::Document::LoadFile ( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING )

Load a file using the current document value.

Throws if load is unsuccessful.

Parameters:
encoding Sets the documents encoding.
See also:
TiXmlEncoding
Exceptions:
Exception

void ticpp::Document::SaveFile ( ) const

Save a file using the current document value.

Throws if it can't save the file.

Exceptions:
Exception

void ticpp::Document::LoadFile | ( | const std::string & | filename,
 |  | TiXmlEncoding | encoding = TIXML_DEFAULT_ENCODING
 | ) |  |

Load a file using the given filename.

Throws if load is unsuccessful.

Parameters:
filename | File to load.
encoding | Sets the documents encoding.
See also:
TiXmlEncoding
Exceptions:
Exception

void ticpp::Document::SaveFile ( const std::string & filename ) const

Save a file using the given filename.

Throws if it can't save the file.

Parameters:
filename File to save.
Exceptions:
Exception

void ticpp::Document::Parse | ( | const std::string & | xml,
 |  | bool | throwIfParseError = true,
 |  | TiXmlEncoding | encoding = TIXML_DEFAULT_ENCODING
 | ) |  |

Parse the given xml data.

Parameters:
xml | Xml to parse.
throwIfParseError | [DEF] If true, throws when there is a parse error.
encoding | Sets the documents encoding.
Exceptions:
Exception

The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: ticpp::Element Class Reference

ticpp::Element

ticpp::Element Class Reference

Wrapper around TiXmlElement. More...

#include <ticpp.h>

Inheritance diagram for ticpp::Element:

ticpp::NodeImp< TiXmlElement > ticpp::Node ticpp::Base

List of all members.

Public Member Functions

Element ()
Default Constructor.
Element (const std::string &value)
Default Constructor.
Element (const char *value)
Default Constructor.
Element (TiXmlElement *element)
Constructor.
template<class T>
Element (const std::string &value, const T &text)
Constructor that allows you to set the element text.
Attribute * | FirstAttribute (bool throwIfNoAttributes=true) const
Access the first attribute in this element.
Attribute * | LastAttribute (bool throwIfNoAttributes=true) const
Access the last attribute in this element.
template<class T>
void | SetAttribute (const std::string &name, const T &value)
Sets an attribute of name to a given value.
std::string | GetText (bool throwIfNotFound=true) const
Gets the text of an Element.
std::string | GetTextOrDefault (const std::string &defaultValue) const
Gets the text of an Element, if it doesn't exist it will return the defaultValue.
template<class T, class DefaultT>
void | GetTextOrDefault (T *value, const DefaultT &defaultValue) const
Gets the text value of an Element, if it doesn't exist it will return the defaultValue.
template<class T>
void | GetText (T *value, bool throwIfNotFound=true) const
Gets the text of an Element.
template<class T>
void | SetText (const T &value)
Convenience function to set the text of an element.
template<class T, class DefaulT>
void | GetAttributeOrDefault (const std::string &name, T *value, const DefaulT &defaultValue) const
Gets an attribute of name from an element, if it doesn't exist it will return the defaultValue.
std::string | GetAttributeOrDefault (const std::string &name, const std::string &defaultValue) const
Gets an attribute of name from an element, if it doesn't exist it will return the defaultValue.
template<class T>
void | GetAttribute (const std::string &name, T *value, bool throwIfNotFound=true) const
Gets an attribute of name from an element.
std::string | GetAttribute (const std::string &name) const
Gets an attribute of name from an element.

Detailed Description

Wrapper around TiXmlElement.

Constructor & Destructor Documentation

ticpp::Element::Element ( const std::string & value )

Default Constructor.

Initializes all the variables.

Parameters:
value The value of the element.

ticpp::Element::Element ( const char * value )

Default Constructor.

Initializes all the variables.

Parameters:
value The value of the element.

template<class T>
ticpp::Element::Element | ( | const std::string & | value,
 |  | const T & | text |
 | ) |  |  | [inline]

Constructor that allows you to set the element text.

Parameters:
value | The value of the element.
text | The text to set.

Member Function Documentation

Attribute* ticpp::Element::FirstAttribute ( bool throwIfNoAttributes = true ) const

Access the first attribute in this element.

Parameters:
throwIfNoAttributes [DEF] If true, throws when there are no attributes
Returns:
The first attribute, NULL if there are none and throwIfNoAttributes is true

Attribute* ticpp::Element::LastAttribute ( bool throwIfNoAttributes = true ) const

Access the last attribute in this element.

Parameters:
throwIfNoAttributes [DEF] If true, throws when there are no attributes
Returns:
The last attribute, NULL if there are none and throwIfNoAttributes is true

template<class T>
void ticpp::Element::SetAttribute | ( | const std::string & | name,
 |  | const T & | value |
 | ) |  |  | [inline]

Sets an attribute of name to a given value.

The attribute will be created if it does not exist, or changed if it does. Uses ToString to convert the value to a string, so there is no need to use any other SetAttribute methods.

See also:
GetAttribute

std::string ticpp::Element::GetText ( bool throwIfNotFound = true ) const [inline]

Gets the text of an Element.

Parameters:
throwIfNotFound [DEF] If true, will throw an exception if there is no text in this element
Note:
This only works if the Text is the FirstChild node
Exceptions:
Exception When there is no text and throwIfNotFound is true
See also:
GetText( T* value, bool throwIfNotFound = false )

GetTextOrDefault

GetTextOrDefault( T* value, const DefaultT& defaultValue )

TiXmlElement::GetText

std::string ticpp::Element::GetTextOrDefault ( const std::string & defaultValue ) const [inline]

Gets the text of an Element, if it doesn't exist it will return the defaultValue.

Parameters:
defaultValue What to put in 'value' if there is no text in this element
Note:
This only works if the Text is the FirstChild node
See also:
GetText

GetText( T* value, bool throwIfNotFound = false )

GetTextOrDefault( T* value, const DefaultT& defaultValue )

TiXmlElement::GetText

template<class T, class DefaultT>
void ticpp::Element::GetTextOrDefault | ( | T * | value,
 |  | const DefaultT & | defaultValue |
 | ) |  |  | const [inline]

Gets the text value of an Element, if it doesn't exist it will return the defaultValue.

Uses FromString to convert the string to the type of choice

Parameters:
value | [OUT] The container for the returned value
defaultValue | What to put in 'value' if there is no text in this element
Note:
This is different than GetText() in that it will covert the text to what ever type you want.

This only works if the Text is the FirstChild node

See also:
GetText

GetText( T* value, bool throwIfNotFound = false )

GetTextOrDefault( const std::string& defaultValue )

TiXmlElement::GetText

template<class T>
void ticpp::Element::GetText | ( | T * | value,
 |  | bool | throwIfNotFound = true |
 | ) |  |  | const [inline]

Gets the text of an Element.

Uses FromString to convert the string to the type of choice.

Parameters:
value | [OUT] The container for the returned value
throwIfNotFound | [DEF] If true, will throw an exception if there is no text in this element
Note:
This is different than GetText() in that it will covert the text to what ever type you want

This only works if the Text is the FirstChild node

Exceptions:
Exception When there is no text and throwIfNotFound is true
See also:
GetText

GetTextOrDefault

GetTextOrDefault( T* value, const DefaultT& defaultValue )

TiXmlElement::GetText

template<class T>
void ticpp::Element::SetText ( const T & value ) [inline]

Convenience function to set the text of an element.

Creates a Text node and inserts it as the first child. Uses ToString to convert the parameter to a string.

Parameters:
value The text to set.

template<class T, class DefaulT>
void ticpp::Element::GetAttributeOrDefault | ( | const std::string & | name,
 |  | T * | value,
 |  | const DefaulT & | defaultValue |
 | ) |  |  | const [inline]

Gets an attribute of name from an element, if it doesn't exist it will return the defaultValue.

Uses FromString to convert the string to the type of choice.

Parameters:
name | The name of the attribute you are querying.
value | [OUT] The container for the returned value.
defaultValue | What to put in value if there is no attribute in this element.
Exceptions:
Exception
See also:
GetAttribute

std::string ticpp::Element::GetAttributeOrDefault | ( | const std::string & | name,
 |  | const std::string & | defaultValue |
 | ) |  |  | const

Gets an attribute of name from an element, if it doesn't exist it will return the defaultValue.

Parameters:
name | The name of the attribute you are querying.
defaultValue | What to put in value if there is no attribute in this element.
See also:
GetAttribute

template<class T>
void ticpp::Element::GetAttribute | ( | const std::string & | name,
 |  | T * | value,
 |  | bool | throwIfNotFound = true |
 | ) |  |  | const [inline]

Gets an attribute of name from an element.

Uses FromString to convert the string to the type of choice.

Parameters:
name | The name of the attribute you are querying.
value | [OUT] The container for the returned value
throwIfNotFound | [DEF] If true, will throw an exception if the attribute doesn't exist
Exceptions:
Exception When the attribute doesn't exist and throwIfNotFound is true
See also:
GetAttributeOrDefault

std::string ticpp::Element::GetAttribute ( const std::string & name ) const

Gets an attribute of name from an element.

Returns an empty string if the attribute does not exist.

Parameters:
name The name of the attribute you are querying.
Returns:
The value of the attribute, or an empty string if it does not exist.
See also:
GetAttributeOrDefault

The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: ticpp::Exception Class Reference

ticpp::Exception

ticpp::Exception Class Reference

This is a ticpp exception class. More...

#include <ticpp.h>

List of all members.

Public Member Functions

Exception (const std::string &details)
Construct an exception with a message.
const char * | what () const throw ()
Override std::exception::what() to return m_details.

Public Attributes

std::string | m_details
Exception Details.

Detailed Description

This is a ticpp exception class.
The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: ticpp::Iterator< T > Class Template Reference

ticpp::Iterator

ticpp::Iterator< T > Class Template Reference

Iterator for conveniently stepping through Nodes and Attributes. More...

#include <ticpp.h>

List of all members.

Public Member Functions

T * | begin (const Node *parent) const
For for loop comparisons.
T * | end () const
For for loop comparisons.
Iterator (const std::string &value="")
Constructor.
Iterator (T *node, const std::string &value="")
Constructor.
Iterator (const Iterator &it, const std::string &value="")
Constructor.
T * | Get () const
Gets internal pointer.
Iterator & | operator= (const Iterator &it)
Sets internal pointer.
Iterator & | operator= (T *p)
Sets internal pointer.
Iterator & operator++ ()
Sets internal pointer to the Next Sibling, or Iterator::END, if there are no more siblings.
Iterator & | operator++ (int)
Sets internal pointer to the Next Sibling, or Iterator::END, if there are no more siblings.
Iterator & operator-- ()
Sets internal pointer to the Previous Sibling, or Iterator::END, if there are no prior siblings.
Iterator & | operator-- (int)
Sets internal pointer to the Previous Sibling, or Iterator::END, if there are no prior siblings.
bool | operator!= (T *p) const
Compares internal pointer.
bool | operator!= (const Iterator &it) const
Compares internal pointer.
bool | operator== (T *p) const
Compares internal pointer*.
bool | operator== (const Iterator &it) const
Compares internal pointer.
T * | operator-> () const
So Iterator behaves like a STL iterator.
T & | operator * () const
So Iterator behaves like a STL iterator.

Detailed Description

template<class T = Node>
class ticpp::Iterator< T >

Iterator for conveniently stepping through Nodes and Attributes.

TinyXML++ introduces iterators:

    ticpp::Iterator< ticpp::Node > child;
    for ( child = child.begin( parent ); child != child.end(); child++ )

Iterators have the added advantage of filtering by type:

    // Only iterates through Comment nodes
    ticpp::Iterator< ticpp::Comment > child;
    for ( child = child.begin( parent ); child != child.end(); child++ )

    // Only iterates through Element nodes with value "ElementValue"
    ticpp::Iterator< ticpp::Element > child( "ElementValue" );
    for ( child = child.begin( parent ); child != child.end(); child++ )

Finally, Iterators also work with Attributes

    ticpp::Iterator< ticpp::Attribute > attribute;
    for ( attribute = attribute.begin( element ); attribute != attribute.end(); attribute++ )

Constructor & Destructor Documentation

template<class T = Node>
ticpp::Iterator< T >::Iterator ( const std::string & value = "" ) [inline]

Constructor.

Parameters:
value If not empty, this iterator will only visit nodes with matching value.
        // Only iterates through Element nodes with value "ElementValue"
        ticpp::Iterator< ticpp::Element > child( "ElementValue" );
        for ( child = child.begin( parent ); child != child.end(); child++ )

Member Function Documentation

template<class T = Node>
T* ticpp::Iterator< T >::begin ( const Node * parent ) const [inline]

For for loop comparisons.

Parameters:
parent The parent of the nodes to iterate.
Returns:
The first child of type T.
        ticpp::Iterator< ticpp::Node > child;
        for ( child = child.begin( parent ); child != child.end(); child++ )

template<class T = Node>
T* ticpp::Iterator< T >::end ( ) const [inline]

For for loop comparisons.

Returns:
NULL
        ticpp::Iterator< ticpp::Node > child;
        for ( child = child.begin( parent ); child != child.end(); child++ )

template<class T = Node>
T* ticpp::Iterator< T >::Get ( ) const [inline]

Gets internal pointer.

Returns:
The internal pointer.

The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: ticpp::Node Class Reference

ticpp::Node

ticpp::Node Class Reference

Wrapper around TiXmlNode. More...

#include <ticpp.h>

Inheritance diagram for ticpp::Node:

ticpp::Base ticpp::NodeImp< T > ticpp::NodeImp< TiXmlComment > ticpp::NodeImp< TiXmlDeclaration > ticpp::NodeImp< TiXmlDocument > ticpp::NodeImp< TiXmlElement > ticpp::NodeImp< TiXmlStylesheetReference > ticpp::NodeImp< TiXmlText > ticpp::Comment ticpp::Declaration ticpp::Document ticpp::Element ticpp::StylesheetReference ticpp::Text

List of all members.

Public Member Functions

template<class T>
void | GetValue (T *value) const
Get the value of this node Uses Base::FromString to convert TiXmlNode::ValueStr from a std::string, and puts it in the passed pointer.
std::string | Value () const
Get the value of this node.
template<class T>
void | SetValue (const T &value)
Set the value of this node.
void | Clear ()
Clear all Nodes below this.
Node * | Parent (bool throwIfNoParent=true) const
The Parent of this Node.
Node * | FirstChild (bool throwIfNoChildren=true) const
The first child of this node.
Node * | FirstChild (const std::string &value, bool throwIfNoChildren=true) const
The first child of this node with the matching value.
Node * | LastChild (bool throwIfNoChildren=true) const
The last child of this node.
Node * | LastChild (const std::string &value, bool throwIfNoChildren=true) const
The last child of this node with the matching value.
Node * | IterateChildren (Node *previous) const
An alternate way to walk the children of a node.
Node * | IterateChildren (const std::string &value, Node *previous) const
This flavor of IterateChildren searches for children with a particular value.
Node * | InsertEndChild (Node &addThis)
Adds a child past the LastChild.
Node * | LinkEndChild (Node *childNode)
Adds a child past the LastChild.
Node * | InsertBeforeChild (Node *beforeThis, Node &addThis)
Adds a child before the specified child.
Node * | InsertAfterChild (Node *afterThis, Node &addThis)
Adds a child after the specified child.
Node * | ReplaceChild (Node *replaceThis, Node &withThis)
Replace a child of this node.
void | RemoveChild (Node *removeThis)
Delete a child of this node.
Node * | PreviousSibling (bool throwIfNoSiblings=true) const
Navigate to a sibling node.
Node * | PreviousSibling (const std::string &value, bool throwIfNoSiblings=true) const
Navigate to a sibling node with the given value.
Node * | NextSibling (bool throwIfNoSiblings=true) const
Navigate to a sibling node.
Node * | NextSibling (const std::string &value, bool throwIfNoSiblings=true) const
Navigate to a sibling node with the given value.
Element * | NextSiblingElement (bool throwIfNoSiblings=true) const
Navigate to a sibling element.
Element * | NextSiblingElement (const std::string &value, bool throwIfNoSiblings=true) const
Navigate to a sibling element with the given value.
Element * | FirstChildElement (bool throwIfNoChildren=true) const
The first child element of this node.
Element * | FirstChildElement (const std::string &value, bool throwIfNoChildren=true) const
The first child element of this node with the matching value.
int | Type () const
Query the type (as TiXmlNode::NodeType ) of this node.
Document * | GetDocument (bool throwIfNoDocument=true) const
Return a pointer to the Document this node lives in.
bool | NoChildren () const
Check if this node has no children.
template<class T>
T * | To () const
Pointer conversion ( NOT OBJECT CONVERSION ) - replaces TiXmlNode::ToElement, TiXmlNode::ToDocument, TiXmlNode::ToComment, etc.
Document * | ToDocument () const
Pointer conversion - replaces TiXmlNode::ToDocument.
Element * | ToElement () const
Pointer conversion - replaces TiXmlNode::ToElement.
Comment * | ToComment () const
Pointer conversion - replaces TiXmlNode::ToComment.
Text * | ToText () const
Pointer conversion - replaces TiXmlNode::ToText.
Declaration * | ToDeclaration () const
Pointer conversion - replaces TiXmlNode::ToDeclaration.
StylesheetReference * | ToStylesheetReference () const
Pointer conversion - replaces TiXmlNode::ToStylesheetReference.
std::auto_ptr< Node > | Clone () const
Create an exact duplicate of this node and return it.
bool | Accept (TiXmlVisitor *visitor) const
Accept a hierchical visit the nodes in the TinyXML DOM.

Friends

std::istream & | operator>> (std::istream &in, Node &base)
Stream input operator.
std::ostream & | operator<< (std::ostream &out, Node &base)
Stream output operator.

Detailed Description

Wrapper around TiXmlNode.

Member Function Documentation

template<class T>
void ticpp::Node::GetValue ( T * value ) const [inline]

Get the value of this node Uses Base::FromString to convert TiXmlNode::ValueStr from a std::string, and puts it in the passed pointer.

Parameters:
value [OUT] A pointer to fill with the value

std::string ticpp::Node::Value ( ) const

Get the value of this node.

Simple wrapper for TiXmlNode::ValueStr.

See also:
GetValue

template<class T>
void ticpp::Node::SetValue ( const T & value ) [inline]

Set the value of this node.

Uses Base::ToString to convert value to a std::string, then calls TiXmlNode::SetValue.

Parameters:
value The value to set

void ticpp::Node::Clear ( )

Clear all Nodes below this.

Simple wrapper for TiXmlNode::Clear.

Node* ticpp::Node::Parent ( bool throwIfNoParent = true ) const

The Parent of this Node.

Simple wrapper for TiXmlNode::Parent.

Parameters:
throwIfNoParent [DEF] If true, throws when Parent = NULL.
Returns:
The parent of this node, NULL if there is no Parent.
Exceptions:
Exception When throwIfNoParent is true, and TiXmlNode::Parent returns Null.

Node* ticpp::Node::FirstChild ( bool throwIfNoChildren = true ) const

The first child of this node.

Parameters:
throwIfNoChildren [DEF] If true, will throw an exception if there are no children.
Returns:
Pointer to child, Null if no children and 'throwIfNoChildren' is false.
Exceptions:
Exception When throwIfNoChildren is true, and TiXmlNode::FirstChild returns Null.
See also:
TiXmlNode::FirstChild

Node* ticpp::Node::FirstChild | ( | const std::string & | value,
 |  | bool | throwIfNoChildren = true |
 | ) |  |  | const

The first child of this node with the matching value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
value | Value to match.
throwIfNoChildren | [DEF] If true, will throw an exception if there are no children.
See also:
FirstChild( const char* value, bool throwIfNoChildren = true )

Node* ticpp::Node::LastChild ( bool throwIfNoChildren = true ) const

The last child of this node.

Parameters:
throwIfNoChildren [DEF] If true, will throw an exception if there are no children.
Returns:
Pointer to child, Null if no children and 'throwIfNoChildren' is false.
Exceptions:
Exception When throwIfNoChildren is true, and TiXmlNode::LastChild returns Null.
See also:
TiXmlNode::LastChild

Node* ticpp::Node::LastChild | ( | const std::string & | value,
 |  | bool | throwIfNoChildren = true |
 | ) |  |  | const

The last child of this node with the matching value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
value | Value to match.
throwIfNoChildren | [DEF] If true, will throw an exception if there are no children.
See also:
LastChild( const char* value, bool throwIfNoChildren = true )

Node* ticpp::Node::IterateChildren ( Node * previous ) const

An alternate way to walk the children of a node.

Simple wrapper for TiXmlNode::IterateChildren.

Parameters:
previous The previous Node* that was returned from IterateChildren.
Returns:
NULL When there are no more children.

Node* ticpp::Node::IterateChildren | ( | const std::string & | value,
 |  | Node * | previous |
 | ) |  |  | const

This flavor of IterateChildren searches for children with a particular value.

Simple wrapper for TiXmlNode::IterateChildren.

Parameters:
value | The value you want to search for.
previous | The previous Node* that was returned from IterateChildren.
Returns:
NULL When there are no more children.

Node* ticpp::Node::InsertEndChild ( Node & addThis )

Adds a child past the LastChild.

Throws if you try to insert a document.

Note:
This takes a copy of addThis so it is not as efficiant as LinkEndChild.
Parameters:
addThis Node to insert.
Exceptions:
Exception When TiXmlNode::InsertEndChild returns Null
See also:
LinkEndChild

TiXmlNode::InsertEndChild

Node* ticpp::Node::LinkEndChild ( Node * childNode )

Adds a child past the LastChild.

Throws if you try to link a document.

Parameters:
childNode Node to link.
Exceptions:
Exception When TiXmlNode::LinkEndChild returns Null.
See also:
InsertEndChild

TiXmlNode::LinkEndChild

Node* ticpp::Node::InsertBeforeChild | ( | Node * | beforeThis,
 |  | Node & | addThis
 | ) |  |

Adds a child before the specified child.

Throws if you try to insert a document.

Parameters:
beforeThis | Node that will have addThis linked before.
addThis | Node to insert before.
Exceptions:
Exception When TiXmlNode::InsertBeforeChild returns Null.
See also:
InsertAfterChild

TiXmlNode::InsertBeforeChild

Node* ticpp::Node::InsertAfterChild | ( | Node * | afterThis,
 |  | Node & | addThis
 | ) |  |

Adds a child after the specified child.

Throws if you try to insert a document.

Parameters:
afterThis | Node that will have addThis linked after.
addThis | Node to insert after.
Exceptions:
Exception When TiXmlNode::InsertAfterChild returns Null.
See also:
InsertBeforeChild

TiXmlNode::InsertAfterChild

Node* ticpp::Node::ReplaceChild | ( | Node * | replaceThis,
 |  | Node & | withThis
 | ) |  |

Replace a child of this node.

Throws if you try to replace with a document.

Parameters:
replaceThis | Node to replace.
withThis | Node that is replacing replaceThis.
Exceptions:
Exception When TiXmlNode::ReplaceChild returns Null.
See also:
TiXmlNode::ReplaceChild

void ticpp::Node::RemoveChild ( Node * removeThis )

Delete a child of this node.

Parameters:
removeThis Node to delete.
Exceptions:
Exception When removeThis is not a child of this Node.
See also:
TiXmlNode::RemoveChild

Node* ticpp::Node::PreviousSibling ( bool throwIfNoSiblings = true ) const

Navigate to a sibling node.

Wrapper around TiXmlNode::PreviousSibling.

Parameters:
throwIfNoSiblings [DEF] If true, will throw an exception if there are no siblings.
Returns:
Pointer to sibling, Null if no siblings and 'throwIfNoSiblings' is false.
Exceptions:
Exception When TiXmlNode::PreviousSibling returns Null and 'throwIfNoSiblings' is true.

Node* ticpp::Node::PreviousSibling | ( | const std::string & | value,
 |  | bool | throwIfNoSiblings = true |
 | ) |  |  | const

Navigate to a sibling node with the given value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
value | The value of the node to look for.
throwIfNoSiblings | [DEF] If true, will throw an exception if there are no siblings.
See also:
PreviousSibling( bool throwIfNoSiblings )

Node* ticpp::Node::NextSibling ( bool throwIfNoSiblings = true ) const

Navigate to a sibling node.

Wrapper around TiXmlNode::NextSibling.

Parameters:
throwIfNoSiblings [DEF] If true, will throw an exception if there are no siblings.
Returns:
Pointer to sibling, Null if no siblings and 'throwIfNoSiblings' is false.
Exceptions:
Exception When TiXmlNode::NextSibling returns Null and 'throwIfNoSiblings' is true.

Node* ticpp::Node::NextSibling | ( | const std::string & | value,
 |  | bool | throwIfNoSiblings = true |
 | ) |  |  | const

Navigate to a sibling node with the given value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
value | The value of the node to look for.
throwIfNoSiblings | [DEF] If true, will throw an exception if there are no siblings.
See also:
NextSibling( bool throwIfNoSiblings )

Element* ticpp::Node::NextSiblingElement ( bool throwIfNoSiblings = true ) const

Navigate to a sibling element.

Wrapper around TiXmlNode::NextSibling.

Parameters:
throwIfNoSiblings [DEF] If true, will throw an exception if there are no sibling element.
Returns:
Pointer to sibling, Null if no siblings and 'throwIfNoSiblings' is false.
Exceptions:
Exception When TiXmlNode::NextSibling returns Null and 'throwIfNoSiblings' is true.

Element* ticpp::Node::NextSiblingElement | ( | const std::string & | value,
 |  | bool | throwIfNoSiblings = true |
 | ) |  |  | const

Navigate to a sibling element with the given value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
value | The value of the element to look for.
throwIfNoSiblings | [DEF] If true, will throw an exception if there are no sibling elements.
See also:
NextSiblingElement( bool throwIfNoSiblings )

Element* ticpp::Node::FirstChildElement ( bool throwIfNoChildren = true ) const

The first child element of this node.

Parameters:
throwIfNoChildren [DEF] If true, will throw an exception if there are no element children.
Returns:
Pointer to child, Null if no element children and 'throwIfNoChildren' is false.
Exceptions:
Exception When throwIfNoChildren is true, and TiXmlNode::FirstChildElement returns Null.
See also:
TiXmlNode::FirstChildElement

Element* ticpp::Node::FirstChildElement | ( | const std::string & | value,
 |  | bool | throwIfNoChildren = true |
 | ) |  |  | const

The first child element of this node with the matching value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
value | Value to match.
throwIfNoChildren | [DEF] If true, will throw an exception if there are no element children.
See also:
FirstChildElement( const char* value, bool throwIfNoChildren = true )

Document* ticpp::Node::GetDocument ( bool throwIfNoDocument = true ) const

Return a pointer to the Document this node lives in.

Parameters:
throwIfNoDocument [DEF] If true, will throw an exception if this node is not linked under a Document.
Returns:
A pointer to the Document this node lives in, NULL if not linked under a Document, and 'throwIfNoDocument' is false.
Exceptions:
Exception When this node is not linked under a Document and 'throwIfNoDocument' is true.

bool ticpp::Node::NoChildren ( ) const

Check if this node has no children.

Returns:
true if this node has no children.

template<class T>
T* ticpp::Node::To ( ) const [inline]

Pointer conversion ( NOT OBJECT CONVERSION ) - replaces TiXmlNode::ToElement, TiXmlNode::ToDocument, TiXmlNode::ToComment, etc.

Exceptions:
Exception When the target is not an object of class T
Warning:
Some ancient compilers do not support explicit specification of member template arguments, which this depends on ( e.g. VC6 ).

Document* ticpp::Node::ToDocument ( ) const

Pointer conversion - replaces TiXmlNode::ToDocument.

Exceptions:
Exception When this node is not a Document.

Element* ticpp::Node::ToElement ( ) const

Pointer conversion - replaces TiXmlNode::ToElement.

Exceptions:
Exception When this node is not a Element.

Comment* ticpp::Node::ToComment ( ) const

Pointer conversion - replaces TiXmlNode::ToComment.

Exceptions:
Exception When this node is not a Comment.

Text* ticpp::Node::ToText ( ) const

Pointer conversion - replaces TiXmlNode::ToText.

Exceptions:
Exception When this node is not a Text.

Declaration* ticpp::Node::ToDeclaration ( ) const

Pointer conversion - replaces TiXmlNode::ToDeclaration.

Exceptions:
Exception When this node is not a Declaration.

StylesheetReference* ticpp::Node::ToStylesheetReference ( ) const

Pointer conversion - replaces TiXmlNode::ToStylesheetReference.

Exceptions:
Exception When this node is not a StylesheetReference.

std::auto_ptr< Node > ticpp::Node::Clone ( ) const

Create an exact duplicate of this node and return it.

Note:
Using auto_ptr to manage the memory declared on the heap by TiXmlNode::Clone.
        // Now using clone
        ticpp::Document doc( "C:\\Test.xml" );
        ticpp::Node* sectionToClone;
        sectionToClone = doc.FirstChild( "settings" );
        std::auto_ptr< ticpp::Node > clonedNode = sectionToClone->Clone();
        // Now you can use the clone.
        ticpp::Node* node2 = clonedNode->FirstChildElement()->FirstChild();
        ...
        // After the variable clonedNode goes out of scope it will automatically be cleaned up.
Returns:
Pointer the duplicate node.

bool ticpp::Node::Accept ( TiXmlVisitor * visitor ) const

Accept a hierchical visit the nodes in the TinyXML DOM.

Returns:
The boolean returned by the visitor.

The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: ticpp::NodeImp< T > Class Template Reference

ticpp::NodeImp

ticpp::NodeImp< T > Class Template Reference

Implementation of Node wrapper. More...

#include <ticpp.h>

Inheritance diagram for ticpp::NodeImp< T >:

ticpp::Node ticpp::Base

List of all members.

Protected Attributes

T * m_tiXmlPointer
Internal pointer to the TiXml Class which is being wrapped.

Detailed Description

template<class T>
class ticpp::NodeImp< T >

Implementation of Node wrapper.
The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: ticpp::StylesheetReference Class Reference

ticpp::StylesheetReference

ticpp::StylesheetReference Class Reference

Wrapper around TiXmlStylesheetReference. More...

#include <ticpp.h>

Inheritance diagram for ticpp::StylesheetReference:

ticpp::NodeImp< TiXmlStylesheetReference > ticpp::Node ticpp::Base

List of all members.

Public Member Functions

StylesheetReference ()
Default Constructor.
StylesheetReference (TiXmlStylesheetReference *stylesheetReference)
Constructor.
StylesheetReference (const std::string &type, const std::string &href)
Constructor.
std::string | Type () const
Type.
std::string | Href () const
Href.

Detailed Description

Wrapper around TiXmlStylesheetReference.

Constructor & Destructor Documentation

ticpp::StylesheetReference::StylesheetReference ( )

Default Constructor.

Construct an empty declaration.

Member Function Documentation

std::string ticpp::StylesheetReference::Type ( ) const

Type.

Will return an empty string if none was found.

Reimplemented from ticpp::Node.

std::string ticpp::StylesheetReference::Href ( ) const

Href.

Will return an empty string if none was found.

The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: ticpp::Text Class Reference

ticpp::Text

ticpp::Text Class Reference

Wrapper around TiXmlText. More...

#include <ticpp.h>

Inheritance diagram for ticpp::Text:

ticpp::NodeImp< TiXmlText > ticpp::Node ticpp::Base

List of all members.

Public Member Functions

Text ()
Constructor.
Text (TiXmlText *text)
Constructor.
Text (const std::string &value)
Constructor.
template<class T>
Text (const T &value)
Streams value into a string and creates a Text with it.

Detailed Description

Wrapper around TiXmlText.

Constructor & Destructor Documentation

ticpp::Text::Text ( TiXmlText * text )

Constructor.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

ticpp::Text::Text ( const std::string & value )

Constructor.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T>
ticpp::Text::Text ( const T & value ) [inline]

Streams value into a string and creates a Text with it.

Uses ToString to covert the parameter to a string.

Parameters:
value The value of the Text node.
Exceptions:
Exception
See also:
TiXmlText

The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: TiCppRC Class Reference

TiCppRC Class Reference

Base class for reference counting functionality. More...

#include <ticpprc.h>

List of all members.

Public Member Functions

TiCppRC ()
Constructor Spawns new reference counter with a pointer to this.
virtual | ~TiCppRC ()
Destructor Nullifies the pointer to this held by the reference counter Decrements reference count.

Friends

class | ticpp::Base

Detailed Description

Base class for reference counting functionality.
The documentation for this class was generated from the following file:
  • ticpprc.h


TinyXml: TiXmlAttribute Class Reference

TiXmlAttribute Class Reference

An attribute is a name-value pair. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlAttribute:

TiXmlBase

List of all members.

Public Member Functions

TiXmlAttribute ()
Construct an empty attribute.
TiXmlAttribute (const std::string &_name, const std::string &_value)
std::string constructor.
TiXmlAttribute (const char *_name, const char *_value)
Construct an attribute with a name and value.
const char * | Name () const
Return the name of this attribute.
const char * | Value () const
Return the value of this attribute.
const std::string & | ValueStr () const
Return the value of this attribute.
int | IntValue () const
Return the value of this attribute, converted to an integer.
double | DoubleValue () const
Return the value of this attribute, converted to a double.
int | QueryIntValue (int *_value) const
QueryIntValue examines the value string.
int | QueryDoubleValue (double *_value) const
QueryDoubleValue examines the value string. See QueryIntValue().
void | SetName (const char *_name)
Set the name of this attribute.
void | SetValue (const char *_value)
Set the value.
void | SetIntValue (int _value)
Set the value from an integer.
void | SetDoubleValue (double _value)
Set the value from a double.
void | SetName (const std::string &_name)
STL std::string form.
void | SetValue (const std::string &_value)
STL std::string form.
const TiXmlAttribute * | Next () const
Get the next sibling attribute in the DOM. Returns null at end.
const TiXmlAttribute * | Previous () const
Get the previous sibling attribute in the DOM. Returns null at beginning.
virtual void | Print (FILE *cfile, int depth) const
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.

Detailed Description

An attribute is a name-value pair.

Elements have an arbitrary number of attributes, each with a unique name.

Note:
The attributes are not TiXmlNodes, since they are not part of the tinyXML document object model. There are other suggested ways to look at this problem.

Member Function Documentation

int TiXmlAttribute::QueryIntValue ( int * _value ) const

QueryIntValue examines the value string.

It is an alternative to the IntValue() method with richer error checking. If the value is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE.

A specialized but useful call. Note that for success it returns 0, which is the opposite of almost all other TinyXml calls.

virtual void TiXmlAttribute::Print | ( | FILE * | cfile,
 |  | int | depth |
 | ) |  |  | const [inline, virtual]

All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.

) Either or both cfile and str can be null.

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implements TiXmlBase.

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlBase Class Reference

TiXmlBase Class Reference

TiXmlBase is a base class for every class in TinyXml. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlBase:

TiXmlAttribute TiXmlNode TiXmlComment TiXmlDeclaration TiXmlDocument TiXmlElement TiXmlStylesheetReference TiXmlText TiXmlUnknown

List of all members.

Public Member Functions

virtual void | Print (FILE *cfile, int depth) const =0
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
int | Row () const
Return the position, in the original source file, of this node or attribute.
int | Column () const
See Row().
void | SetUserData (void *user)
Set a pointer to arbitrary user data.
void * | GetUserData ()
Get a pointer to arbitrary user data.
const void * | GetUserData () const
Get a pointer to arbitrary user data.

Static Public Member Functions

static void | SetCondenseWhiteSpace (bool condense)
The world does not agree on whether white space should be kept or not.
static bool | IsWhiteSpaceCondensed ()
Return the current white space setting.
static void | EncodeString (const TIXML_STRING &str, TIXML_STRING *out)
Expands entities in a string.

Protected Attributes

void * | userData
Field containing a generic user pointer.

Friends

class | TiXmlNode
class | TiXmlElement
class | TiXmlDocument

Detailed Description

TiXmlBase is a base class for every class in TinyXml.

It does little except to establish that TinyXml classes can be printed and provide some utility functions.

In XML, the document and elements can contain other elements and other types of nodes.

    A Document can contain:	Element	(container or leaf)
                            Comment (leaf)
                            Unknown (leaf)
                            Declaration( leaf )

    An Element can contain:	Element (container or leaf)
                            Text	(leaf)
                            Attributes (not on tree)
                            Comment (leaf)
                            Unknown (leaf)

    A Decleration contains: Attributes (not on tree)

Member Function Documentation

virtual void TiXmlBase::Print | ( | FILE * | cfile,
 |  | int | depth |
 | ) |  |  | const [pure virtual]

All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.

) Either or both cfile and str can be null.

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implemented in TiXmlAttribute, TiXmlElement, TiXmlComment, TiXmlText, TiXmlDeclaration, TiXmlStylesheetReference, TiXmlUnknown, and TiXmlDocument.

static void TiXmlBase::SetCondenseWhiteSpace ( bool condense ) [inline, static]

The world does not agree on whether white space should be kept or not.

In order to make everyone happy, these global, static functions are provided to set whether or not TinyXml will condense all white space into a single space or not. The default is to condense. Note changing this value is not thread safe.

int TiXmlBase::Row ( ) const [inline]

Return the position, in the original source file, of this node or attribute.

The row and column are 1-based. (That is the first row and first column is 1,1). If the returns values are 0 or less, then the parser does not have a row and column value.

Generally, the row and column value will be set when the TiXmlDocument::Load(), TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set when the DOM was created from operator>>.

The values reflect the initial load. Once the DOM is modified programmatically (by adding or changing nodes and attributes) the new values will NOT update to reflect changes in the document.

There is a minor performance cost to computing the row and column. Computation can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value.

See also:
TiXmlDocument::SetTabSize()

static void TiXmlBase::EncodeString | ( | const TIXML_STRING & | str,
 |  | TIXML_STRING * | out |
 | ) |  |  | [static]

Expands entities in a string.

Note this should not contian the tag's '<', '>', etc, or they will be transformed into entities!

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlComment Class Reference

TiXmlComment Class Reference

An XML comment. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlComment:

TiXmlNode TiXmlBase

List of all members.

Public Member Functions

TiXmlComment ()
Constructs an empty comment.
TiXmlComment (const char *_value)
Construct a comment from text.
virtual TiXmlNode * | Clone () const
Returns a copy of this Comment.
virtual void | Print (FILE *cfile, int depth) const
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
virtual const
TiXmlComment * 		ToComment () const
Cast to a more defined type. Will return null not of the requested type.
virtual TiXmlComment * | ToComment ()
Cast to a more defined type. Will return null not of the requested type.
virtual bool | Accept (TiXmlVisitor *visitor) const
Walk the XML tree visiting this node and all of its children.

Detailed Description

An XML comment.

Member Function Documentation

virtual void TiXmlComment::Print | ( | FILE * | cfile,
 |  | int | depth |
 | ) |  |  | const [virtual]

All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.

) Either or both cfile and str can be null.

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implements TiXmlBase.

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlDeclaration Class Reference

TiXmlDeclaration Class Reference

In correct XML the declaration is the first entry in the file. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlDeclaration:

TiXmlNode TiXmlBase

List of all members.

Public Member Functions

TiXmlDeclaration ()
Construct an empty declaration.
TiXmlDeclaration (const std::string &_version, const std::string &_encoding, const std::string &_standalone)
Constructor.
TiXmlDeclaration (const char *_version, const char *_encoding, const char *_standalone)
Construct.
const char * | Version () const
Version. Will return an empty string if none was found.
const char * | Encoding () const
Encoding. Will return an empty string if none was found.
const char * | Standalone () const
Is this a standalone document?
virtual TiXmlNode * | Clone () const
Creates a copy of this Declaration and returns it.
virtual void | Print (FILE *cfile, int depth) const
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
virtual const
TiXmlDeclaration * 		ToDeclaration () const
Cast to a more defined type. Will return null not of the requested type.
virtual
TiXmlDeclaration * 		ToDeclaration ()
Cast to a more defined type. Will return null not of the requested type.
virtual bool | Accept (TiXmlVisitor *visitor) const
Walk the XML tree visiting this node and all of its children.

Detailed Description

In correct XML the declaration is the first entry in the file.

        <?xml version="1.0" standalone="yes"?>

TinyXml will happily read or write files without a declaration, however. There are 3 possible attributes to the declaration: version, encoding, and standalone.

Note: In this version of the code, the attributes are handled as special cases, not generic attributes, simply because there can only be at most 3 and they are always the same.

Member Function Documentation

virtual void TiXmlDeclaration::Print | ( | FILE * | cfile,
 |  | int | depth |
 | ) |  |  | const [inline, virtual]

All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.

) Either or both cfile and str can be null.

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implements TiXmlBase.

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlDocument Class Reference

TiXmlDocument Class Reference

Always the top level node. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlDocument:

TiXmlNode TiXmlBase

List of all members.

Public Member Functions

TiXmlDocument ()
Create an empty document, that has no name.
TiXmlDocument (const char *documentName)
Create a document with a name. The name of the document is also the filename of the xml.
TiXmlDocument (const std::string &documentName)
Constructor.
bool | LoadFile (TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Load a file using the current document value.
bool | SaveFile () const
Save a file using the current document value. Returns true if successful.
bool | LoadFile (const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Load a file using the given filename. Returns true if successful.
bool | SaveFile (const char *filename) const
Save a file using the given filename. Returns true if successful.
bool | LoadFile (FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Load a file using the given FILE*.
bool | SaveFile (FILE *) const
Save a file using the given FILE*. Returns true if successful.
bool | LoadFile (const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
bool | SaveFile (const std::string &filename) const
< STL std::string version.
virtual const char * | Parse (const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Parse the given null terminated block of xml data.
const TiXmlElement * | RootElement () const
Get the root element -- the only top level element -- of the document.
bool | Error () const
If an error occurs, Error will be set to true.
const char * | ErrorDesc () const
Contains a textual (english) description of the error if one occurs.
int | ErrorId () const
Generally, you probably want the error string ( ErrorDesc() ).
int | ErrorRow () const
Returns the location (if known) of the error.
int | ErrorCol () const
The column where the error occured. See ErrorRow().
void | SetTabSize (int _tabsize)
SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to report the correct values for row and column.
void | ClearError ()
If you have handled the error, it can be reset with this call.
void | Print () const
Write the document to standard out using formatted printing ("pretty print").
virtual void | Print (FILE *cfile, int depth=0) const
Print this Document to a FILE stream.
virtual const
TiXmlDocument * 		ToDocument () const
Cast to a more defined type. Will return null not of the requested type.
virtual TiXmlDocument * | ToDocument ()
Cast to a more defined type. Will return null not of the requested type.
virtual bool | Accept (TiXmlVisitor *content) const
Walk the XML tree visiting this node and all of its children.

Protected Member Functions

virtual TiXmlNode * | Clone () const
Create an exact duplicate of this node and return it.

Detailed Description

Always the top level node.

A document binds together all the XML pieces. It can be saved, loaded, and printed to the screen. The 'value' of a document node is the xml file name.

Member Function Documentation

bool TiXmlDocument::LoadFile ( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING )

Load a file using the current document value.

Returns true if successful. Will delete any existing document data before loading.

bool TiXmlDocument::LoadFile | ( | FILE * | ,
 |  | TiXmlEncoding | encoding = TIXML_DEFAULT_ENCODING
 | ) |  |

Load a file using the given FILE*.

Returns true if successful. Note that this method doesn't stream - the entire object pointed at by the FILE* will be interpreted as an XML file. TinyXML doesn't stream in XML from the current file location. Streaming may be added in the future.

bool TiXmlDocument::LoadFile | ( | const std::string & | filename,
 |  | TiXmlEncoding | encoding = TIXML_DEFAULT_ENCODING |
 | ) |  |  | [inline]

Parameters:
encoding STL std::string version.

virtual const char* TiXmlDocument::Parse | ( | const char * | p,
 |  | TiXmlParsingData * | data = 0,
 |  | TiXmlEncoding | encoding = TIXML_DEFAULT_ENCODING |
 | ) |  |  | [virtual]

Parse the given null terminated block of xml data.

Passing in an encoding to this method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml to use that encoding, regardless of what TinyXml might otherwise try to detect.

Implements TiXmlBase.

const TiXmlElement* TiXmlDocument::RootElement ( ) const [inline]

Get the root element -- the only top level element -- of the document.

In well formed XML, there should only be one. TinyXml is tolerant of multiple elements at the document level.

bool TiXmlDocument::Error ( ) const [inline]

If an error occurs, Error will be set to true.

Also,

  • The ErrorId() will contain the integer identifier of the error (not generally useful)
  • The ErrorDesc() method will return the name of the error. (very useful)
  • The ErrorRow() and ErrorCol() will return the location of the error (if known)

int TiXmlDocument::ErrorId ( ) const [inline]

Generally, you probably want the error string ( ErrorDesc() ).

But if you prefer the ErrorId, this function will fetch it.

int TiXmlDocument::ErrorRow ( ) const [inline]

Returns the location (if known) of the error.

The first column is column 1, and the first row is row 1. A value of 0 means the row and column wasn't applicable (memory errors, for example, have no row/column) or the parser lost the error. (An error in the error reporting, in that case.)

See also:
SetTabSize, Row, Column

void TiXmlDocument::SetTabSize ( int _tabsize ) [inline]

SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) to report the correct values for row and column.

It does not change the output or input in any way.

By calling this method, with a tab size greater than 0, the row and column of each node and attribute is stored when the file is loaded. Very useful for tracking the DOM back in to the source file.

The tab size is required for calculating the location of nodes. If not set, the default of 4 is used. The tabsize is set per document. Setting the tabsize to 0 disables row/column tracking.

Note that row and column tracking is not supported when using operator>>.

The tab size needs to be enabled before the parse or load. Correct usage:

        TiXmlDocument doc;
        doc.SetTabSize( 8 );
        doc.Load( "myfile.xml" );

See also:
Row, Column

void TiXmlDocument::ClearError ( ) [inline]

If you have handled the error, it can be reset with this call.

The error state is automatically cleared if you Parse a new XML block.

void TiXmlDocument::Print ( ) const [inline]

Write the document to standard out using formatted printing ("pretty print").

virtual TiXmlNode* TiXmlDocument::Clone ( ) const [protected, virtual]

Create an exact duplicate of this node and return it.

The memory must be deleted by the caller.

Implements TiXmlNode.

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlElement Class Reference

TiXmlElement Class Reference

The element is a container class. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlElement:

TiXmlNode TiXmlBase

List of all members.

Public Member Functions

TiXmlElement (const char *in_value)
Construct an element.
TiXmlElement (const std::string &_value)
std::string constructor.
const char * | Attribute (const char *name) const
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
const char * | Attribute (const char *name, int *i) const
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
const char * | Attribute (const char *name, double *d) const
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
int | QueryIntAttribute (const char *name, int *_value) const
QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer error checking.
int | QueryDoubleAttribute (const char *name, double *_value) const
QueryDoubleAttribute examines the attribute - see QueryIntAttribute().
int | QueryFloatAttribute (const char *name, float *_value) const
QueryFloatAttribute examines the attribute - see QueryIntAttribute().
template<typename T>
int | QueryValueAttribute (const std::string &name, T *outValue) const
Template form of the attribute query which will try to read the attribute into the specified type.
void | SetAttribute (const char *name, const char *_value)
Sets an attribute of name to a given value.
void | SetAttribute (const std::string &name, const std::string &_value)
STL std::string form.
void | SetAttribute (const char *name, int value)
Sets an attribute of name to a given value.
void | SetDoubleAttribute (const char *name, double value)
Sets an attribute of name to a given value.
void | RemoveAttribute (const char *name)
Deletes an attribute with the given name.
void | RemoveAttribute (const std::string &name)
STL std::string form.
const TiXmlAttribute * | FirstAttribute () const
Access the first attribute in this element.
const TiXmlAttribute * | LastAttribute () const
Access the last attribute in this element.
const char * | GetText () const
Convenience function for easy access to the text inside an element.
virtual TiXmlNode * | Clone () const
Creates a new Element and returns it - the returned element is a copy.
virtual void | Print (FILE *cfile, int depth) const
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
virtual const
TiXmlElement * 		ToElement () const
Cast to a more defined type. Will return null not of the requested type.
virtual TiXmlElement * | ToElement ()
Cast to a more defined type. Will return null not of the requested type.
virtual bool | Accept (TiXmlVisitor *visitor) const
Walk the XML tree visiting this node and all of its children.

Detailed Description

The element is a container class.

It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes.

Member Function Documentation

const char* TiXmlElement::Attribute | ( | const char * | name,
 |  | int * | i |
 | ) |  |  | const

Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.

If the attribute exists and can be converted to an integer, the integer value will be put in the return 'i', if 'i' is non-null.

const char* TiXmlElement::Attribute | ( | const char * | name,
 |  | double * | d |
 | ) |  |  | const

Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.

If the attribute exists and can be converted to an double, the double value will be put in the return 'd', if 'd' is non-null.

int TiXmlElement::QueryIntAttribute | ( | const char * | name,
 |  | int * | _value |
 | ) |  |  | const

QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer error checking.

If the attribute is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE. If the attribute does not exist, then TIXML_NO_ATTRIBUTE is returned.

template<typename T>
int TiXmlElement::QueryValueAttribute | ( | const std::string & | name,
 |  | T * | outValue |
 | ) |  |  | const [inline]

Template form of the attribute query which will try to read the attribute into the specified type.

Very easy, very powerful, but be careful to make sure to call this with the correct type.

NOTE: This method doesn't work correctly for 'string' types.

Returns:
TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE

void TiXmlElement::SetAttribute | ( | const char * | name,
 |  | const char * | _value
 | ) |  |

Sets an attribute of name to a given value.

The attribute will be created if it does not exist, or changed if it does.

void TiXmlElement::SetAttribute | ( | const std::string & | name,
 |  | const std::string & | _value
 | ) |  |

STL std::string form.

STL std::string form.

void TiXmlElement::SetAttribute | ( | const char * | name,
 |  | int | value
 | ) |  |

Sets an attribute of name to a given value.

The attribute will be created if it does not exist, or changed if it does.

void TiXmlElement::SetDoubleAttribute | ( | const char * | name,
 |  | double | value
 | ) |  |

Sets an attribute of name to a given value.

The attribute will be created if it does not exist, or changed if it does.

const char* TiXmlElement::GetText ( ) const

Convenience function for easy access to the text inside an element.

Although easy and concise, GetText() is limited compared to getting the TiXmlText child and accessing it directly.

If the first child of 'this' is a TiXmlText, the GetText() returns the character string of the Text node, else null is returned.

This is a convenient method for getting the text of simple contained text:

        <foo>This is text</foo>
        const char* str = fooElement->GetText();

'str' will be a pointer to "This is text".

Note that this function can be misleading. If the element foo was created from this XML:

        <foo><b>This is text</b></foo>

then the value of str would be null. The first child node isn't a text node, it is another element. From this XML:

        <foo>This is <b>text</b></foo>
GetText() will return "This is ".

WARNING: GetText() accesses a child node - don't become confused with the similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are safe type casts on the referenced node.

virtual void TiXmlElement::Print | ( | FILE * | cfile,
 |  | int | depth |
 | ) |  |  | const [virtual]

All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.

) Either or both cfile and str can be null.

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implements TiXmlBase.

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlHandle Class Reference

TiXmlHandle Class Reference

A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thing. More...

#include <tinyxml.h>

List of all members.

Public Member Functions

TiXmlHandle (TiXmlNode *_node)
Create a handle from any node (at any depth of the tree.) This can be a null pointer.
TiXmlHandle (const TiXmlHandle &ref)
Copy constructor.
TiXmlHandle | FirstChild () const
Return a handle to the first child node.
TiXmlHandle | FirstChild (const char *value) const
Return a handle to the first child node with the given name.
TiXmlHandle | FirstChildElement () const
Return a handle to the first child element.
TiXmlHandle | FirstChildElement (const char *value) const
Return a handle to the first child element with the given name.
TiXmlHandle | Child (const char *value, int index) const
Return a handle to the "index" child with the given name.
TiXmlHandle | Child (int index) const
Return a handle to the "index" child.
TiXmlHandle | ChildElement (const char *value, int index) const
Return a handle to the "index" child element with the given name.
TiXmlHandle | ChildElement (int index) const
Return a handle to the "index" child element.
TiXmlNode * | ToNode () const
Return the handle as a TiXmlNode.
TiXmlElement * | ToElement () const
Return the handle as a TiXmlElement.
TiXmlText * | ToText () const
Return the handle as a TiXmlText.
TiXmlUnknown * | ToUnknown () const
Return the handle as a TiXmlUnknown.
TiXmlNode * | Node () const
TiXmlElement * | Element () const
TiXmlText * | Text () const
TiXmlUnknown * | Unknown () const

Detailed Description

A TiXmlHandle is a class that wraps a node pointer with null checks; this is an incredibly useful thing.

Note that TiXmlHandle is not part of the TinyXml DOM structure. It is a separate utility class.

Take an example:

    <Document>
        <Element attributeA = "valueA">
            <Child attributeB = "value1" />
            <Child attributeB = "value2" />
        </Element>
    <Document>

Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very easy to write a *lot* of code that looks like:

    TiXmlElement* root = document.FirstChildElement( "Document" );
    if ( root )
    {
        TiXmlElement* element = root->FirstChildElement( "Element" );
        if ( element )
        {
            TiXmlElement* child = element->FirstChildElement( "Child" );
            if ( child )
            {
                TiXmlElement* child2 = child->NextSiblingElement( "Child" );
                if ( child2 )
                {
                    // Finally do something useful.

And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity of such code. A TiXmlHandle checks for null pointers so it is perfectly safe and correct to use:

    TiXmlHandle docHandle( &document );
    TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement();
    if ( child2 )
    {
        // do something useful

Which is MUCH more concise and useful.

It is also safe to copy handles - internally they are nothing more than node pointers.

    TiXmlHandle handleCopy = handle;

What they should not be used for is iteration:

    int i=0;
    while ( true )
    {
        TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement();
        if ( !child )
            break;
        // do something
        ++i;
    }

It seems reasonable, but it is in fact two embedded while loops. The Child method is a linear walk to find the element, so this code would iterate much more than it needs to. Instead, prefer:

    TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement();

    for( child; child; child=child->NextSiblingElement() )
    {
        // do something
    }

Member Function Documentation

TiXmlHandle TiXmlHandle::Child | ( | const char * | value,
 |  | int | index |
 | ) |  |  | const

Return a handle to the "index" child with the given name.

The first child is 0, the second 1, etc.

TiXmlHandle TiXmlHandle::Child ( int index ) const

Return a handle to the "index" child.

The first child is 0, the second 1, etc.

TiXmlHandle TiXmlHandle::ChildElement | ( | const char * | value,
 |  | int | index |
 | ) |  |  | const

Return a handle to the "index" child element with the given name.

The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted.

TiXmlHandle TiXmlHandle::ChildElement ( int index ) const

Return a handle to the "index" child element.

The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted.

TiXmlNode* TiXmlHandle::ToNode ( ) const [inline]

Return the handle as a TiXmlNode.

This may return null.

TiXmlElement* TiXmlHandle::ToElement ( ) const [inline]

Return the handle as a TiXmlElement.

This may return null.

TiXmlText* TiXmlHandle::ToText ( ) const [inline]

Return the handle as a TiXmlText.

This may return null.

TiXmlUnknown* TiXmlHandle::ToUnknown ( ) const [inline]

Return the handle as a TiXmlUnknown.

This may return null.

TiXmlNode* TiXmlHandle::Node ( ) const [inline]

Deprecated:
use ToNode. Return the handle as a TiXmlNode. This may return null.

TiXmlElement* TiXmlHandle::Element ( ) const [inline]

Deprecated:
use ToElement. Return the handle as a TiXmlElement. This may return null.

TiXmlText* TiXmlHandle::Text ( ) const [inline]

Deprecated:
use ToText() Return the handle as a TiXmlText. This may return null.

TiXmlUnknown* TiXmlHandle::Unknown ( ) const [inline]

Deprecated:
use ToUnknown() Return the handle as a TiXmlUnknown. This may return null.

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlNode Class Reference

TiXmlNode Class Reference

The parent class for everything in the Document Object Model. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlNode:

TiXmlBase TiXmlComment TiXmlDeclaration TiXmlDocument TiXmlElement TiXmlStylesheetReference TiXmlText TiXmlUnknown

List of all members.

Public Types

enum | NodeType
The types of XML nodes supported by TinyXml. More...

Public Member Functions

const char * | Value () const
The meaning of 'value' changes for the specific type of TiXmlNode.
const std::string & | ValueStr () const
Return Value() as a std::string.
void | SetValue (const char *_value)
Changes the value of the node.
void | SetValue (const std::string &_value)
STL std::string form.
void | Clear ()
Delete all the children of this node. Does not affect 'this'.
TiXmlNode * Parent ()
One step up the DOM.
const TiXmlNode * | FirstChild () const
The first child of this node. Will be null if there are no children.
const TiXmlNode * | FirstChild (const char *value) const
The first child of this node with the matching 'value'.
TiXmlNode * | FirstChild (const char *_value)
The first child of this node with the matching 'value'. Will be null if none found.
TiXmlNode * LastChild ()
The last child of this node. Will be null if there are no children.
TiXmlNode * | LastChild (const char *_value)
The last child of this node matching 'value'. Will be null if there are no children.
const TiXmlNode * | FirstChild (const std::string &_value) const
STL std::string form.
TiXmlNode * | FirstChild (const std::string &_value)
STL std::string form.
const TiXmlNode * | LastChild (const std::string &_value) const
STL std::string form.
TiXmlNode * | LastChild (const std::string &_value)
STL std::string form.
const TiXmlNode * | IterateChildren (const TiXmlNode *previous) const
An alternate way to walk the children of a node.
const TiXmlNode * | IterateChildren (const char *value, const TiXmlNode *previous) const
This flavor of IterateChildren searches for children with a particular 'value'.
const TiXmlNode * | IterateChildren (const std::string &_value, const TiXmlNode *previous) const
STL std::string form.
TiXmlNode * | IterateChildren (const std::string &_value, const TiXmlNode *previous)
STL std::string form.
TiXmlNode * | InsertEndChild (const TiXmlNode &addThis)
Add a new node related to this.
TiXmlNode * | LinkEndChild (TiXmlNode *addThis)
Add a new node related to this.
TiXmlNode * | InsertBeforeChild (TiXmlNode *beforeThis, const TiXmlNode &addThis)
Add a new node related to this.
TiXmlNode * | InsertAfterChild (TiXmlNode *afterThis, const TiXmlNode &addThis)
Add a new node related to this.
TiXmlNode * | ReplaceChild (TiXmlNode *replaceThis, const TiXmlNode &withThis)
Replace a child of this node.
bool | RemoveChild (TiXmlNode *removeThis)
Delete a child of this node.
const TiXmlNode * | PreviousSibling () const
Navigate to a sibling node.
const TiXmlNode * | PreviousSibling (const char *) const
Navigate to a sibling node.
const TiXmlNode * | PreviousSibling (const std::string &_value) const
STL std::string form.
TiXmlNode * | PreviousSibling (const std::string &_value)
STL std::string form.
const TiXmlNode * | NextSibling (const std::string &_value) const
STL std::string form.
TiXmlNode * | NextSibling (const std::string &_value)
STL std::string form.
const TiXmlNode * | NextSibling () const
Navigate to a sibling node.
const TiXmlNode * | NextSibling (const char *) const
Navigate to a sibling node with the given 'value'.
const TiXmlElement * | NextSiblingElement () const
Convenience function to get through elements.
const TiXmlElement * | NextSiblingElement (const char *) const
Convenience function to get through elements.
const TiXmlElement * | NextSiblingElement (const std::string &_value) const
STL std::string form.
TiXmlElement * | NextSiblingElement (const std::string &_value)
STL std::string form.
const TiXmlElement * | FirstChildElement () const
Convenience function to get through elements.
const TiXmlElement * | FirstChildElement (const char *_value) const
Convenience function to get through elements.
const TiXmlElement * | FirstChildElement (const std::string &_value) const
STL std::string form.
TiXmlElement * | FirstChildElement (const std::string &_value)
STL std::string form.
int | Type () const
Query the type (as an enumerated value, above) of this node.
const TiXmlDocument * | GetDocument () const
Return a pointer to the Document this node lives in.
bool | NoChildren () const
Returns true if this node has no children.
virtual const
TiXmlDocument * 		ToDocument () const
Cast to a more defined type. Will return null if not of the requested type.
virtual const
TiXmlElement * 		ToElement () const
Cast to a more defined type. Will return null if not of the requested type.
virtual const
TiXmlComment * 		ToComment () const
Cast to a more defined type. Will return null if not of the requested type.
virtual const
TiXmlUnknown * 		ToUnknown () const
Cast to a more defined type. Will return null if not of the requested type.
virtual const TiXmlText * | ToText () const
Cast to a more defined type. Will return null if not of the requested type.
virtual const
TiXmlDeclaration * 		ToDeclaration () const
Cast to a more defined type. Will return null if not of the requested type.
virtual const
TiXmlStylesheetReference * 		ToStylesheetReference () const
Cast to a more defined type. Will return null if not of the requested type.
virtual TiXmlDocument * | ToDocument ()
Cast to a more defined type. Will return null if not of the requested type.
virtual TiXmlElement * | ToElement ()
Cast to a more defined type. Will return null if not of the requested type.
virtual TiXmlComment * | ToComment ()
Cast to a more defined type. Will return null if not of the requested type.
virtual TiXmlUnknown * | ToUnknown ()
Cast to a more defined type. Will return null if not of the requested type.
virtual TiXmlText * | ToText ()
Cast to a more defined type. Will return null if not of the requested type.
virtual
TiXmlDeclaration * 		ToDeclaration ()
Cast to a more defined type. Will return null if not of the requested type.
virtual
TiXmlStylesheetReference * 		ToStylesheetReference ()
Cast to a more defined type. Will return null if not of the requested type.
virtual TiXmlNode * | Clone () const =0
Create an exact duplicate of this node and return it.
virtual bool | Accept (TiXmlVisitor *visitor) const =0
Accept a hierchical visit the nodes in the TinyXML DOM.

Friends

class | TiXmlDocument
class | TiXmlElement
std::istream & | operator>> (std::istream &in, TiXmlNode &base)
An input stream operator, for every class.
std::ostream & | operator<< (std::ostream &out, const TiXmlNode &base)
An output stream operator, for every class.
std::string & | operator<< (std::string &out, const TiXmlNode &base)
Appends the XML node or attribute to a std::string.

Detailed Description

The parent class for everything in the Document Object Model.

(Except for attributes). Nodes have siblings, a parent, and children. A node can be in a document, or stand on its own. The type of a TiXmlNode can be queried, and it can be cast to its more defined type.

Member Enumeration Documentation

enum TiXmlNode::NodeType

The types of XML nodes supported by TinyXml.

(All the unsupported types are picked up by UNKNOWN.)

Member Function Documentation

const char* TiXmlNode::Value ( ) const [inline]

The meaning of 'value' changes for the specific type of TiXmlNode.

        Document:	filename of the xml file
        Element:	name of the element
        Comment:	the comment text
        Unknown:	the tag contents
        Text:		the text string

The subclasses will wrap this function.

const std::string& TiXmlNode::ValueStr ( ) const [inline]

Return Value() as a std::string.

If you only use STL, this is more efficient than calling Value(). Only available in STL mode.

void TiXmlNode::SetValue ( const char * _value ) [inline]

Changes the value of the node.

Defined as:

        Document:	filename of the xml file
        Element:	name of the element
        Comment:	the comment text
        Unknown:	the tag contents
        Text:		the text string

const TiXmlNode* TiXmlNode::FirstChild ( const char * value ) const

The first child of this node with the matching 'value'.

Will be null if none found.

const TiXmlNode* TiXmlNode::IterateChildren ( const TiXmlNode * previous ) const

An alternate way to walk the children of a node.

One way to iterate over nodes is:

            for( child = parent->FirstChild(); child; child = child->NextSibling() )

IterateChildren does the same thing with the syntax:

            child = 0;
            while( child = parent->IterateChildren( child ) )

IterateChildren takes the previous child as input and finds the next one. If the previous child is null, it returns the first. IterateChildren will return null when done.

TiXmlNode* TiXmlNode::InsertEndChild ( const TiXmlNode & addThis )

Add a new node related to this.

Adds a child past the LastChild. Returns a pointer to the new object or NULL if an error occured.

TiXmlNode* TiXmlNode::LinkEndChild ( TiXmlNode * addThis )

Add a new node related to this.

Adds a child past the LastChild.

NOTE: the node to be added is passed by pointer, and will be henceforth owned (and deleted) by tinyXml. This method is efficient and avoids an extra copy, but should be used with care as it uses a different memory model than the other insert functions.

See also:
InsertEndChild

TiXmlNode* TiXmlNode::InsertBeforeChild | ( | TiXmlNode * | beforeThis,
 |  | const TiXmlNode & | addThis
 | ) |  |

Add a new node related to this.

Adds a child before the specified child. Returns a pointer to the new object or NULL if an error occured.

TiXmlNode* TiXmlNode::InsertAfterChild | ( | TiXmlNode * | afterThis,
 |  | const TiXmlNode & | addThis
 | ) |  |

Add a new node related to this.

Adds a child after the specified child. Returns a pointer to the new object or NULL if an error occured.

TiXmlNode* TiXmlNode::ReplaceChild | ( | TiXmlNode * | replaceThis,
 |  | const TiXmlNode & | withThis
 | ) |  |

Replace a child of this node.

Returns a pointer to the new object or NULL if an error occured.

const TiXmlElement* TiXmlNode::NextSiblingElement ( ) const

Convenience function to get through elements.

Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element.

const TiXmlElement* TiXmlNode::NextSiblingElement ( const char * ) const

Convenience function to get through elements.

Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element.

int TiXmlNode::Type ( ) const [inline]

Query the type (as an enumerated value, above) of this node.

The possible types are: DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, and DECLARATION.

Reimplemented in TiXmlStylesheetReference.

const TiXmlDocument* TiXmlNode::GetDocument ( ) const

Return a pointer to the Document this node lives in.

Returns null if not in a document.

virtual TiXmlNode* TiXmlNode::Clone ( ) const [pure virtual]

Create an exact duplicate of this node and return it.

The memory must be deleted by the caller.

Implemented in TiXmlElement, TiXmlComment, TiXmlText, TiXmlDeclaration, TiXmlStylesheetReference, TiXmlUnknown, and TiXmlDocument.

virtual bool TiXmlNode::Accept ( TiXmlVisitor * visitor ) const [pure virtual]

Accept a hierchical visit the nodes in the TinyXML DOM.

Every node in the XML tree will be conditionally visited and the host will be called back via the TiXmlVisitor interface.

This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML is unchanged by using this interface versus any other.)

The interface has been based on ideas from:

  • http://www.saxproject.org/
  • http://c2.com/cgi/wiki?HierarchicalVisitorPattern

Which are both good references for "visiting".

An example of using Accept():

        TiXmlPrinter printer;
        tinyxmlDoc.Accept( &printer );
        const char* xmlcstr = printer.CStr();

Implemented in TiXmlElement, TiXmlComment, TiXmlText, TiXmlDeclaration, TiXmlStylesheetReference, TiXmlUnknown, and TiXmlDocument.

Friends And Related Function Documentation

std::istream& operator>> | ( | std::istream & | in,
 |  | TiXmlNode & | base |
 | ) |  |  | [friend]

An input stream operator, for every class.

Tolerant of newlines and formatting, but doesn't expect them.

std::ostream& operator<< | ( | std::ostream & | out,
 |  | const TiXmlNode & | base |
 | ) |  |  | [friend]

An output stream operator, for every class.

Note that this outputs without any newlines or formatting, as opposed to Print(), which includes tabs and new lines.

The operator<< and operator>> are not completely symmetric. Writing a node to a stream is very well defined. You'll get a nice stream of output, without any extra whitespace or newlines.

But reading is not as well defined. (As it always is.) If you create a TiXmlElement (for example) and read that from an input stream, the text needs to define an element or junk will result. This is true of all input streams, but it's worth keeping in mind.

A TiXmlDocument will read nodes until it reads a root element, and all the children of that root element.

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlPrinter Class Reference

TiXmlPrinter Class Reference

Print to memory functionality. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlPrinter:

TiXmlVisitor

List of all members.

Public Member Functions

virtual bool | VisitEnter (const TiXmlDocument &doc)
Visit a document.
virtual bool | VisitExit (const TiXmlDocument &doc)
Visit a document.
virtual bool | VisitEnter (const TiXmlElement &element, const TiXmlAttribute *firstAttribute)
Visit an element.
virtual bool | VisitExit (const TiXmlElement &element)
Visit an element.
virtual bool | Visit (const TiXmlDeclaration &declaration)
Visit a declaration.
virtual bool | Visit (const TiXmlText &text)
Visit a text node.
virtual bool | Visit (const TiXmlComment &comment)
Visit a comment node.
virtual bool | Visit (const TiXmlUnknown &unknown)
Visit an unknow node.
void | SetIndent (const char *_indent)
Set the indent characters for printing.
const char * | Indent ()
Query the indention string.
void | SetLineBreak (const char *_lineBreak)
Set the line breaking string.
const char * | LineBreak ()
Query the current line breaking string.
void | SetStreamPrinting ()
Switch over to "stream printing" which is the most dense formatting without linebreaks.
const char * | CStr ()
Return the result.
size_t | Size ()
Return the length of the result string.
const std::string & | Str ()
Return the result.

Detailed Description

Print to memory functionality.

The TiXmlPrinter is useful when you need to:

  1. Print to memory (especially in non-STL mode)
  2. Control formatting (line endings, etc.)

When constructed, the TiXmlPrinter is in its default "pretty printing" mode. Before calling Accept() you can call methods to control the printing of the XML document. After TiXmlNode::Accept() is called, the printed document can be accessed via the CStr(), Str(), and Size() methods.

TiXmlPrinter uses the Visitor API.

    TiXmlPrinter printer;
    printer.SetIndent( "\t" );

    doc.Accept( &printer );
    fprintf( stdout, "%s", printer.CStr() );

Member Function Documentation

void TiXmlPrinter::SetIndent ( const char * _indent ) [inline]

Set the indent characters for printing.

By default 4 spaces but tab () is also useful, or null/empty string for no indentation.

void TiXmlPrinter::SetLineBreak ( const char * _lineBreak ) [inline]

Set the line breaking string.

By default set to newline (
). Some operating systems prefer other characters, or can be set to the null/empty string for no indenation.

void TiXmlPrinter::SetStreamPrinting ( ) [inline]

Switch over to "stream printing" which is the most dense formatting without linebreaks.

Common when the XML is needed for network transmission.

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlStylesheetReference Class Reference

TiXmlStylesheetReference Class Reference

A stylesheet reference looks like this:. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlStylesheetReference:

TiXmlNode TiXmlBase

List of all members.

Public Member Functions

TiXmlStylesheetReference ()
Construct an empty declaration.
TiXmlStylesheetReference (const std::string &_type, const std::string &_href)
Constructor.
TiXmlStylesheetReference (const char *_type, const char *_href)
Construct.
const char * | Type () const
Type. Will return an empty string if none was found.
const char * | Href () const
Href. Will return an empty string if none was found.
virtual TiXmlNode * | Clone () const
Creates a copy of this StylesheetReference and returns it.
virtual void | Print (FILE *cfile, int depth) const
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
virtual const
TiXmlStylesheetReference * 		ToStylesheetReference () const
Cast to a more defined type. Will return null not of the requested type.
virtual
TiXmlStylesheetReference * 		ToStylesheetReference ()
Cast to a more defined type. Will return null not of the requested type.
virtual bool | Accept (TiXmlVisitor *visitor) const
Walk the XML tree visiting this node and all of its children.

Detailed Description

A stylesheet reference looks like this:.

        <?xml-stylesheet type="text/xsl" href="style.xsl"?>

Note: In this version of the code, the attributes are handled as special cases, not generic attributes, simply because there can only be at most 2 and they are always the same.

Member Function Documentation

virtual void TiXmlStylesheetReference::Print | ( | FILE * | cfile,
 |  | int | depth |
 | ) |  |  | const [inline, virtual]

All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.

) Either or both cfile and str can be null.

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implements TiXmlBase.

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlText Class Reference

TiXmlText Class Reference

XML text. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlText:

TiXmlNode TiXmlBase

List of all members.

Public Member Functions

TiXmlText (const char *initValue)
Constructor for text element.
TiXmlText (const std::string &initValue)
Constructor.
virtual void | Print (FILE *cfile, int depth) const
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
bool | CDATA () const
Queries whether this represents text using a CDATA section.
void | SetCDATA (bool _cdata)
Turns on or off a CDATA representation of text.
virtual const TiXmlText * | ToText () const
Cast to a more defined type. Will return null not of the requested type.
virtual TiXmlText * | ToText ()
Cast to a more defined type. Will return null not of the requested type.
virtual bool | Accept (TiXmlVisitor *content) const
Walk the XML tree visiting this node and all of its children.

Protected Member Functions

virtual TiXmlNode * | Clone () const
[internal use] Creates a new Element and returns it.

Friends

class | TiXmlElement

Detailed Description

XML text.

A text node can have 2 ways to output the next. "normal" output and CDATA. It will default to the mode it was parsed from the XML file and you generally want to leave it alone, but you can change the output mode with SetCDATA() and query it with CDATA().

Constructor & Destructor Documentation

TiXmlText::TiXmlText ( const char * initValue ) [inline]

Constructor for text element.

By default, it is treated as normal, encoded text. If you want it be output as a CDATA text element, set the parameter _cdata to 'true'

Member Function Documentation

virtual void TiXmlText::Print | ( | FILE * | cfile,
 |  | int | depth |
 | ) |  |  | const [virtual]

All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.

) Either or both cfile and str can be null.

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implements TiXmlBase.

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlUnknown Class Reference

TiXmlUnknown Class Reference

Any tag that tinyXml doesn't recognize is saved as an unknown. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlUnknown:

TiXmlNode TiXmlBase

List of all members.

Public Member Functions

virtual TiXmlNode * | Clone () const
Creates a copy of this Unknown and returns it.
virtual void | Print (FILE *cfile, int depth) const
All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.
virtual const
TiXmlUnknown * 		ToUnknown () const
Cast to a more defined type. Will return null not of the requested type.
virtual TiXmlUnknown * | ToUnknown ()
Cast to a more defined type. Will return null not of the requested type.
virtual bool | Accept (TiXmlVisitor *content) const
Walk the XML tree visiting this node and all of its children.

Detailed Description

Any tag that tinyXml doesn't recognize is saved as an unknown.

It is a tag of text, but should not be modified. It will be written back to the XML, unchanged, when the file is saved.

DTD tags get thrown into TiXmlUnknowns.

Member Function Documentation

virtual void TiXmlUnknown::Print | ( | FILE * | cfile,
 |  | int | depth |
 | ) |  |  | const [virtual]

All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode.

) Either or both cfile and str can be null.

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implements TiXmlBase.

The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: TiXmlVisitor Class Reference

TiXmlVisitor Class Reference

If you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks. More...

#include <tinyxml.h>

Inheritance diagram for TiXmlVisitor:

ticpp::Visitor TiXmlPrinter

List of all members.

Public Member Functions

virtual bool | VisitEnter (const TiXmlDocument &)
Visit a document.
virtual bool | VisitExit (const TiXmlDocument &)
Visit a document.
virtual bool | VisitEnter (const TiXmlElement &, const TiXmlAttribute *)
Visit an element.
virtual bool | VisitExit (const TiXmlElement &)
Visit an element.
virtual bool | Visit (const TiXmlDeclaration &)
Visit a declaration.
virtual bool | Visit (const TiXmlStylesheetReference &)
Visit a stylesheet reference.
virtual bool | Visit (const TiXmlText &)
Visit a text node.
virtual bool | Visit (const TiXmlComment &)
Visit a comment node.
virtual bool | Visit (const TiXmlUnknown &)
Visit an unknow node.

Detailed Description

If you call the Accept() method, it requires being passed a TiXmlVisitor class to handle callbacks.

For nodes that contain other nodes (Document, Element) you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves are simple called with Visit().

If you return 'true' from a Visit method, recursive parsing will continue. If you return false, no children of this node or its sibilings will be Visited.

All flavors of Visit methods have a default implementation that returns 'true' (continue visiting). You need to only override methods that are interesting to you.

Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting.

You should never change the document from a callback.

See also:
TiXmlNode::Accept()
The documentation for this class was generated from the following file:
  • tinyxml.h


TinyXml: ticpp::Visitor Class Reference

ticpp::Visitor

ticpp::Visitor Class Reference

Wrapper around TiXmlVisitor. More...

#include <ticpp.h>

Inheritance diagram for ticpp::Visitor:

TiXmlVisitor

List of all members.

Public Member Functions

virtual bool | VisitEnter (const TiXmlDocument &doc)
Visit a document.
virtual bool | VisitExit (const TiXmlDocument &doc)
Visit a document.
virtual bool | VisitEnter (const TiXmlElement &element, const TiXmlAttribute *firstAttribute)
Visit an element.
virtual bool | VisitExit (const TiXmlElement &element)
Visit an element.
virtual bool | Visit (const TiXmlDeclaration &declaration)
Visit a declaration.
virtual bool | Visit (const TiXmlStylesheetReference &stylesheet)
Visit a stylesheet reference.
virtual bool | Visit (const TiXmlText &text)
Visit a text node.
virtual bool | Visit (const TiXmlComment &comment)
Visit a comment node.
virtual bool | VisitEnter (const Document &)
Visit a document.
virtual bool | VisitExit (const Document &)
Visit a document.
virtual bool | VisitEnter (const Element &, const Attribute *)
Visit an element.
virtual bool | VisitExit (const Element &)
Visit an element.
virtual bool | Visit (const Declaration &)
Visit a declaration.
virtual bool | Visit (const StylesheetReference &)
Visit a stylesheet reference.
virtual bool | Visit (const Text &)
Visit a text node.
virtual bool | Visit (const Comment &)
Visit a comment node.

Detailed Description

Wrapper around TiXmlVisitor.
The documentation for this class was generated from the following file:
  • ticpp.h


TinyXml: Hierarchical Index

TinyXml Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:
  • ticpp::Base
    • ticpp::Attribute
    • ticpp::Node
      • ticpp::NodeImp< T >
      • ticpp::NodeImp< TiXmlComment >
        • ticpp::Comment
      • ticpp::NodeImp< TiXmlDeclaration >
        • ticpp::Declaration
      • ticpp::NodeImp< TiXmlDocument >
        • ticpp::Document
      • ticpp::NodeImp< TiXmlElement >
        • ticpp::Element
      • ticpp::NodeImp< TiXmlStylesheetReference >
        • ticpp::StylesheetReference
      • ticpp::NodeImp< TiXmlText >
        • ticpp::Text
  • ticpp::Exception
  • ticpp::Iterator< T >
  • TiCppRC
  • TiXmlBase
    • TiXmlAttribute
    • TiXmlNode
      • TiXmlComment
      • TiXmlDeclaration
      • TiXmlDocument
      • TiXmlElement
      • TiXmlStylesheetReference
      • TiXmlText
      • TiXmlUnknown
  • TiXmlHandle
  • TiXmlVisitor
    • ticpp::Visitor
    • TiXmlPrinter
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- a -

  • Accept() : ticpp::Node , TiXmlNode , TiXmlComment , TiXmlUnknown , TiXmlDocument , TiXmlText , TiXmlElement , TiXmlDeclaration , TiXmlStylesheetReference
  • Attribute() : TiXmlElement , ticpp::Attribute , TiXmlElement , ticpp::Attribute
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Namespace Index

TinyXml Namespace List

Here is a list of all documented namespaces with brief descriptions:
ticpp TinyXML++ is a TinyXML wrapper that uses a lot more C++ ideals


TinyXml: ticpp Namespace Reference

ticpp Namespace Reference

TinyXML++ is a TinyXML wrapper that uses a lot more C++ ideals. More...

Classes

class | Exception
This is a ticpp exception class. More...
class | Visitor
Wrapper around TiXmlVisitor. More...
class | Base
Wrapper around TiXmlBase. More...
class | Attribute
Wrapper around TiXmlAttribute. More...
class | Node
Wrapper around TiXmlNode. More...
class | Iterator
Iterator for conveniently stepping through Nodes and Attributes. More...
class | NodeImp
Implementation of Node wrapper. More...
class | Comment
Wrapper around TiXmlComment. More...
class | Text
Wrapper around TiXmlText. More...
class | Document
Wrapper around TiXmlDocument. More...
class | Element
Wrapper around TiXmlElement. More...
class | Declaration
Wrapper around TiXmlDeclaration. More...
class | StylesheetReference
Wrapper around TiXmlStylesheetReference. More...

Detailed Description

TinyXML++ is a TinyXML wrapper that uses a lot more C++ ideals.

It throws exceptions, uses templates, is in its own name space, and requires STL (Standard Template Library). This is done to ease the use of getting values in and out of the xml.

If you don't perfer to use some of the concepts just don't use it. It is just a wrapper that extends TinyXML. It doesn't actually change any of TinyXML.


TinyXml: File Index

TinyXml File List

Here is a list of all documented files with brief descriptions:
ticpp.h [code] TinyXML++ is a TinyXML wrapper that uses a lot more C++ ideals.

It throws exceptions, uses templates, is in its own name space, and requires STL (Standard Template Library). This is done to ease the use of getting values in and out of the xml.

If you don't perfer to use some of the concepts just don't use it. It is just a wrapper that extends TinyXML. It doesn't actually change any of TinyXML.

ticpprc.h [code]
tinystr.h [code]
tinyxml.h [code]


TinyXml: ticpp.h File Reference

ticpp.h File Reference

TinyXML++ is a TinyXML wrapper that uses a lot more C++ ideals.

It throws exceptions, uses templates, is in its own name space, and requires STL (Standard Template Library). This is done to ease the use of getting values in and out of the xml.

If you don't perfer to use some of the concepts just don't use it. It is just a wrapper that extends TinyXML. It doesn't actually change any of TinyXML. More...

Go to the source code of this file.

Namespaces

namespace | ticpp

Classes

class | ticpp::Exception
This is a ticpp exception class. More...
class | ticpp::Visitor
Wrapper around TiXmlVisitor. More...
class | ticpp::Base
Wrapper around TiXmlBase. More...
class | ticpp::Attribute
Wrapper around TiXmlAttribute. More...
class | ticpp::Node
Wrapper around TiXmlNode. More...
class | ticpp::Iterator< T >
Iterator for conveniently stepping through Nodes and Attributes. More...
class | ticpp::NodeImp< T >
Implementation of Node wrapper. More...
class | ticpp::Comment
Wrapper around TiXmlComment. More...
class | ticpp::Text
Wrapper around TiXmlText. More...
class | ticpp::Document
Wrapper around TiXmlDocument. More...
class | ticpp::Element
Wrapper around TiXmlElement. More...
class | ticpp::Declaration
Wrapper around TiXmlDeclaration. More...
class | ticpp::StylesheetReference
Wrapper around TiXmlStylesheetReference. More...

Detailed Description

TinyXML++ is a TinyXML wrapper that uses a lot more C++ ideals.

It throws exceptions, uses templates, is in its own name space, and requires STL (Standard Template Library). This is done to ease the use of getting values in and out of the xml.

If you don't perfer to use some of the concepts just don't use it. It is just a wrapper that extends TinyXML. It doesn't actually change any of TinyXML.

Author:
Ryan Pusztai

Ryan Mulder

Date:
04/11/2006
Version:
0.04a by edam@waxworlds.org: based Exception based on std::exception; added stream << and >> support; added Document::Parse(); bug fix; improved THROW() macro.

0.04 Added NodeImp class. Also made all the classes inherit from NodeImp.

0.03 Added Declaration class

0.02 Added Element class

0.01 Added Exception class, Document class

Todo:
add UNKNOWN support. See ticpp::NodeFactory.
Todo:
add TYPECOUNT support. See ticpp::NodeFactory.
Todo:
Add a quick reference
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Page Index

TinyXml Related Pages

Here is a list of all related documentation pages:
  • Deprecated List
  • Todo List


TinyXml: Deprecated List

Deprecated List

Member TiXmlHandle::Node () const
use ToNode. Return the handle as a TiXmlNode. This may return null.

Member TiXmlHandle::Element () const
use ToElement. Return the handle as a TiXmlElement. This may return null.

Member TiXmlHandle::Text () const
use ToText() Return the handle as a TiXmlText. This may return null.

Member TiXmlHandle::Unknown () const
use ToUnknown() Return the handle as a TiXmlUnknown. This may return null.
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Todo List

Todo List

File ticpp.h
add UNKNOWN support. See ticpp::NodeFactory.

File ticpp.h
add TYPECOUNT support. See ticpp::NodeFactory.

File ticpp.h
Add a quick reference
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Member List

ticpp::Attribute Member List

This is the complete list of members for ticpp::Attribute, including all inherited members.

Attribute() | ticpp::Attribute |
Attribute(const std::string &name, const std::string &value) | ticpp::Attribute |
Column() const | ticpp::Base | [inline]
FromString(const std::string &temp, T *out) const | ticpp::Base | [inline]
FromString(const std::string &temp, std::string *out) const | ticpp::Base | [inline]
GetName(T *name) const | ticpp::Attribute | [inline]
GetValue(T *value) const | ticpp::Attribute | [inline]
m_impRC | ticpp::Base | [mutable, protected]
m_spawnedWrappers | ticpp::Base | [mutable, protected]
Name() const | ticpp::Attribute |
Next(bool throwIfNoAttribute=true) const | ticpp::Attribute |
Previous(bool throwIfNoAttribute=true) const | ticpp::Attribute |
Print(FILE *file, int depth) const | ticpp::Attribute | [virtual]
Row() const | ticpp::Base | [inline]
SetName(const T &name) | ticpp::Attribute | [inline]
SetValue(const T &value) | ticpp::Attribute | [inline]
ToString(const T &value) const | ticpp::Base | [inline]
Value() const | ticpp::Attribute |
~Base() | ticpp::Base | [inline, virtual]


TinyXml: Member List

ticpp::Base Member List

This is the complete list of members for ticpp::Base, including all inherited members.

Column() const | ticpp::Base | [inline]
FromString(const std::string &temp, T *out) const | ticpp::Base | [inline]
FromString(const std::string &temp, std::string *out) const | ticpp::Base | [inline]
m_impRC | ticpp::Base | [mutable, protected]
m_spawnedWrappers | ticpp::Base | [mutable, protected]
Row() const | ticpp::Base | [inline]
ToString(const T &value) const | ticpp::Base | [inline]
~Base() | ticpp::Base | [inline, virtual]


TinyXml: Member List

ticpp::Comment Member List

This is the complete list of members for ticpp::Comment, including all inherited members.

Accept(TiXmlVisitor *visitor) const | ticpp::Node |
Clear() | ticpp::Node |
Clone() const | ticpp::Node |
Column() const | ticpp::Base | [inline]
Comment() | ticpp::Comment |
Comment(TiXmlComment *comment) | ticpp::Comment |
Comment(const std::string &comment) | ticpp::Comment |
FirstChild(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FromString(const std::string &temp, T *out) const | ticpp::Base | [inline]
FromString(const std::string &temp, std::string *out) const | ticpp::Base | [inline]
GetDocument(bool throwIfNoDocument=true) const | ticpp::Node |
GetValue(T *value) const | ticpp::Node | [inline]
InsertAfterChild(Node *afterThis, Node &addThis) | ticpp::Node |
InsertBeforeChild(Node *beforeThis, Node &addThis) | ticpp::Node |
InsertEndChild(Node &addThis) | ticpp::Node |
IterateChildren(Node *previous) const | ticpp::Node |
IterateChildren(const std::string &value, Node *previous) const | ticpp::Node |
LastChild(bool throwIfNoChildren=true) const | ticpp::Node |
LastChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
LinkEndChild(Node *childNode) | ticpp::Node |
m_impRC | ticpp::Base | [mutable, protected]
m_spawnedWrappers | ticpp::Base | [mutable, protected]
m_tiXmlPointer | ticpp::NodeImp< TiXmlComment > | [protected]
NextSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NoChildren() const | ticpp::Node |
operator<<(std::ostream &out, Node &base) | ticpp::Node | [friend]
operator>>(std::istream &in, Node &base) | ticpp::Node | [friend]
Parent(bool throwIfNoParent=true) const | ticpp::Node |
PreviousSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
PreviousSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
RemoveChild(Node *removeThis) | ticpp::Node |
ReplaceChild(Node *replaceThis, Node &withThis) | ticpp::Node |
Row() const | ticpp::Base | [inline]
SetValue(const T &value) | ticpp::Node | [inline]
To() const | ticpp::Node | [inline]
ToComment() const | ticpp::Node |
ToDeclaration() const | ticpp::Node |
ToDocument() const | ticpp::Node |
ToElement() const | ticpp::Node |
ToString(const T &value) const | ticpp::Base | [inline]
ToStylesheetReference() const | ticpp::Node |
ToText() const | ticpp::Node |
Type() const | ticpp::Node |
Value() const | ticpp::Node |
~Base() | ticpp::Base | [inline, virtual]


TinyXml: Member List

ticpp::Declaration Member List

This is the complete list of members for ticpp::Declaration, including all inherited members.

Accept(TiXmlVisitor *visitor) const | ticpp::Node |
Clear() | ticpp::Node |
Clone() const | ticpp::Node |
Column() const | ticpp::Base | [inline]
Declaration() | ticpp::Declaration |
Declaration(TiXmlDeclaration *declaration) | ticpp::Declaration |
Declaration(const std::string &version, const std::string &encoding, const std::string &standalone) | ticpp::Declaration |
Encoding() const | ticpp::Declaration |
FirstChild(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FromString(const std::string &temp, T *out) const | ticpp::Base | [inline]
FromString(const std::string &temp, std::string *out) const | ticpp::Base | [inline]
GetDocument(bool throwIfNoDocument=true) const | ticpp::Node |
GetValue(T *value) const | ticpp::Node | [inline]
InsertAfterChild(Node *afterThis, Node &addThis) | ticpp::Node |
InsertBeforeChild(Node *beforeThis, Node &addThis) | ticpp::Node |
InsertEndChild(Node &addThis) | ticpp::Node |
IterateChildren(Node *previous) const | ticpp::Node |
IterateChildren(const std::string &value, Node *previous) const | ticpp::Node |
LastChild(bool throwIfNoChildren=true) const | ticpp::Node |
LastChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
LinkEndChild(Node *childNode) | ticpp::Node |
m_impRC | ticpp::Base | [mutable, protected]
m_spawnedWrappers | ticpp::Base | [mutable, protected]
m_tiXmlPointer | ticpp::NodeImp< TiXmlDeclaration > | [protected]
NextSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NoChildren() const | ticpp::Node |
operator<<(std::ostream &out, Node &base) | ticpp::Node | [friend]
operator>>(std::istream &in, Node &base) | ticpp::Node | [friend]
Parent(bool throwIfNoParent=true) const | ticpp::Node |
PreviousSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
PreviousSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
RemoveChild(Node *removeThis) | ticpp::Node |
ReplaceChild(Node *replaceThis, Node &withThis) | ticpp::Node |
Row() const | ticpp::Base | [inline]
SetValue(const T &value) | ticpp::Node | [inline]
Standalone() const | ticpp::Declaration |
To() const | ticpp::Node | [inline]
ToComment() const | ticpp::Node |
ToDeclaration() const | ticpp::Node |
ToDocument() const | ticpp::Node |
ToElement() const | ticpp::Node |
ToString(const T &value) const | ticpp::Base | [inline]
ToStylesheetReference() const | ticpp::Node |
ToText() const | ticpp::Node |
Type() const | ticpp::Node |
Value() const | ticpp::Node |
Version() const | ticpp::Declaration |
~Base() | ticpp::Base | [inline, virtual]


TinyXml: Member List

ticpp::Document Member List

This is the complete list of members for ticpp::Document, including all inherited members.

Accept(TiXmlVisitor *visitor) const | ticpp::Node |
Clear() | ticpp::Node |
Clone() const | ticpp::Node |
Column() const | ticpp::Base | [inline]
Document() | ticpp::Document |
Document(TiXmlDocument *document) | ticpp::Document |
Document(const char *documentName) | ticpp::Document |
Document(const std::string &documentName) | ticpp::Document |
FirstChild(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FromString(const std::string &temp, T *out) const | ticpp::Base | [inline]
FromString(const std::string &temp, std::string *out) const | ticpp::Base | [inline]
GetDocument(bool throwIfNoDocument=true) const | ticpp::Node |
GetValue(T *value) const | ticpp::Node | [inline]
InsertAfterChild(Node *afterThis, Node &addThis) | ticpp::Node |
InsertBeforeChild(Node *beforeThis, Node &addThis) | ticpp::Node |
InsertEndChild(Node &addThis) | ticpp::Node |
IterateChildren(Node *previous) const | ticpp::Node |
IterateChildren(const std::string &value, Node *previous) const | ticpp::Node |
LastChild(bool throwIfNoChildren=true) const | ticpp::Node |
LastChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
LinkEndChild(Node *childNode) | ticpp::Node |
LoadFile(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) | ticpp::Document |
LoadFile(const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) | ticpp::Document |
LoadFile(const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) | ticpp::Document |
m_impRC | ticpp::Base | [mutable, protected]
m_spawnedWrappers | ticpp::Base | [mutable, protected]
m_tiXmlPointer | ticpp::NodeImp< TiXmlDocument > | [protected]
NextSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NoChildren() const | ticpp::Node |
operator<<(std::ostream &out, Node &base) | ticpp::Node | [friend]
operator>>(std::istream &in, Node &base) | ticpp::Node | [friend]
Parent(bool throwIfNoParent=true) const | ticpp::Node |
Parse(const std::string &xml, bool throwIfParseError=true, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) | ticpp::Document |
PreviousSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
PreviousSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
RemoveChild(Node *removeThis) | ticpp::Node |
ReplaceChild(Node *replaceThis, Node &withThis) | ticpp::Node |
Row() const | ticpp::Base | [inline]
SaveFile() const | ticpp::Document |
SaveFile(const std::string &filename) const | ticpp::Document |
SetValue(const T &value) | ticpp::Node | [inline]
To() const | ticpp::Node | [inline]
ToComment() const | ticpp::Node |
ToDeclaration() const | ticpp::Node |
ToDocument() const | ticpp::Node |
ToElement() const | ticpp::Node |
ToString(const T &value) const | ticpp::Base | [inline]
ToStylesheetReference() const | ticpp::Node |
ToText() const | ticpp::Node |
Type() const | ticpp::Node |
Value() const | ticpp::Node |
~Base() | ticpp::Base | [inline, virtual]


TinyXml: Member List

ticpp::Element Member List

This is the complete list of members for ticpp::Element, including all inherited members.

Accept(TiXmlVisitor *visitor) const | ticpp::Node |
Clear() | ticpp::Node |
Clone() const | ticpp::Node |
Column() const | ticpp::Base | [inline]
Element() | ticpp::Element |
Element(const std::string &value) | ticpp::Element |
Element(const char *value) | ticpp::Element |
Element(TiXmlElement *element) | ticpp::Element |
Element(const std::string &value, const T &text) | ticpp::Element | [inline]
FirstAttribute(bool throwIfNoAttributes=true) const | ticpp::Element |
FirstChild(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FromString(const std::string &temp, T *out) const | ticpp::Base | [inline]
FromString(const std::string &temp, std::string *out) const | ticpp::Base | [inline]
GetAttribute(const std::string &name, T *value, bool throwIfNotFound=true) const | ticpp::Element | [inline]
GetAttribute(const std::string &name) const | ticpp::Element |
GetAttributeOrDefault(const std::string &name, T *value, const DefaulT &defaultValue) const | ticpp::Element | [inline]
GetAttributeOrDefault(const std::string &name, const std::string &defaultValue) const | ticpp::Element |
GetDocument(bool throwIfNoDocument=true) const | ticpp::Node |
GetText(bool throwIfNotFound=true) const | ticpp::Element | [inline]
GetText(T *value, bool throwIfNotFound=true) const | ticpp::Element | [inline]
GetTextOrDefault(const std::string &defaultValue) const | ticpp::Element | [inline]
GetTextOrDefault(T *value, const DefaultT &defaultValue) const | ticpp::Element | [inline]
GetValue(T *value) const | ticpp::Node | [inline]
InsertAfterChild(Node *afterThis, Node &addThis) | ticpp::Node |
InsertBeforeChild(Node *beforeThis, Node &addThis) | ticpp::Node |
InsertEndChild(Node &addThis) | ticpp::Node |
IterateChildren(Node *previous) const | ticpp::Node |
IterateChildren(const std::string &value, Node *previous) const | ticpp::Node |
LastAttribute(bool throwIfNoAttributes=true) const | ticpp::Element |
LastChild(bool throwIfNoChildren=true) const | ticpp::Node |
LastChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
LinkEndChild(Node *childNode) | ticpp::Node |
m_impRC | ticpp::Base | [mutable, protected]
m_spawnedWrappers | ticpp::Base | [mutable, protected]
m_tiXmlPointer | ticpp::NodeImp< TiXmlElement > | [protected]
NextSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NoChildren() const | ticpp::Node |
operator<<(std::ostream &out, Node &base) | ticpp::Node | [friend]
operator>>(std::istream &in, Node &base) | ticpp::Node | [friend]
Parent(bool throwIfNoParent=true) const | ticpp::Node |
PreviousSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
PreviousSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
RemoveChild(Node *removeThis) | ticpp::Node |
ReplaceChild(Node *replaceThis, Node &withThis) | ticpp::Node |
Row() const | ticpp::Base | [inline]
SetAttribute(const std::string &name, const T &value) | ticpp::Element | [inline]
SetText(const T &value) | ticpp::Element | [inline]
SetValue(const T &value) | ticpp::Node | [inline]
To() const | ticpp::Node | [inline]
ToComment() const | ticpp::Node |
ToDeclaration() const | ticpp::Node |
ToDocument() const | ticpp::Node |
ToElement() const | ticpp::Node |
ToString(const T &value) const | ticpp::Base | [inline]
ToStylesheetReference() const | ticpp::Node |
ToText() const | ticpp::Node |
Type() const | ticpp::Node |
Value() const | ticpp::Node |
~Base() | ticpp::Base | [inline, virtual]


TinyXml: Member List

ticpp::Exception Member List

This is the complete list of members for ticpp::Exception, including all inherited members.

Exception(const std::string &details) | ticpp::Exception
m_details | ticpp::Exception
what() const | ticpp::Exception


TinyXml: Member List

ticpp::Iterator< T > Member List

This is the complete list of members for ticpp::Iterator< T >, including all inherited members.

begin(const Node *parent) const | ticpp::Iterator< T > | [inline]
end() const | ticpp::Iterator< T > | [inline]
Get() const | ticpp::Iterator< T > | [inline]
Iterator(const std::string &value="") | ticpp::Iterator< T > | [inline]
Iterator(T *node, const std::string &value="") | ticpp::Iterator< T > | [inline]
Iterator(const Iterator &it, const std::string &value="") | ticpp::Iterator< T > | [inline]
operator *() const | ticpp::Iterator< T > | [inline]
operator!=(T *p) const | ticpp::Iterator< T > | [inline]
operator!=(const Iterator &it) const | ticpp::Iterator< T > | [inline]
operator++() | ticpp::Iterator< T > | [inline]
operator++(int) | ticpp::Iterator< T > | [inline]
operator--() | ticpp::Iterator< T > | [inline]
operator--(int) | ticpp::Iterator< T > | [inline]
operator->() const | ticpp::Iterator< T > | [inline]
operator=(const Iterator &it) | ticpp::Iterator< T > | [inline]
operator=(T *p) | ticpp::Iterator< T > | [inline]
operator==(T *p) const | ticpp::Iterator< T > | [inline]
operator==(const Iterator &it) const | ticpp::Iterator< T > | [inline]


TinyXml: Member List

ticpp::Node Member List

This is the complete list of members for ticpp::Node, including all inherited members.

Accept(TiXmlVisitor *visitor) const | ticpp::Node |
Clear() | ticpp::Node |
Clone() const | ticpp::Node |
Column() const | ticpp::Base | [inline]
FirstChild(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FromString(const std::string &temp, T *out) const | ticpp::Base | [inline]
FromString(const std::string &temp, std::string *out) const | ticpp::Base | [inline]
GetDocument(bool throwIfNoDocument=true) const | ticpp::Node |
GetValue(T *value) const | ticpp::Node | [inline]
InsertAfterChild(Node *afterThis, Node &addThis) | ticpp::Node |
InsertBeforeChild(Node *beforeThis, Node &addThis) | ticpp::Node |
InsertEndChild(Node &addThis) | ticpp::Node |
IterateChildren(Node *previous) const | ticpp::Node |
IterateChildren(const std::string &value, Node *previous) const | ticpp::Node |
LastChild(bool throwIfNoChildren=true) const | ticpp::Node |
LastChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
LinkEndChild(Node *childNode) | ticpp::Node |
m_impRC | ticpp::Base | [mutable, protected]
m_spawnedWrappers | ticpp::Base | [mutable, protected]
NextSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NoChildren() const | ticpp::Node |
operator<<(std::ostream &out, Node &base) | ticpp::Node | [friend]
operator>>(std::istream &in, Node &base) | ticpp::Node | [friend]
Parent(bool throwIfNoParent=true) const | ticpp::Node |
PreviousSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
PreviousSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
RemoveChild(Node *removeThis) | ticpp::Node |
ReplaceChild(Node *replaceThis, Node &withThis) | ticpp::Node |
Row() const | ticpp::Base | [inline]
SetValue(const T &value) | ticpp::Node | [inline]
To() const | ticpp::Node | [inline]
ToComment() const | ticpp::Node |
ToDeclaration() const | ticpp::Node |
ToDocument() const | ticpp::Node |
ToElement() const | ticpp::Node |
ToString(const T &value) const | ticpp::Base | [inline]
ToStylesheetReference() const | ticpp::Node |
ToText() const | ticpp::Node |
Type() const | ticpp::Node |
Value() const | ticpp::Node |
~Base() | ticpp::Base | [inline, virtual]


TinyXml: Member List

ticpp::NodeImp< T > Member List

This is the complete list of members for ticpp::NodeImp< T >, including all inherited members.

Accept(TiXmlVisitor *visitor) const | ticpp::Node |
Clear() | ticpp::Node |
Clone() const | ticpp::Node |
Column() const | ticpp::Base | [inline]
FirstChild(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FromString(const std::string &temp, T *out) const | ticpp::Base | [inline]
FromString(const std::string &temp, std::string *out) const | ticpp::Base | [inline]
GetDocument(bool throwIfNoDocument=true) const | ticpp::Node |
GetValue(T *value) const | ticpp::Node | [inline]
InsertAfterChild(Node *afterThis, Node &addThis) | ticpp::Node |
InsertBeforeChild(Node *beforeThis, Node &addThis) | ticpp::Node |
InsertEndChild(Node &addThis) | ticpp::Node |
IterateChildren(Node *previous) const | ticpp::Node |
IterateChildren(const std::string &value, Node *previous) const | ticpp::Node |
LastChild(bool throwIfNoChildren=true) const | ticpp::Node |
LastChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
LinkEndChild(Node *childNode) | ticpp::Node |
m_impRC | ticpp::Base | [mutable, protected]
m_spawnedWrappers | ticpp::Base | [mutable, protected]
m_tiXmlPointer | ticpp::NodeImp< T > | [protected]
NextSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NoChildren() const | ticpp::Node |
operator<<(std::ostream &out, Node &base) | ticpp::Node | [friend]
operator>>(std::istream &in, Node &base) | ticpp::Node | [friend]
Parent(bool throwIfNoParent=true) const | ticpp::Node |
PreviousSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
PreviousSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
RemoveChild(Node *removeThis) | ticpp::Node |
ReplaceChild(Node *replaceThis, Node &withThis) | ticpp::Node |
Row() const | ticpp::Base | [inline]
SetValue(const T &value) | ticpp::Node | [inline]
To() const | ticpp::Node | [inline]
ToComment() const | ticpp::Node |
ToDeclaration() const | ticpp::Node |
ToDocument() const | ticpp::Node |
ToElement() const | ticpp::Node |
ToString(const T &value) const | ticpp::Base | [inline]
ToStylesheetReference() const | ticpp::Node |
ToText() const | ticpp::Node |
Type() const | ticpp::Node |
Value() const | ticpp::Node |
~Base() | ticpp::Base | [inline, virtual]


TinyXml: Member List

ticpp::StylesheetReference Member List

This is the complete list of members for ticpp::StylesheetReference, including all inherited members.

Accept(TiXmlVisitor *visitor) const | ticpp::Node |
Clear() | ticpp::Node |
Clone() const | ticpp::Node |
Column() const | ticpp::Base | [inline]
FirstChild(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FromString(const std::string &temp, T *out) const | ticpp::Base | [inline]
FromString(const std::string &temp, std::string *out) const | ticpp::Base | [inline]
GetDocument(bool throwIfNoDocument=true) const | ticpp::Node |
GetValue(T *value) const | ticpp::Node | [inline]
Href() const | ticpp::StylesheetReference |
InsertAfterChild(Node *afterThis, Node &addThis) | ticpp::Node |
InsertBeforeChild(Node *beforeThis, Node &addThis) | ticpp::Node |
InsertEndChild(Node &addThis) | ticpp::Node |
IterateChildren(Node *previous) const | ticpp::Node |
IterateChildren(const std::string &value, Node *previous) const | ticpp::Node |
LastChild(bool throwIfNoChildren=true) const | ticpp::Node |
LastChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
LinkEndChild(Node *childNode) | ticpp::Node |
m_impRC | ticpp::Base | [mutable, protected]
m_spawnedWrappers | ticpp::Base | [mutable, protected]
m_tiXmlPointer | ticpp::NodeImp< TiXmlStylesheetReference > | [protected]
NextSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NoChildren() const | ticpp::Node |
operator<<(std::ostream &out, Node &base) | ticpp::Node | [friend]
operator>>(std::istream &in, Node &base) | ticpp::Node | [friend]
Parent(bool throwIfNoParent=true) const | ticpp::Node |
PreviousSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
PreviousSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
RemoveChild(Node *removeThis) | ticpp::Node |
ReplaceChild(Node *replaceThis, Node &withThis) | ticpp::Node |
Row() const | ticpp::Base | [inline]
SetValue(const T &value) | ticpp::Node | [inline]
StylesheetReference() | ticpp::StylesheetReference |
StylesheetReference(TiXmlStylesheetReference *stylesheetReference) | ticpp::StylesheetReference |
StylesheetReference(const std::string &type, const std::string &href) | ticpp::StylesheetReference |
To() const | ticpp::Node | [inline]
ToComment() const | ticpp::Node |
ToDeclaration() const | ticpp::Node |
ToDocument() const | ticpp::Node |
ToElement() const | ticpp::Node |
ToString(const T &value) const | ticpp::Base | [inline]
ToStylesheetReference() const | ticpp::Node |
ToText() const | ticpp::Node |
Type() const | ticpp::StylesheetReference |
Value() const | ticpp::Node |
~Base() | ticpp::Base | [inline, virtual]


TinyXml: Member List

ticpp::Text Member List

This is the complete list of members for ticpp::Text, including all inherited members.

Accept(TiXmlVisitor *visitor) const | ticpp::Node |
Clear() | ticpp::Node |
Clone() const | ticpp::Node |
Column() const | ticpp::Base | [inline]
FirstChild(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(bool throwIfNoChildren=true) const | ticpp::Node |
FirstChildElement(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
FromString(const std::string &temp, T *out) const | ticpp::Base | [inline]
FromString(const std::string &temp, std::string *out) const | ticpp::Base | [inline]
GetDocument(bool throwIfNoDocument=true) const | ticpp::Node |
GetValue(T *value) const | ticpp::Node | [inline]
InsertAfterChild(Node *afterThis, Node &addThis) | ticpp::Node |
InsertBeforeChild(Node *beforeThis, Node &addThis) | ticpp::Node |
InsertEndChild(Node &addThis) | ticpp::Node |
IterateChildren(Node *previous) const | ticpp::Node |
IterateChildren(const std::string &value, Node *previous) const | ticpp::Node |
LastChild(bool throwIfNoChildren=true) const | ticpp::Node |
LastChild(const std::string &value, bool throwIfNoChildren=true) const | ticpp::Node |
LinkEndChild(Node *childNode) | ticpp::Node |
m_impRC | ticpp::Base | [mutable, protected]
m_spawnedWrappers | ticpp::Base | [mutable, protected]
m_tiXmlPointer | ticpp::NodeImp< TiXmlText > | [protected]
NextSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(bool throwIfNoSiblings=true) const | ticpp::Node |
NextSiblingElement(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
NoChildren() const | ticpp::Node |
operator<<(std::ostream &out, Node &base) | ticpp::Node | [friend]
operator>>(std::istream &in, Node &base) | ticpp::Node | [friend]
Parent(bool throwIfNoParent=true) const | ticpp::Node |
PreviousSibling(bool throwIfNoSiblings=true) const | ticpp::Node |
PreviousSibling(const std::string &value, bool throwIfNoSiblings=true) const | ticpp::Node |
RemoveChild(Node *removeThis) | ticpp::Node |
ReplaceChild(Node *replaceThis, Node &withThis) | ticpp::Node |
Row() const | ticpp::Base | [inline]
SetValue(const T &value) | ticpp::Node | [inline]
Text() | ticpp::Text |
Text(TiXmlText *text) | ticpp::Text |
Text(const std::string &value) | ticpp::Text |
Text(const T &value) | ticpp::Text | [inline]
To() const | ticpp::Node | [inline]
ToComment() const | ticpp::Node |
ToDeclaration() const | ticpp::Node |
ToDocument() const | ticpp::Node |
ToElement() const | ticpp::Node |
ToString(const T &value) const | ticpp::Base | [inline]
ToStylesheetReference() const | ticpp::Node |
ToText() const | ticpp::Node |
Type() const | ticpp::Node |
Value() const | ticpp::Node |
~Base() | ticpp::Base | [inline, virtual]


TinyXml: Member List

ticpp::Visitor Member List

This is the complete list of members for ticpp::Visitor, including all inherited members.

Visit(const TiXmlDeclaration &declaration) | ticpp::Visitor | [virtual]
Visit(const TiXmlStylesheetReference &stylesheet) | ticpp::Visitor | [virtual]
Visit(const TiXmlText &text) | ticpp::Visitor | [virtual]
Visit(const TiXmlComment &comment) | ticpp::Visitor | [virtual]
Visit(const Declaration &) | ticpp::Visitor | [inline, virtual]
Visit(const StylesheetReference &) | ticpp::Visitor | [inline, virtual]
Visit(const Text &) | ticpp::Visitor | [inline, virtual]
Visit(const Comment &) | ticpp::Visitor | [inline, virtual]
TiXmlVisitor::Visit(const TiXmlUnknown &) | TiXmlVisitor | [inline, virtual]
VisitEnter(const TiXmlDocument &doc) | ticpp::Visitor | [virtual]
VisitEnter(const TiXmlElement &element, const TiXmlAttribute *firstAttribute) | ticpp::Visitor | [virtual]
VisitEnter(const Document &) | ticpp::Visitor | [inline, virtual]
VisitEnter(const Element &, const Attribute *) | ticpp::Visitor | [inline, virtual]
VisitExit(const TiXmlDocument &doc) | ticpp::Visitor | [virtual]
VisitExit(const TiXmlElement &element) | ticpp::Visitor | [virtual]
VisitExit(const Document &) | ticpp::Visitor | [inline, virtual]
VisitExit(const Element &) | ticpp::Visitor | [inline, virtual]


TinyXml: Member List

TiCppRC Member List

This is the complete list of members for TiCppRC, including all inherited members.

TiCppRC() | TiCppRC |
~TiCppRC() | TiCppRC | [virtual]


TinyXml: Member List

TiXmlAttribute Member List

This is the complete list of members for TiXmlAttribute, including all inherited members.

Column() const | TiXmlBase | [inline]
DoubleValue() const | TiXmlAttribute |
EncodeString(const TIXML_STRING &str, TIXML_STRING *out) | TiXmlBase | [static]
GetUserData() | TiXmlBase | [inline]
GetUserData() const | TiXmlBase | [inline]
IntValue() const | TiXmlAttribute |
IsWhiteSpaceCondensed() | TiXmlBase | [inline, static]
Name() const | TiXmlAttribute | [inline]
Next() const | TiXmlAttribute |
Previous() const | TiXmlAttribute |
Print(FILE *cfile, int depth) const | TiXmlAttribute | [inline, virtual]
QueryDoubleValue(double *_value) const | TiXmlAttribute |
QueryIntValue(int *_value) const | TiXmlAttribute |
Row() const | TiXmlBase | [inline]
SetCondenseWhiteSpace(bool condense) | TiXmlBase | [inline, static]
SetDoubleValue(double _value) | TiXmlAttribute |
SetIntValue(int _value) | TiXmlAttribute |
SetName(const char *_name) | TiXmlAttribute | [inline]
SetName(const std::string &_name) | TiXmlAttribute | [inline]
SetUserData(void *user) | TiXmlBase | [inline]
SetValue(const char *_value) | TiXmlAttribute | [inline]
SetValue(const std::string &_value) | TiXmlAttribute | [inline]
TiXmlAttribute() | TiXmlAttribute | [inline]
TiXmlAttribute(const std::string &_name, const std::string &_value) | TiXmlAttribute | [inline]
TiXmlAttribute(const char *_name, const char *_value) | TiXmlAttribute | [inline]
userData | TiXmlBase | [protected]
Value() const | TiXmlAttribute | [inline]
ValueStr() const | TiXmlAttribute | [inline]


TinyXml: Member List

TiXmlBase Member List

This is the complete list of members for TiXmlBase, including all inherited members.

Column() const | TiXmlBase | [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out) | TiXmlBase | [static]
GetUserData() | TiXmlBase | [inline]
GetUserData() const | TiXmlBase | [inline]
IsWhiteSpaceCondensed() | TiXmlBase | [inline, static]
Print(FILE *cfile, int depth) const =0 | TiXmlBase | [pure virtual]
Row() const | TiXmlBase | [inline]
SetCondenseWhiteSpace(bool condense) | TiXmlBase | [inline, static]
SetUserData(void *user) | TiXmlBase | [inline]
userData | TiXmlBase | [protected]


TinyXml: Member List

TiXmlComment Member List

This is the complete list of members for TiXmlComment, including all inherited members.

Accept(TiXmlVisitor *visitor) const | TiXmlComment | [virtual]
Clear() | TiXmlNode |
Clone() const | TiXmlComment | [virtual]
Column() const | TiXmlBase | [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out) | TiXmlBase | [static]
FirstChild() const | TiXmlNode | [inline]
FirstChild(const char *value) const | TiXmlNode |
FirstChild(const char *_value) | TiXmlNode | [inline]
FirstChild(const std::string &_value) const | TiXmlNode | [inline]
FirstChild(const std::string &_value) | TiXmlNode | [inline]
FirstChildElement() const | TiXmlNode |
FirstChildElement(const char *_value) const | TiXmlNode |
FirstChildElement(const std::string &_value) const | TiXmlNode | [inline]
FirstChildElement(const std::string &_value) | TiXmlNode | [inline]
GetDocument() const | TiXmlNode |
GetUserData() | TiXmlBase | [inline]
GetUserData() const | TiXmlBase | [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis) | TiXmlNode |
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis) | TiXmlNode |
InsertEndChild(const TiXmlNode &addThis) | TiXmlNode |
IsWhiteSpaceCondensed() | TiXmlBase | [inline, static]
IterateChildren(const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const char *value, const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const std::string &_value, const TiXmlNode *previous) const | TiXmlNode | [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous) | TiXmlNode | [inline]
LastChild() | TiXmlNode | [inline]
LastChild(const char *_value) | TiXmlNode | [inline]
LastChild(const std::string &_value) const | TiXmlNode | [inline]
LastChild(const std::string &_value) | TiXmlNode | [inline]
LinkEndChild(TiXmlNode *addThis) | TiXmlNode |
NextSibling(const std::string &_value) const | TiXmlNode | [inline]
NextSibling(const std::string &_value) | TiXmlNode | [inline]
NextSibling() const | TiXmlNode | [inline]
NextSibling(const char *) const | TiXmlNode |
NextSiblingElement() const | TiXmlNode |
NextSiblingElement(const char *) const | TiXmlNode |
NextSiblingElement(const std::string &_value) const | TiXmlNode | [inline]
NextSiblingElement(const std::string &_value) | TiXmlNode | [inline]
NoChildren() const | TiXmlNode | [inline]
NodeType enum name | TiXmlNode |
operator<<(std::ostream &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator<<(std::string &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator>>(std::istream &in, TiXmlNode &base) | TiXmlNode | [friend]
Parent() | TiXmlNode | [inline]
PreviousSibling() const | TiXmlNode | [inline]
PreviousSibling(const char *) const | TiXmlNode |
PreviousSibling(const std::string &_value) const | TiXmlNode | [inline]
PreviousSibling(const std::string &_value) | TiXmlNode | [inline]
Print(FILE *cfile, int depth) const | TiXmlComment | [virtual]
RemoveChild(TiXmlNode *removeThis) | TiXmlNode |
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis) | TiXmlNode |
Row() const | TiXmlBase | [inline]
SetCondenseWhiteSpace(bool condense) | TiXmlBase | [inline, static]
SetUserData(void *user) | TiXmlBase | [inline]
SetValue(const char *_value) | TiXmlNode | [inline]
SetValue(const std::string &_value) | TiXmlNode | [inline]
TiXmlComment() | TiXmlComment | [inline]
TiXmlComment(const char *_value) | TiXmlComment | [inline]
ToComment() const | TiXmlComment | [inline, virtual]
ToComment() | TiXmlComment | [inline, virtual]
ToDeclaration() const | TiXmlNode | [inline, virtual]
ToDeclaration() | TiXmlNode | [inline, virtual]
ToDocument() const | TiXmlNode | [inline, virtual]
ToDocument() | TiXmlNode | [inline, virtual]
ToElement() const | TiXmlNode | [inline, virtual]
ToElement() | TiXmlNode | [inline, virtual]
ToStylesheetReference() const | TiXmlNode | [inline, virtual]
ToStylesheetReference() | TiXmlNode | [inline, virtual]
ToText() const | TiXmlNode | [inline, virtual]
ToText() | TiXmlNode | [inline, virtual]
ToUnknown() const | TiXmlNode | [inline, virtual]
ToUnknown() | TiXmlNode | [inline, virtual]
Type() const | TiXmlNode | [inline]
userData | TiXmlBase | [protected]
Value() const | TiXmlNode | [inline]
ValueStr() const | TiXmlNode | [inline]


TinyXml: Member List

TiXmlDeclaration Member List

This is the complete list of members for TiXmlDeclaration, including all inherited members.

Accept(TiXmlVisitor *visitor) const | TiXmlDeclaration | [virtual]
Clear() | TiXmlNode |
Clone() const | TiXmlDeclaration | [virtual]
Column() const | TiXmlBase | [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out) | TiXmlBase | [static]
Encoding() const | TiXmlDeclaration | [inline]
FirstChild() const | TiXmlNode | [inline]
FirstChild(const char *value) const | TiXmlNode |
FirstChild(const char *_value) | TiXmlNode | [inline]
FirstChild(const std::string &_value) const | TiXmlNode | [inline]
FirstChild(const std::string &_value) | TiXmlNode | [inline]
FirstChildElement() const | TiXmlNode |
FirstChildElement(const char *_value) const | TiXmlNode |
FirstChildElement(const std::string &_value) const | TiXmlNode | [inline]
FirstChildElement(const std::string &_value) | TiXmlNode | [inline]
GetDocument() const | TiXmlNode |
GetUserData() | TiXmlBase | [inline]
GetUserData() const | TiXmlBase | [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis) | TiXmlNode |
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis) | TiXmlNode |
InsertEndChild(const TiXmlNode &addThis) | TiXmlNode |
IsWhiteSpaceCondensed() | TiXmlBase | [inline, static]
IterateChildren(const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const char *value, const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const std::string &_value, const TiXmlNode *previous) const | TiXmlNode | [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous) | TiXmlNode | [inline]
LastChild() | TiXmlNode | [inline]
LastChild(const char *_value) | TiXmlNode | [inline]
LastChild(const std::string &_value) const | TiXmlNode | [inline]
LastChild(const std::string &_value) | TiXmlNode | [inline]
LinkEndChild(TiXmlNode *addThis) | TiXmlNode |
NextSibling(const std::string &_value) const | TiXmlNode | [inline]
NextSibling(const std::string &_value) | TiXmlNode | [inline]
NextSibling() const | TiXmlNode | [inline]
NextSibling(const char *) const | TiXmlNode |
NextSiblingElement() const | TiXmlNode |
NextSiblingElement(const char *) const | TiXmlNode |
NextSiblingElement(const std::string &_value) const | TiXmlNode | [inline]
NextSiblingElement(const std::string &_value) | TiXmlNode | [inline]
NoChildren() const | TiXmlNode | [inline]
NodeType enum name | TiXmlNode |
operator<<(std::ostream &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator<<(std::string &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator>>(std::istream &in, TiXmlNode &base) | TiXmlNode | [friend]
Parent() | TiXmlNode | [inline]
PreviousSibling() const | TiXmlNode | [inline]
PreviousSibling(const char *) const | TiXmlNode |
PreviousSibling(const std::string &_value) const | TiXmlNode | [inline]
PreviousSibling(const std::string &_value) | TiXmlNode | [inline]
Print(FILE *cfile, int depth) const | TiXmlDeclaration | [inline, virtual]
RemoveChild(TiXmlNode *removeThis) | TiXmlNode |
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis) | TiXmlNode |
Row() const | TiXmlBase | [inline]
SetCondenseWhiteSpace(bool condense) | TiXmlBase | [inline, static]
SetUserData(void *user) | TiXmlBase | [inline]
SetValue(const char *_value) | TiXmlNode | [inline]
SetValue(const std::string &_value) | TiXmlNode | [inline]
Standalone() const | TiXmlDeclaration | [inline]
TiXmlDeclaration() | TiXmlDeclaration | [inline]
TiXmlDeclaration(const std::string &_version, const std::string &_encoding, const std::string &_standalone) | TiXmlDeclaration |
TiXmlDeclaration(const char *_version, const char *_encoding, const char *_standalone) | TiXmlDeclaration |
ToComment() const | TiXmlNode | [inline, virtual]
ToComment() | TiXmlNode | [inline, virtual]
ToDeclaration() const | TiXmlDeclaration | [inline, virtual]
ToDeclaration() | TiXmlDeclaration | [inline, virtual]
ToDocument() const | TiXmlNode | [inline, virtual]
ToDocument() | TiXmlNode | [inline, virtual]
ToElement() const | TiXmlNode | [inline, virtual]
ToElement() | TiXmlNode | [inline, virtual]
ToStylesheetReference() const | TiXmlNode | [inline, virtual]
ToStylesheetReference() | TiXmlNode | [inline, virtual]
ToText() const | TiXmlNode | [inline, virtual]
ToText() | TiXmlNode | [inline, virtual]
ToUnknown() const | TiXmlNode | [inline, virtual]
ToUnknown() | TiXmlNode | [inline, virtual]
Type() const | TiXmlNode | [inline]
userData | TiXmlBase | [protected]
Value() const | TiXmlNode | [inline]
ValueStr() const | TiXmlNode | [inline]
Version() const | TiXmlDeclaration | [inline]


TinyXml: Member List

TiXmlDocument Member List

This is the complete list of members for TiXmlDocument, including all inherited members.

Accept(TiXmlVisitor *content) const | TiXmlDocument | [virtual]
Clear() | TiXmlNode |
ClearError() | TiXmlDocument | [inline]
Clone() const | TiXmlDocument | [protected, virtual]
Column() const | TiXmlBase | [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out) | TiXmlBase | [static]
Error() const | TiXmlDocument | [inline]
ErrorCol() const | TiXmlDocument | [inline]
ErrorDesc() const | TiXmlDocument | [inline]
ErrorId() const | TiXmlDocument | [inline]
ErrorRow() const | TiXmlDocument | [inline]
FirstChild() const | TiXmlNode | [inline]
FirstChild(const char *value) const | TiXmlNode |
FirstChild(const char *_value) | TiXmlNode | [inline]
FirstChild(const std::string &_value) const | TiXmlNode | [inline]
FirstChild(const std::string &_value) | TiXmlNode | [inline]
FirstChildElement() const | TiXmlNode |
FirstChildElement(const char *_value) const | TiXmlNode |
FirstChildElement(const std::string &_value) const | TiXmlNode | [inline]
FirstChildElement(const std::string &_value) | TiXmlNode | [inline]
GetDocument() const | TiXmlNode |
GetUserData() | TiXmlBase | [inline]
GetUserData() const | TiXmlBase | [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis) | TiXmlNode |
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis) | TiXmlNode |
InsertEndChild(const TiXmlNode &addThis) | TiXmlNode |
IsWhiteSpaceCondensed() | TiXmlBase | [inline, static]
IterateChildren(const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const char *value, const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const std::string &_value, const TiXmlNode *previous) const | TiXmlNode | [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous) | TiXmlNode | [inline]
LastChild() | TiXmlNode | [inline]
LastChild(const char *_value) | TiXmlNode | [inline]
LastChild(const std::string &_value) const | TiXmlNode | [inline]
LastChild(const std::string &_value) | TiXmlNode | [inline]
LinkEndChild(TiXmlNode *addThis) | TiXmlNode |
LoadFile(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) | TiXmlDocument |
LoadFile(const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) | TiXmlDocument |
LoadFile(FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) | TiXmlDocument |
LoadFile(const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) | TiXmlDocument | [inline]
NextSibling(const std::string &_value) const | TiXmlNode | [inline]
NextSibling(const std::string &_value) | TiXmlNode | [inline]
NextSibling() const | TiXmlNode | [inline]
NextSibling(const char *) const | TiXmlNode |
NextSiblingElement() const | TiXmlNode |
NextSiblingElement(const char *) const | TiXmlNode |
NextSiblingElement(const std::string &_value) const | TiXmlNode | [inline]
NextSiblingElement(const std::string &_value) | TiXmlNode | [inline]
NoChildren() const | TiXmlNode | [inline]
NodeType enum name | TiXmlNode |
operator<<(std::ostream &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator<<(std::string &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator>>(std::istream &in, TiXmlNode &base) | TiXmlNode | [friend]
Parent() | TiXmlNode | [inline]
Parse(const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING) | TiXmlDocument | [virtual]
PreviousSibling() const | TiXmlNode | [inline]
PreviousSibling(const char *) const | TiXmlNode |
PreviousSibling(const std::string &_value) const | TiXmlNode | [inline]
PreviousSibling(const std::string &_value) | TiXmlNode | [inline]
Print() const | TiXmlDocument | [inline]
Print(FILE *cfile, int depth=0) const | TiXmlDocument | [virtual]
RemoveChild(TiXmlNode *removeThis) | TiXmlNode |
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis) | TiXmlNode |
RootElement() const | TiXmlDocument | [inline]
Row() const | TiXmlBase | [inline]
SaveFile() const | TiXmlDocument |
SaveFile(const char *filename) const | TiXmlDocument |
SaveFile(FILE *) const | TiXmlDocument |
SaveFile(const std::string &filename) const | TiXmlDocument | [inline]
SetCondenseWhiteSpace(bool condense) | TiXmlBase | [inline, static]
SetTabSize(int _tabsize) | TiXmlDocument | [inline]
SetUserData(void *user) | TiXmlBase | [inline]
SetValue(const char *_value) | TiXmlNode | [inline]
SetValue(const std::string &_value) | TiXmlNode | [inline]
TiXmlDocument() | TiXmlDocument |
TiXmlDocument(const char *documentName) | TiXmlDocument |
TiXmlDocument(const std::string &documentName) | TiXmlDocument |
ToComment() const | TiXmlNode | [inline, virtual]
ToComment() | TiXmlNode | [inline, virtual]
ToDeclaration() const | TiXmlNode | [inline, virtual]
ToDeclaration() | TiXmlNode | [inline, virtual]
ToDocument() const | TiXmlDocument | [inline, virtual]
ToDocument() | TiXmlDocument | [inline, virtual]
ToElement() const | TiXmlNode | [inline, virtual]
ToElement() | TiXmlNode | [inline, virtual]
ToStylesheetReference() const | TiXmlNode | [inline, virtual]
ToStylesheetReference() | TiXmlNode | [inline, virtual]
ToText() const | TiXmlNode | [inline, virtual]
ToText() | TiXmlNode | [inline, virtual]
ToUnknown() const | TiXmlNode | [inline, virtual]
ToUnknown() | TiXmlNode | [inline, virtual]
Type() const | TiXmlNode | [inline]
userData | TiXmlBase | [protected]
Value() const | TiXmlNode | [inline]
ValueStr() const | TiXmlNode | [inline]


TinyXml: Member List

TiXmlElement Member List

This is the complete list of members for TiXmlElement, including all inherited members.

Accept(TiXmlVisitor *visitor) const | TiXmlElement | [virtual]
Attribute(const char *name) const | TiXmlElement |
Attribute(const char *name, int *i) const | TiXmlElement |
Attribute(const char *name, double *d) const | TiXmlElement |
Clear() | TiXmlNode |
Clone() const | TiXmlElement | [virtual]
Column() const | TiXmlBase | [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out) | TiXmlBase | [static]
FirstAttribute() const | TiXmlElement | [inline]
FirstChild() const | TiXmlNode | [inline]
FirstChild(const char *value) const | TiXmlNode |
FirstChild(const char *_value) | TiXmlNode | [inline]
FirstChild(const std::string &_value) const | TiXmlNode | [inline]
FirstChild(const std::string &_value) | TiXmlNode | [inline]
FirstChildElement() const | TiXmlNode |
FirstChildElement(const char *_value) const | TiXmlNode |
FirstChildElement(const std::string &_value) const | TiXmlNode | [inline]
FirstChildElement(const std::string &_value) | TiXmlNode | [inline]
GetDocument() const | TiXmlNode |
GetText() const | TiXmlElement |
GetUserData() | TiXmlBase | [inline]
GetUserData() const | TiXmlBase | [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis) | TiXmlNode |
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis) | TiXmlNode |
InsertEndChild(const TiXmlNode &addThis) | TiXmlNode |
IsWhiteSpaceCondensed() | TiXmlBase | [inline, static]
IterateChildren(const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const char *value, const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const std::string &_value, const TiXmlNode *previous) const | TiXmlNode | [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous) | TiXmlNode | [inline]
LastAttribute() const | TiXmlElement | [inline]
LastChild() | TiXmlNode | [inline]
LastChild(const char *_value) | TiXmlNode | [inline]
LastChild(const std::string &_value) const | TiXmlNode | [inline]
LastChild(const std::string &_value) | TiXmlNode | [inline]
LinkEndChild(TiXmlNode *addThis) | TiXmlNode |
NextSibling(const std::string &_value) const | TiXmlNode | [inline]
NextSibling(const std::string &_value) | TiXmlNode | [inline]
NextSibling() const | TiXmlNode | [inline]
NextSibling(const char *) const | TiXmlNode |
NextSiblingElement() const | TiXmlNode |
NextSiblingElement(const char *) const | TiXmlNode |
NextSiblingElement(const std::string &_value) const | TiXmlNode | [inline]
NextSiblingElement(const std::string &_value) | TiXmlNode | [inline]
NoChildren() const | TiXmlNode | [inline]
NodeType enum name | TiXmlNode |
operator<<(std::ostream &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator<<(std::string &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator>>(std::istream &in, TiXmlNode &base) | TiXmlNode | [friend]
Parent() | TiXmlNode | [inline]
PreviousSibling() const | TiXmlNode | [inline]
PreviousSibling(const char *) const | TiXmlNode |
PreviousSibling(const std::string &_value) const | TiXmlNode | [inline]
PreviousSibling(const std::string &_value) | TiXmlNode | [inline]
Print(FILE *cfile, int depth) const | TiXmlElement | [virtual]
QueryDoubleAttribute(const char *name, double *_value) const | TiXmlElement |
QueryFloatAttribute(const char *name, float *_value) const | TiXmlElement | [inline]
QueryIntAttribute(const char *name, int *_value) const | TiXmlElement |
QueryValueAttribute(const std::string &name, T *outValue) const | TiXmlElement | [inline]
RemoveAttribute(const char *name) | TiXmlElement |
RemoveAttribute(const std::string &name) | TiXmlElement | [inline]
RemoveChild(TiXmlNode *removeThis) | TiXmlNode |
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis) | TiXmlNode |
Row() const | TiXmlBase | [inline]
SetAttribute(const char *name, const char *_value) | TiXmlElement |
SetAttribute(const std::string &name, const std::string &_value) | TiXmlElement |
SetAttribute(const char *name, int value) | TiXmlElement |
SetCondenseWhiteSpace(bool condense) | TiXmlBase | [inline, static]
SetDoubleAttribute(const char *name, double value) | TiXmlElement |
SetUserData(void *user) | TiXmlBase | [inline]
SetValue(const char *_value) | TiXmlNode | [inline]
SetValue(const std::string &_value) | TiXmlNode | [inline]
TiXmlElement(const char *in_value) | TiXmlElement |
TiXmlElement(const std::string &_value) | TiXmlElement |
ToComment() const | TiXmlNode | [inline, virtual]
ToComment() | TiXmlNode | [inline, virtual]
ToDeclaration() const | TiXmlNode | [inline, virtual]
ToDeclaration() | TiXmlNode | [inline, virtual]
ToDocument() const | TiXmlNode | [inline, virtual]
ToDocument() | TiXmlNode | [inline, virtual]
ToElement() const | TiXmlElement | [inline, virtual]
ToElement() | TiXmlElement | [inline, virtual]
ToStylesheetReference() const | TiXmlNode | [inline, virtual]
ToStylesheetReference() | TiXmlNode | [inline, virtual]
ToText() const | TiXmlNode | [inline, virtual]
ToText() | TiXmlNode | [inline, virtual]
ToUnknown() const | TiXmlNode | [inline, virtual]
ToUnknown() | TiXmlNode | [inline, virtual]
Type() const | TiXmlNode | [inline]
userData | TiXmlBase | [protected]
Value() const | TiXmlNode | [inline]
ValueStr() const | TiXmlNode | [inline]


TinyXml: Member List

TiXmlHandle Member List

This is the complete list of members for TiXmlHandle, including all inherited members.

Child(const char *value, int index) const | TiXmlHandle |
Child(int index) const | TiXmlHandle |
ChildElement(const char *value, int index) const | TiXmlHandle |
ChildElement(int index) const | TiXmlHandle |
Element() const | TiXmlHandle | [inline]
FirstChild() const | TiXmlHandle |
FirstChild(const char *value) const | TiXmlHandle |
FirstChildElement() const | TiXmlHandle |
FirstChildElement(const char *value) const | TiXmlHandle |
Node() const | TiXmlHandle | [inline]
Text() const | TiXmlHandle | [inline]
TiXmlHandle(TiXmlNode *_node) | TiXmlHandle | [inline]
TiXmlHandle(const TiXmlHandle &ref) | TiXmlHandle | [inline]
ToElement() const | TiXmlHandle | [inline]
ToNode() const | TiXmlHandle | [inline]
ToText() const | TiXmlHandle | [inline]
ToUnknown() const | TiXmlHandle | [inline]
Unknown() const | TiXmlHandle | [inline]


TinyXml: Member List

TiXmlNode Member List

This is the complete list of members for TiXmlNode, including all inherited members.

Accept(TiXmlVisitor *visitor) const =0 | TiXmlNode | [pure virtual]
Clear() | TiXmlNode |
Clone() const =0 | TiXmlNode | [pure virtual]
Column() const | TiXmlBase | [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out) | TiXmlBase | [static]
FirstChild() const | TiXmlNode | [inline]
FirstChild(const char *value) const | TiXmlNode |
FirstChild(const char *_value) | TiXmlNode | [inline]
FirstChild(const std::string &_value) const | TiXmlNode | [inline]
FirstChild(const std::string &_value) | TiXmlNode | [inline]
FirstChildElement() const | TiXmlNode |
FirstChildElement(const char *_value) const | TiXmlNode |
FirstChildElement(const std::string &_value) const | TiXmlNode | [inline]
FirstChildElement(const std::string &_value) | TiXmlNode | [inline]
GetDocument() const | TiXmlNode |
GetUserData() | TiXmlBase | [inline]
GetUserData() const | TiXmlBase | [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis) | TiXmlNode |
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis) | TiXmlNode |
InsertEndChild(const TiXmlNode &addThis) | TiXmlNode |
IsWhiteSpaceCondensed() | TiXmlBase | [inline, static]
IterateChildren(const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const char *value, const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const std::string &_value, const TiXmlNode *previous) const | TiXmlNode | [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous) | TiXmlNode | [inline]
LastChild() | TiXmlNode | [inline]
LastChild(const char *_value) | TiXmlNode | [inline]
LastChild(const std::string &_value) const | TiXmlNode | [inline]
LastChild(const std::string &_value) | TiXmlNode | [inline]
LinkEndChild(TiXmlNode *addThis) | TiXmlNode |
NextSibling(const std::string &_value) const | TiXmlNode | [inline]
NextSibling(const std::string &_value) | TiXmlNode | [inline]
NextSibling() const | TiXmlNode | [inline]
NextSibling(const char *) const | TiXmlNode |
NextSiblingElement() const | TiXmlNode |
NextSiblingElement(const char *) const | TiXmlNode |
NextSiblingElement(const std::string &_value) const | TiXmlNode | [inline]
NextSiblingElement(const std::string &_value) | TiXmlNode | [inline]
NoChildren() const | TiXmlNode | [inline]
NodeType enum name | TiXmlNode |
operator<<(std::ostream &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator<<(std::string &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator>>(std::istream &in, TiXmlNode &base) | TiXmlNode | [friend]
Parent() | TiXmlNode | [inline]
PreviousSibling() const | TiXmlNode | [inline]
PreviousSibling(const char *) const | TiXmlNode |
PreviousSibling(const std::string &_value) const | TiXmlNode | [inline]
PreviousSibling(const std::string &_value) | TiXmlNode | [inline]
Print(FILE *cfile, int depth) const =0 | TiXmlBase | [pure virtual]
RemoveChild(TiXmlNode *removeThis) | TiXmlNode |
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis) | TiXmlNode |
Row() const | TiXmlBase | [inline]
SetCondenseWhiteSpace(bool condense) | TiXmlBase | [inline, static]
SetUserData(void *user) | TiXmlBase | [inline]
SetValue(const char *_value) | TiXmlNode | [inline]
SetValue(const std::string &_value) | TiXmlNode | [inline]
ToComment() const | TiXmlNode | [inline, virtual]
ToComment() | TiXmlNode | [inline, virtual]
ToDeclaration() const | TiXmlNode | [inline, virtual]
ToDeclaration() | TiXmlNode | [inline, virtual]
ToDocument() const | TiXmlNode | [inline, virtual]
ToDocument() | TiXmlNode | [inline, virtual]
ToElement() const | TiXmlNode | [inline, virtual]
ToElement() | TiXmlNode | [inline, virtual]
ToStylesheetReference() const | TiXmlNode | [inline, virtual]
ToStylesheetReference() | TiXmlNode | [inline, virtual]
ToText() const | TiXmlNode | [inline, virtual]
ToText() | TiXmlNode | [inline, virtual]
ToUnknown() const | TiXmlNode | [inline, virtual]
ToUnknown() | TiXmlNode | [inline, virtual]
Type() const | TiXmlNode | [inline]
userData | TiXmlBase | [protected]
Value() const | TiXmlNode | [inline]
ValueStr() const | TiXmlNode | [inline]


TinyXml: Member List

TiXmlPrinter Member List

This is the complete list of members for TiXmlPrinter, including all inherited members.

CStr() | TiXmlPrinter | [inline]
Indent() | TiXmlPrinter | [inline]
LineBreak() | TiXmlPrinter | [inline]
SetIndent(const char *_indent) | TiXmlPrinter | [inline]
SetLineBreak(const char *_lineBreak) | TiXmlPrinter | [inline]
SetStreamPrinting() | TiXmlPrinter | [inline]
Size() | TiXmlPrinter | [inline]
Str() | TiXmlPrinter | [inline]
Visit(const TiXmlDeclaration &declaration) | TiXmlPrinter | [virtual]
Visit(const TiXmlText &text) | TiXmlPrinter | [virtual]
Visit(const TiXmlComment &comment) | TiXmlPrinter | [virtual]
Visit(const TiXmlUnknown &unknown) | TiXmlPrinter | [virtual]
TiXmlVisitor::Visit(const TiXmlStylesheetReference &) | TiXmlVisitor | [inline, virtual]
VisitEnter(const TiXmlDocument &doc) | TiXmlPrinter | [virtual]
VisitEnter(const TiXmlElement &element, const TiXmlAttribute *firstAttribute) | TiXmlPrinter | [virtual]
VisitExit(const TiXmlDocument &doc) | TiXmlPrinter | [virtual]
VisitExit(const TiXmlElement &element) | TiXmlPrinter | [virtual]


TinyXml: Member List

TiXmlStylesheetReference Member List

This is the complete list of members for TiXmlStylesheetReference, including all inherited members.

Accept(TiXmlVisitor *visitor) const | TiXmlStylesheetReference | [virtual]
Clear() | TiXmlNode |
Clone() const | TiXmlStylesheetReference | [virtual]
Column() const | TiXmlBase | [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out) | TiXmlBase | [static]
FirstChild() const | TiXmlNode | [inline]
FirstChild(const char *value) const | TiXmlNode |
FirstChild(const char *_value) | TiXmlNode | [inline]
FirstChild(const std::string &_value) const | TiXmlNode | [inline]
FirstChild(const std::string &_value) | TiXmlNode | [inline]
FirstChildElement() const | TiXmlNode |
FirstChildElement(const char *_value) const | TiXmlNode |
FirstChildElement(const std::string &_value) const | TiXmlNode | [inline]
FirstChildElement(const std::string &_value) | TiXmlNode | [inline]
GetDocument() const | TiXmlNode |
GetUserData() | TiXmlBase | [inline]
GetUserData() const | TiXmlBase | [inline]
Href() const | TiXmlStylesheetReference | [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis) | TiXmlNode |
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis) | TiXmlNode |
InsertEndChild(const TiXmlNode &addThis) | TiXmlNode |
IsWhiteSpaceCondensed() | TiXmlBase | [inline, static]
IterateChildren(const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const char *value, const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const std::string &_value, const TiXmlNode *previous) const | TiXmlNode | [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous) | TiXmlNode | [inline]
LastChild() | TiXmlNode | [inline]
LastChild(const char *_value) | TiXmlNode | [inline]
LastChild(const std::string &_value) const | TiXmlNode | [inline]
LastChild(const std::string &_value) | TiXmlNode | [inline]
LinkEndChild(TiXmlNode *addThis) | TiXmlNode |
NextSibling(const std::string &_value) const | TiXmlNode | [inline]
NextSibling(const std::string &_value) | TiXmlNode | [inline]
NextSibling() const | TiXmlNode | [inline]
NextSibling(const char *) const | TiXmlNode |
NextSiblingElement() const | TiXmlNode |
NextSiblingElement(const char *) const | TiXmlNode |
NextSiblingElement(const std::string &_value) const | TiXmlNode | [inline]
NextSiblingElement(const std::string &_value) | TiXmlNode | [inline]
NoChildren() const | TiXmlNode | [inline]
NodeType enum name | TiXmlNode |
operator<<(std::ostream &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator<<(std::string &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator>>(std::istream &in, TiXmlNode &base) | TiXmlNode | [friend]
Parent() | TiXmlNode | [inline]
PreviousSibling() const | TiXmlNode | [inline]
PreviousSibling(const char *) const | TiXmlNode |
PreviousSibling(const std::string &_value) const | TiXmlNode | [inline]
PreviousSibling(const std::string &_value) | TiXmlNode | [inline]
Print(FILE *cfile, int depth) const | TiXmlStylesheetReference | [inline, virtual]
RemoveChild(TiXmlNode *removeThis) | TiXmlNode |
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis) | TiXmlNode |
Row() const | TiXmlBase | [inline]
SetCondenseWhiteSpace(bool condense) | TiXmlBase | [inline, static]
SetUserData(void *user) | TiXmlBase | [inline]
SetValue(const char *_value) | TiXmlNode | [inline]
SetValue(const std::string &_value) | TiXmlNode | [inline]
TiXmlStylesheetReference() | TiXmlStylesheetReference | [inline]
TiXmlStylesheetReference(const std::string &_type, const std::string &_href) | TiXmlStylesheetReference |
TiXmlStylesheetReference(const char *_type, const char *_href) | TiXmlStylesheetReference |
ToComment() const | TiXmlNode | [inline, virtual]
ToComment() | TiXmlNode | [inline, virtual]
ToDeclaration() const | TiXmlNode | [inline, virtual]
ToDeclaration() | TiXmlNode | [inline, virtual]
ToDocument() const | TiXmlNode | [inline, virtual]
ToDocument() | TiXmlNode | [inline, virtual]
ToElement() const | TiXmlNode | [inline, virtual]
ToElement() | TiXmlNode | [inline, virtual]
ToStylesheetReference() const | TiXmlStylesheetReference | [inline, virtual]
ToStylesheetReference() | TiXmlStylesheetReference | [inline, virtual]
ToText() const | TiXmlNode | [inline, virtual]
ToText() | TiXmlNode | [inline, virtual]
ToUnknown() const | TiXmlNode | [inline, virtual]
ToUnknown() | TiXmlNode | [inline, virtual]
Type() const | TiXmlStylesheetReference | [inline]
userData | TiXmlBase | [protected]
Value() const | TiXmlNode | [inline]
ValueStr() const | TiXmlNode | [inline]


TinyXml: Member List

TiXmlText Member List

This is the complete list of members for TiXmlText, including all inherited members.

Accept(TiXmlVisitor *content) const | TiXmlText | [virtual]
CDATA() const | TiXmlText | [inline]
Clear() | TiXmlNode |
Clone() const | TiXmlText | [protected, virtual]
Column() const | TiXmlBase | [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out) | TiXmlBase | [static]
FirstChild() const | TiXmlNode | [inline]
FirstChild(const char *value) const | TiXmlNode |
FirstChild(const char *_value) | TiXmlNode | [inline]
FirstChild(const std::string &_value) const | TiXmlNode | [inline]
FirstChild(const std::string &_value) | TiXmlNode | [inline]
FirstChildElement() const | TiXmlNode |
FirstChildElement(const char *_value) const | TiXmlNode |
FirstChildElement(const std::string &_value) const | TiXmlNode | [inline]
FirstChildElement(const std::string &_value) | TiXmlNode | [inline]
GetDocument() const | TiXmlNode |
GetUserData() | TiXmlBase | [inline]
GetUserData() const | TiXmlBase | [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis) | TiXmlNode |
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis) | TiXmlNode |
InsertEndChild(const TiXmlNode &addThis) | TiXmlNode |
IsWhiteSpaceCondensed() | TiXmlBase | [inline, static]
IterateChildren(const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const char *value, const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const std::string &_value, const TiXmlNode *previous) const | TiXmlNode | [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous) | TiXmlNode | [inline]
LastChild() | TiXmlNode | [inline]
LastChild(const char *_value) | TiXmlNode | [inline]
LastChild(const std::string &_value) const | TiXmlNode | [inline]
LastChild(const std::string &_value) | TiXmlNode | [inline]
LinkEndChild(TiXmlNode *addThis) | TiXmlNode |
NextSibling(const std::string &_value) const | TiXmlNode | [inline]
NextSibling(const std::string &_value) | TiXmlNode | [inline]
NextSibling() const | TiXmlNode | [inline]
NextSibling(const char *) const | TiXmlNode |
NextSiblingElement() const | TiXmlNode |
NextSiblingElement(const char *) const | TiXmlNode |
NextSiblingElement(const std::string &_value) const | TiXmlNode | [inline]
NextSiblingElement(const std::string &_value) | TiXmlNode | [inline]
NoChildren() const | TiXmlNode | [inline]
NodeType enum name | TiXmlNode |
operator<<(std::ostream &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator<<(std::string &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator>>(std::istream &in, TiXmlNode &base) | TiXmlNode | [friend]
Parent() | TiXmlNode | [inline]
PreviousSibling() const | TiXmlNode | [inline]
PreviousSibling(const char *) const | TiXmlNode |
PreviousSibling(const std::string &_value) const | TiXmlNode | [inline]
PreviousSibling(const std::string &_value) | TiXmlNode | [inline]
Print(FILE *cfile, int depth) const | TiXmlText | [virtual]
RemoveChild(TiXmlNode *removeThis) | TiXmlNode |
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis) | TiXmlNode |
Row() const | TiXmlBase | [inline]
SetCDATA(bool _cdata) | TiXmlText | [inline]
SetCondenseWhiteSpace(bool condense) | TiXmlBase | [inline, static]
SetUserData(void *user) | TiXmlBase | [inline]
SetValue(const char *_value) | TiXmlNode | [inline]
SetValue(const std::string &_value) | TiXmlNode | [inline]
TiXmlText(const char *initValue) | TiXmlText | [inline]
TiXmlText(const std::string &initValue) | TiXmlText | [inline]
ToComment() const | TiXmlNode | [inline, virtual]
ToComment() | TiXmlNode | [inline, virtual]
ToDeclaration() const | TiXmlNode | [inline, virtual]
ToDeclaration() | TiXmlNode | [inline, virtual]
ToDocument() const | TiXmlNode | [inline, virtual]
ToDocument() | TiXmlNode | [inline, virtual]
ToElement() const | TiXmlNode | [inline, virtual]
ToElement() | TiXmlNode | [inline, virtual]
ToStylesheetReference() const | TiXmlNode | [inline, virtual]
ToStylesheetReference() | TiXmlNode | [inline, virtual]
ToText() const | TiXmlText | [inline, virtual]
ToText() | TiXmlText | [inline, virtual]
ToUnknown() const | TiXmlNode | [inline, virtual]
ToUnknown() | TiXmlNode | [inline, virtual]
Type() const | TiXmlNode | [inline]
userData | TiXmlBase | [protected]
Value() const | TiXmlNode | [inline]
ValueStr() const | TiXmlNode | [inline]


TinyXml: Member List

TiXmlUnknown Member List

This is the complete list of members for TiXmlUnknown, including all inherited members.

Accept(TiXmlVisitor *content) const | TiXmlUnknown | [virtual]
Clear() | TiXmlNode |
Clone() const | TiXmlUnknown | [virtual]
Column() const | TiXmlBase | [inline]
EncodeString(const TIXML_STRING &str, TIXML_STRING *out) | TiXmlBase | [static]
FirstChild() const | TiXmlNode | [inline]
FirstChild(const char *value) const | TiXmlNode |
FirstChild(const char *_value) | TiXmlNode | [inline]
FirstChild(const std::string &_value) const | TiXmlNode | [inline]
FirstChild(const std::string &_value) | TiXmlNode | [inline]
FirstChildElement() const | TiXmlNode |
FirstChildElement(const char *_value) const | TiXmlNode |
FirstChildElement(const std::string &_value) const | TiXmlNode | [inline]
FirstChildElement(const std::string &_value) | TiXmlNode | [inline]
GetDocument() const | TiXmlNode |
GetUserData() | TiXmlBase | [inline]
GetUserData() const | TiXmlBase | [inline]
InsertAfterChild(TiXmlNode *afterThis, const TiXmlNode &addThis) | TiXmlNode |
InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis) | TiXmlNode |
InsertEndChild(const TiXmlNode &addThis) | TiXmlNode |
IsWhiteSpaceCondensed() | TiXmlBase | [inline, static]
IterateChildren(const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const char *value, const TiXmlNode *previous) const | TiXmlNode |
IterateChildren(const std::string &_value, const TiXmlNode *previous) const | TiXmlNode | [inline]
IterateChildren(const std::string &_value, const TiXmlNode *previous) | TiXmlNode | [inline]
LastChild() | TiXmlNode | [inline]
LastChild(const char *_value) | TiXmlNode | [inline]
LastChild(const std::string &_value) const | TiXmlNode | [inline]
LastChild(const std::string &_value) | TiXmlNode | [inline]
LinkEndChild(TiXmlNode *addThis) | TiXmlNode |
NextSibling(const std::string &_value) const | TiXmlNode | [inline]
NextSibling(const std::string &_value) | TiXmlNode | [inline]
NextSibling() const | TiXmlNode | [inline]
NextSibling(const char *) const | TiXmlNode |
NextSiblingElement() const | TiXmlNode |
NextSiblingElement(const char *) const | TiXmlNode |
NextSiblingElement(const std::string &_value) const | TiXmlNode | [inline]
NextSiblingElement(const std::string &_value) | TiXmlNode | [inline]
NoChildren() const | TiXmlNode | [inline]
NodeType enum name | TiXmlNode |
operator<<(std::ostream &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator<<(std::string &out, const TiXmlNode &base) | TiXmlNode | [friend]
operator>>(std::istream &in, TiXmlNode &base) | TiXmlNode | [friend]
Parent() | TiXmlNode | [inline]
PreviousSibling() const | TiXmlNode | [inline]
PreviousSibling(const char *) const | TiXmlNode |
PreviousSibling(const std::string &_value) const | TiXmlNode | [inline]
PreviousSibling(const std::string &_value) | TiXmlNode | [inline]
Print(FILE *cfile, int depth) const | TiXmlUnknown | [virtual]
RemoveChild(TiXmlNode *removeThis) | TiXmlNode |
ReplaceChild(TiXmlNode *replaceThis, const TiXmlNode &withThis) | TiXmlNode |
Row() const | TiXmlBase | [inline]
SetCondenseWhiteSpace(bool condense) | TiXmlBase | [inline, static]
SetUserData(void *user) | TiXmlBase | [inline]
SetValue(const char *_value) | TiXmlNode | [inline]
SetValue(const std::string &_value) | TiXmlNode | [inline]
ToComment() const | TiXmlNode | [inline, virtual]
ToComment() | TiXmlNode | [inline, virtual]
ToDeclaration() const | TiXmlNode | [inline, virtual]
ToDeclaration() | TiXmlNode | [inline, virtual]
ToDocument() const | TiXmlNode | [inline, virtual]
ToDocument() | TiXmlNode | [inline, virtual]
ToElement() const | TiXmlNode | [inline, virtual]
ToElement() | TiXmlNode | [inline, virtual]
ToStylesheetReference() const | TiXmlNode | [inline, virtual]
ToStylesheetReference() | TiXmlNode | [inline, virtual]
ToText() const | TiXmlNode | [inline, virtual]
ToText() | TiXmlNode | [inline, virtual]
ToUnknown() const | TiXmlUnknown | [inline, virtual]
ToUnknown() | TiXmlUnknown | [inline, virtual]
Type() const | TiXmlNode | [inline]
userData | TiXmlBase | [protected]
Value() const | TiXmlNode | [inline]
ValueStr() const | TiXmlNode | [inline]


TinyXml: Member List

TiXmlVisitor Member List

This is the complete list of members for TiXmlVisitor, including all inherited members.

Visit(const TiXmlDeclaration &) | TiXmlVisitor | [inline, virtual]
Visit(const TiXmlStylesheetReference &) | TiXmlVisitor | [inline, virtual]
Visit(const TiXmlText &) | TiXmlVisitor | [inline, virtual]
Visit(const TiXmlComment &) | TiXmlVisitor | [inline, virtual]
Visit(const TiXmlUnknown &) | TiXmlVisitor | [inline, virtual]
VisitEnter(const TiXmlDocument &) | TiXmlVisitor | [inline, virtual]
VisitEnter(const TiXmlElement &, const TiXmlAttribute *) | TiXmlVisitor | [inline, virtual]
VisitExit(const TiXmlDocument &) | TiXmlVisitor | [inline, virtual]
VisitExit(const TiXmlElement &) | TiXmlVisitor | [inline, virtual]


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- l -

  • LastAttribute() : ticpp::Element , TiXmlElement
  • LastChild() : ticpp::Node , TiXmlNode , ticpp::Node , TiXmlNode
  • LineBreak() : TiXmlPrinter
  • LinkEndChild() : TiXmlNode , ticpp::Node
  • LoadFile() : TiXmlDocument , ticpp::Document , TiXmlDocument , ticpp::Document , TiXmlDocument
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- m -

  • m_details : ticpp::Exception
  • m_impRC : ticpp::Base
  • m_spawnedWrappers : ticpp::Base
  • m_tiXmlPointer : ticpp::NodeImp< T >


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- n -

  • Name() : ticpp::Attribute , TiXmlAttribute
  • Next() : TiXmlAttribute , ticpp::Attribute
  • NextSibling() : TiXmlNode , ticpp::Node , TiXmlNode , ticpp::Node , TiXmlNode
  • NextSiblingElement() : ticpp::Node , TiXmlNode , ticpp::Node
  • NoChildren() : TiXmlNode , ticpp::Node
  • Node() : TiXmlHandle
  • NodeType : TiXmlNode


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- o -

  • operator *() : ticpp::Iterator< T >
  • operator!=() : ticpp::Iterator< T >
  • operator++() : ticpp::Iterator< T >
  • operator--() : ticpp::Iterator< T >
  • operator->() : ticpp::Iterator< T >
  • operator<< : TiXmlNode , ticpp::Node , TiXmlNode
  • operator=() : ticpp::Iterator< T >
  • operator==() : ticpp::Iterator< T >
  • operator>> : ticpp::Node , TiXmlNode


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- ~ -

  • ~Base() : ticpp::Base
  • ~TiCppRC() : TiCppRC


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- b -

  • begin() : ticpp::Iterator< T >
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- c -

  • CDATA() : TiXmlText
  • Child() : TiXmlHandle
  • ChildElement() : TiXmlHandle
  • Clear() : ticpp::Node , TiXmlNode
  • ClearError() : TiXmlDocument
  • Clone() : TiXmlUnknown , TiXmlStylesheetReference , TiXmlDocument , ticpp::Node , TiXmlNode , TiXmlElement , TiXmlComment , TiXmlText , TiXmlDeclaration
  • Column() : TiXmlBase , ticpp::Base
  • Comment() : ticpp::Comment
  • CStr() : TiXmlPrinter
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- d -

  • Declaration() : ticpp::Declaration
  • Document() : ticpp::Document
  • DoubleValue() : TiXmlAttribute
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- e -

  • Element() : ticpp::Element , TiXmlHandle
  • EncodeString() : TiXmlBase
  • Encoding() : ticpp::Declaration , TiXmlDeclaration
  • end() : ticpp::Iterator< T >
  • Error() : TiXmlDocument
  • ErrorCol() : TiXmlDocument
  • ErrorDesc() : TiXmlDocument
  • ErrorId() : TiXmlDocument
  • ErrorRow() : TiXmlDocument
  • Exception() : ticpp::Exception
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- f -

  • FirstAttribute() : ticpp::Element , TiXmlElement
  • FirstChild() : ticpp::Node , TiXmlNode , TiXmlHandle , ticpp::Node , TiXmlNode
  • FirstChildElement() : TiXmlNode , TiXmlHandle , TiXmlNode , TiXmlHandle , ticpp::Node , TiXmlNode , ticpp::Node
  • FromString() : ticpp::Base
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- g -

  • Get() : ticpp::Iterator< T >
  • GetAttribute() : ticpp::Element
  • GetAttributeOrDefault() : ticpp::Element
  • GetDocument() : ticpp::Node , TiXmlNode
  • GetName() : ticpp::Attribute
  • GetText() : TiXmlElement , ticpp::Element
  • GetTextOrDefault() : ticpp::Element
  • GetUserData() : TiXmlBase
  • GetValue()
: ticpp::Attribute
, ticpp::Node
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- h -

  • Href() : ticpp::StylesheetReference , TiXmlStylesheetReference
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- i -

  • Indent() : TiXmlPrinter
  • InsertAfterChild() : ticpp::Node , TiXmlNode
  • InsertBeforeChild() : ticpp::Node , TiXmlNode
  • InsertEndChild() : ticpp::Node , TiXmlNode
  • IntValue() : TiXmlAttribute
  • IsWhiteSpaceCondensed() : TiXmlBase
  • IterateChildren() : ticpp::Node , TiXmlNode , ticpp::Node , TiXmlNode
  • Iterator() : ticpp::Iterator< T >
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- p -

  • Parent() : ticpp::Node , TiXmlNode
  • Parse() : TiXmlDocument , ticpp::Document
  • Previous() : ticpp::Attribute , TiXmlAttribute
  • PreviousSibling() : ticpp::Node , TiXmlNode , ticpp::Node
  • Print() : TiXmlUnknown , TiXmlComment , TiXmlDocument , TiXmlStylesheetReference , TiXmlDocument , TiXmlBase , TiXmlDeclaration , TiXmlElement , TiXmlText , ticpp::Attribute , TiXmlAttribute


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- q -

  • QueryDoubleAttribute() : TiXmlElement
  • QueryDoubleValue() : TiXmlAttribute
  • QueryFloatAttribute() : TiXmlElement
  • QueryIntAttribute() : TiXmlElement
  • QueryIntValue() : TiXmlAttribute
  • QueryValueAttribute() : TiXmlElement


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- r -

  • RemoveAttribute() : TiXmlElement
  • RemoveChild() : TiXmlNode , ticpp::Node
  • ReplaceChild() : ticpp::Node , TiXmlNode
  • RootElement() : TiXmlDocument
  • Row() : ticpp::Base , TiXmlBase


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- s -

  • SaveFile() : ticpp::Document , TiXmlDocument
  • SetAttribute() : TiXmlElement , ticpp::Element
  • SetCDATA() : TiXmlText
  • SetCondenseWhiteSpace() : TiXmlBase
  • SetDoubleAttribute() : TiXmlElement
  • SetDoubleValue() : TiXmlAttribute
  • SetIndent() : TiXmlPrinter
  • SetIntValue() : TiXmlAttribute
  • SetLineBreak() : TiXmlPrinter
  • SetName() : ticpp::Attribute , TiXmlAttribute
  • SetStreamPrinting() : TiXmlPrinter
  • SetTabSize() : TiXmlDocument
  • SetText() : ticpp::Element
  • SetUserData() : TiXmlBase
  • SetValue() : TiXmlNode , TiXmlAttribute , ticpp::Node , TiXmlNode , ticpp::Attribute
  • Size() : TiXmlPrinter
  • Standalone() : TiXmlDeclaration , ticpp::Declaration
  • Str() : TiXmlPrinter
  • StylesheetReference() : ticpp::StylesheetReference


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- t -

  • Text() : ticpp::Text , TiXmlHandle , ticpp::Text
  • TiCppRC() : TiCppRC
  • TiXmlAttribute() : TiXmlAttribute
  • TiXmlComment() : TiXmlComment
  • TiXmlDeclaration() : TiXmlDeclaration
  • TiXmlDocument() : TiXmlDocument
  • TiXmlElement() : TiXmlElement
  • TiXmlHandle() : TiXmlHandle
  • TiXmlStylesheetReference() : TiXmlStylesheetReference
  • TiXmlText() : TiXmlText
  • To() : ticpp::Node
  • ToComment() : TiXmlComment , ticpp::Node , TiXmlNode , TiXmlComment
  • ToDeclaration() : ticpp::Node , TiXmlNode , TiXmlDeclaration
  • ToDocument() : TiXmlNode , ticpp::Node , TiXmlNode , TiXmlDocument
  • ToElement() : TiXmlNode , TiXmlElement , TiXmlHandle , TiXmlElement , ticpp::Node
  • ToNode() : TiXmlHandle
  • ToString() : ticpp::Base
  • ToStylesheetReference() : TiXmlStylesheetReference , TiXmlNode , ticpp::Node
  • ToText() : TiXmlHandle , TiXmlNode , ticpp::Node , TiXmlNode , TiXmlText
  • ToUnknown() : TiXmlNode , TiXmlUnknown , TiXmlHandle , TiXmlUnknown , TiXmlNode
  • Type() : ticpp::Node , TiXmlNode , TiXmlStylesheetReference , ticpp::StylesheetReference


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- u -

  • Unknown() : TiXmlHandle
  • userData : TiXmlBase


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- v -

  • Value()
: ticpp::Attribute
, ticpp::Node
, TiXmlAttribute
, TiXmlNode
  • ValueStr() : TiXmlNode , TiXmlAttribute
  • Version() : TiXmlDeclaration , ticpp::Declaration
  • Visit() : ticpp::Visitor , TiXmlVisitor , ticpp::Visitor , TiXmlVisitor , ticpp::Visitor , TiXmlVisitor , ticpp::Visitor , TiXmlPrinter , ticpp::Visitor , TiXmlPrinter , ticpp::Visitor
  • VisitEnter() : TiXmlVisitor , TiXmlPrinter , ticpp::Visitor , TiXmlVisitor , ticpp::Visitor
  • VisitExit() : TiXmlPrinter , TiXmlVisitor , ticpp::Visitor , TiXmlVisitor , TiXmlPrinter , ticpp::Visitor


TinyXml: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- w -

  • what() : ticpp::Exception


TinyXml: Class Members - Enumerations

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions

  • NodeType : TiXmlNode


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- a -

  • Accept() : ticpp::Node , TiXmlNode , TiXmlComment , TiXmlUnknown , TiXmlDocument , TiXmlText , TiXmlElement , TiXmlDeclaration , TiXmlStylesheetReference
  • Attribute() : TiXmlElement , ticpp::Attribute , TiXmlElement , ticpp::Attribute


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- l -

  • LastAttribute() : ticpp::Element , TiXmlElement
  • LastChild() : ticpp::Node , TiXmlNode , ticpp::Node , TiXmlNode
  • LineBreak() : TiXmlPrinter
  • LinkEndChild() : TiXmlNode , ticpp::Node
  • LoadFile() : TiXmlDocument , ticpp::Document , TiXmlDocument , ticpp::Document , TiXmlDocument


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- n -

  • Name() : ticpp::Attribute , TiXmlAttribute
  • Next() : TiXmlAttribute , ticpp::Attribute
  • NextSibling() : TiXmlNode , ticpp::Node , TiXmlNode , ticpp::Node , TiXmlNode
  • NextSiblingElement() : TiXmlNode , ticpp::Node
  • NoChildren() : TiXmlNode , ticpp::Node
  • Node() : TiXmlHandle


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- o -

  • operator *() : ticpp::Iterator< T >
  • operator!=() : ticpp::Iterator< T >
  • operator++() : ticpp::Iterator< T >
  • operator--() : ticpp::Iterator< T >
  • operator->() : ticpp::Iterator< T >
  • operator=() : ticpp::Iterator< T >
  • operator==() : ticpp::Iterator< T >


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- ~ -

  • ~Base() : ticpp::Base
  • ~TiCppRC() : TiCppRC


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- b -

  • begin() : ticpp::Iterator< T >


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- c -

  • CDATA() : TiXmlText
  • Child() : TiXmlHandle
  • ChildElement() : TiXmlHandle
  • Clear() : ticpp::Node , TiXmlNode
  • ClearError() : TiXmlDocument
  • Clone() : TiXmlUnknown , TiXmlStylesheetReference , TiXmlDocument , ticpp::Node , TiXmlNode , TiXmlElement , TiXmlComment , TiXmlText , TiXmlDeclaration
  • Column() : TiXmlBase , ticpp::Base
  • Comment() : ticpp::Comment
  • CStr() : TiXmlPrinter


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- d -

  • Declaration() : ticpp::Declaration
  • Document() : ticpp::Document
  • DoubleValue() : TiXmlAttribute


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- e -

  • Element() : ticpp::Element , TiXmlHandle
  • EncodeString() : TiXmlBase
  • Encoding() : ticpp::Declaration , TiXmlDeclaration
  • end() : ticpp::Iterator< T >
  • Error() : TiXmlDocument
  • ErrorCol() : TiXmlDocument
  • ErrorDesc() : TiXmlDocument
  • ErrorId() : TiXmlDocument
  • ErrorRow() : TiXmlDocument
  • Exception() : ticpp::Exception


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- f -

  • FirstAttribute() : ticpp::Element , TiXmlElement
  • FirstChild() : ticpp::Node , TiXmlNode , TiXmlHandle , ticpp::Node , TiXmlNode
  • FirstChildElement() : TiXmlNode , TiXmlHandle , TiXmlNode , TiXmlHandle , ticpp::Node , TiXmlNode , ticpp::Node
  • FromString() : ticpp::Base


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- g -

  • Get() : ticpp::Iterator< T >
  • GetAttribute() : ticpp::Element
  • GetAttributeOrDefault() : ticpp::Element
  • GetDocument() : ticpp::Node , TiXmlNode
  • GetName() : ticpp::Attribute
  • GetText() : TiXmlElement , ticpp::Element
  • GetTextOrDefault() : ticpp::Element
  • GetUserData() : TiXmlBase
  • GetValue()
: ticpp::Attribute
, ticpp::Node


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- h -

  • Href() : ticpp::StylesheetReference , TiXmlStylesheetReference


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- i -

  • Indent() : TiXmlPrinter
  • InsertAfterChild() : ticpp::Node , TiXmlNode
  • InsertBeforeChild() : ticpp::Node , TiXmlNode
  • InsertEndChild() : ticpp::Node , TiXmlNode
  • IntValue() : TiXmlAttribute
  • IsWhiteSpaceCondensed() : TiXmlBase
  • IterateChildren() : ticpp::Node , TiXmlNode , ticpp::Node , TiXmlNode
  • Iterator() : ticpp::Iterator< T >


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- p -

  • Parent() : ticpp::Node , TiXmlNode
  • Parse() : TiXmlDocument , ticpp::Document
  • Previous() : ticpp::Attribute , TiXmlAttribute
  • PreviousSibling() : ticpp::Node , TiXmlNode , ticpp::Node
  • Print() : TiXmlUnknown , TiXmlComment , TiXmlDocument , TiXmlStylesheetReference , TiXmlDocument , TiXmlBase , TiXmlDeclaration , TiXmlElement , TiXmlText , ticpp::Attribute , TiXmlAttribute


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- q -

  • QueryDoubleAttribute() : TiXmlElement
  • QueryDoubleValue() : TiXmlAttribute
  • QueryFloatAttribute() : TiXmlElement
  • QueryIntAttribute() : TiXmlElement
  • QueryIntValue() : TiXmlAttribute
  • QueryValueAttribute() : TiXmlElement


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- r -

  • RemoveAttribute() : TiXmlElement
  • RemoveChild() : TiXmlNode , ticpp::Node
  • ReplaceChild() : ticpp::Node , TiXmlNode
  • RootElement() : TiXmlDocument
  • Row() : ticpp::Base , TiXmlBase


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- s -

  • SaveFile() : ticpp::Document , TiXmlDocument
  • SetAttribute() : TiXmlElement , ticpp::Element
  • SetCDATA() : TiXmlText
  • SetCondenseWhiteSpace() : TiXmlBase
  • SetDoubleAttribute() : TiXmlElement
  • SetDoubleValue() : TiXmlAttribute
  • SetIndent() : TiXmlPrinter
  • SetIntValue() : TiXmlAttribute
  • SetLineBreak() : TiXmlPrinter
  • SetName() : ticpp::Attribute , TiXmlAttribute
  • SetStreamPrinting() : TiXmlPrinter
  • SetTabSize() : TiXmlDocument
  • SetText() : ticpp::Element
  • SetUserData() : TiXmlBase
  • SetValue() : TiXmlNode , TiXmlAttribute , ticpp::Node , TiXmlNode , ticpp::Attribute
  • Size() : TiXmlPrinter
  • Standalone() : TiXmlDeclaration , ticpp::Declaration
  • Str() : TiXmlPrinter
  • StylesheetReference() : ticpp::StylesheetReference


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- t -

  • Text() : ticpp::Text , TiXmlHandle , ticpp::Text
  • TiCppRC() : TiCppRC
  • TiXmlAttribute() : TiXmlAttribute
  • TiXmlComment() : TiXmlComment
  • TiXmlDeclaration() : TiXmlDeclaration
  • TiXmlDocument() : TiXmlDocument
  • TiXmlElement() : TiXmlElement
  • TiXmlHandle() : TiXmlHandle
  • TiXmlStylesheetReference() : TiXmlStylesheetReference
  • TiXmlText() : TiXmlText
  • To() : ticpp::Node
  • ToComment() : TiXmlComment , ticpp::Node , TiXmlNode , TiXmlComment
  • ToDeclaration() : ticpp::Node , TiXmlNode , TiXmlDeclaration
  • ToDocument() : TiXmlNode , ticpp::Node , TiXmlNode , TiXmlDocument
  • ToElement() : TiXmlNode , TiXmlElement , TiXmlHandle , TiXmlElement , ticpp::Node
  • ToNode() : TiXmlHandle
  • ToString() : ticpp::Base
  • ToStylesheetReference() : TiXmlStylesheetReference , TiXmlNode , ticpp::Node
  • ToText() : TiXmlHandle , TiXmlNode , ticpp::Node , TiXmlNode , TiXmlText
  • ToUnknown() : TiXmlNode , TiXmlUnknown , TiXmlHandle , TiXmlUnknown , TiXmlNode
  • Type() : ticpp::Node , TiXmlNode , TiXmlStylesheetReference , ticpp::StylesheetReference


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- u -

  • Unknown() : TiXmlHandle


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- v -

  • Value()
: ticpp::Attribute
, ticpp::Node
, TiXmlAttribute
, TiXmlNode
  • ValueStr() : TiXmlNode , TiXmlAttribute
  • Version() : TiXmlDeclaration , ticpp::Declaration
  • Visit() : ticpp::Visitor , TiXmlVisitor , ticpp::Visitor , TiXmlVisitor , ticpp::Visitor , TiXmlVisitor , ticpp::Visitor , TiXmlPrinter , ticpp::Visitor , TiXmlPrinter , ticpp::Visitor
  • VisitEnter() : TiXmlVisitor , TiXmlPrinter , ticpp::Visitor , TiXmlVisitor , ticpp::Visitor
  • VisitExit() : TiXmlPrinter , TiXmlVisitor , ticpp::Visitor , TiXmlVisitor , TiXmlPrinter , ticpp::Visitor


TinyXml: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • l
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- w -

  • what() : ticpp::Exception


TinyXml: Class Members - Related Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions

  • operator<< : ticpp::Node , TiXmlNode
  • operator>> : ticpp::Node , TiXmlNode


TinyXml: Class Members - Variables

  • All
  • Functions
  • Variables
  • Enumerations
  • Related Functions

  • m_details : ticpp::Exception
  • m_impRC : ticpp::Base
  • m_spawnedWrappers : ticpp::Base
  • m_tiXmlPointer : ticpp::NodeImp< T >
  • userData : TiXmlBase


TinyXml: ticpp.h Source File

ticpp.h

Go to the documentation of this file.
00001 /*
00002 http://code.google.com/p/ticpp/
00003 Copyright (c) 2006 Ryan Pusztai, Ryan Mulder
00004
00005 Permission is hereby granted, free of charge, to any person obtaining a copy of
00006 this software and associated documentation files (the "Software"), to deal in
00007 the Software without restriction, including without limitation the rights to
00008 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
00009 the Software, and to permit persons to whom the Software is furnished to do so,
00010 subject to the following conditions:
00011
00012 The above copyright notice and this permission notice shall be included in all
00013 copies or substantial portions of the Software.
00014
00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
00017 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
00018 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
00019 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00020 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00021 */
00022
00041 #ifdef TIXML_USE_TICPP
00042
00043 #ifndef TICPP_INCLUDED
00044 #define TICPP_INCLUDED
00045
00046 #include "tinyxml.h"
00047 #include <sstream>
00048 #include <vector>
00049 #include <memory>
00050 #include <exception>
00051
00062 namespace ticpp
00063 {
00067     class Exception : public std::exception
00068     {
00069     public:
00073         Exception( const std::string& details );
00074         ~Exception() throw();
00075
00077         const char* what() const throw();
00078
00079         std::string m_details;
00080     };
00081
00086     #define TICPPTHROW( message )                                           \
00087     {                                                                       \
00088         std::ostringstream full_message;                                    \
00089         std::string file( __FILE__ );                                       \
00090         file = file.substr( file.find_last_of( "\\/" ) + 1 );               \
00091         full_message << message << " <" << file << "@" << __LINE__ << ">";  \
00092         throw Exception( full_message.str() );                              \
00093     }
00094
00095     // Forward Declarations for Visitor, and others.
00096     class Document;
00097     class Element;
00098     class Declaration;
00099     class StylesheetReference;
00100     class Text;
00101     class Comment;
00102     class Attribute;
00103
00105     class Visitor : public TiXmlVisitor
00106     {
00107     public:
00108         // Overload the TiXmlVisitor functions, wrap objects, call ticpp::Visitor functions
00110         virtual bool VisitEnter( const TiXmlDocument& doc );
00112         virtual bool VisitExit( const TiXmlDocument& doc );
00114         virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute );
00116         virtual bool VisitExit( const TiXmlElement& element );
00118         virtual bool Visit( const TiXmlDeclaration& declaration );
00120         virtual bool Visit( const TiXmlStylesheetReference& stylesheet );
00122         virtual bool Visit( const TiXmlText& text );
00124         virtual bool Visit( const TiXmlComment& comment );
00125
00126     public:
00128         virtual bool VisitEnter( const Document& /*doc*/ )          { return true; }
00130         virtual bool VisitExit( const Document& /*doc*/ )           { return true; }
00131
00133         virtual bool VisitEnter( const Element& /*element*/, const Attribute* /*firstAttribute*/ )  { return true; }
00135         virtual bool VisitExit( const Element& /*element*/ )        { return true; }
00136
00138         virtual bool Visit( const Declaration& /*declaration*/ )    { return true; }
00140         virtual bool Visit( const StylesheetReference& /*stylesheet*/ ) { return true; }
00142         virtual bool Visit( const Text& /*text*/ )                  { return true; }
00144         virtual bool Visit( const Comment& /*comment*/ )            { return true; }
00145     };
00146
00148     class Base
00149     {
00150     public:
00151
00157         template < class T >
00158             std::string ToString( const T& value ) const
00159         {
00160             std::stringstream convert;
00161             convert << value;
00162             if ( convert.fail() )
00163             {
00164                 TICPPTHROW( "Could not convert value to text" );
00165             }
00166             return convert.str();
00167         }
00168
00169         std::string ToString( const std::string& value ) const
00170         {
00171             return value;
00172         }
00173
00180         template < class T >
00181             void FromString( const std::string& temp, T* out ) const
00182         {
00183             std::istringstream val( temp );
00184             val >> *out;
00185
00186             if ( val.fail() )
00187             {
00188                 TICPPTHROW( "Could not convert \"" << temp << "\" to target type" );
00189             }
00190         }
00191
00195         void FromString( const std::string& temp, std::string* out ) const
00196         {
00197             *out = temp;
00198         }
00199
00204         int Row() const
00205         {
00206             return GetBasePointer()->Row();
00207         }
00208
00213         int Column() const
00214         {
00215             return GetBasePointer()->Column();
00216         }
00217
00221         virtual ~Base()
00222         {
00223             DeleteSpawnedWrappers();
00224         }
00225
00226     protected:
00227         mutable TiCppRCImp* m_impRC;
00229         mutable std::vector< Base* > m_spawnedWrappers;
00237         void SetImpRC( TiXmlBase* node )
00238         {
00239             m_impRC = node->m_tiRC;
00240         }
00241
00242         void ValidatePointer() const
00243         {
00244             if ( m_impRC->IsNull() )
00245             {
00246                 TICPPTHROW( "Internal TiXml Pointer is NULL" );
00247             }
00248         }
00249
00254         void DeleteSpawnedWrappers()
00255         {
00256             std::vector< Base* >::reverse_iterator wrapper;
00257             for ( wrapper = m_spawnedWrappers.rbegin(); wrapper != m_spawnedWrappers.rend(); ++wrapper )
00258             {
00259                 delete *wrapper;
00260             }
00261             m_spawnedWrappers.clear();
00262         }
00263
00268         virtual TiXmlBase* GetBasePointer() const = 0;
00269     };
00270
00274     class Attribute : public Base
00275     {
00276     private:
00277         TiXmlAttribute* m_tiXmlPointer;
00278         TiXmlBase* GetBasePointer() const
00279         {
00280             ValidatePointer();
00281             return m_tiXmlPointer;
00282         }
00283
00284     public:
00288         Attribute();
00289
00296         Attribute( const std::string& name, const std::string& value );
00297
00304         Attribute( TiXmlAttribute* attribute );
00305
00313         template < class T >
00314             void GetValue( T* value ) const
00315         {
00316             ValidatePointer();
00317             FromString( m_tiXmlPointer->ValueStr(), value );
00318         }
00319
00326         std::string Value() const;
00327
00334         template < class T >
00335             void SetValue( const T& value )
00336         {
00337             ValidatePointer();
00338             m_tiXmlPointer->SetValue( ToString( value ) );
00339         }
00340
00348         template < class T >
00349             void GetName( T* name ) const
00350         {
00351             ValidatePointer();
00352             FromString( m_tiXmlPointer->Name(), name );
00353         }
00354
00361         std::string Name() const;
00362
00369         template < class T >
00370             void SetName( const T& name )
00371         {
00372             ValidatePointer();
00373             m_tiXmlPointer->SetName( ToString( name ) );
00374         }
00375
00380         void operator=( const Attribute& copy );
00381
00386         Attribute( const Attribute& copy );
00387
00388         /*
00389         Decrements reference count.
00390         */
00391         ~Attribute();
00392
00396         Attribute* Next( bool throwIfNoAttribute = true ) const;
00397
00401         Attribute* Previous( bool throwIfNoAttribute = true ) const;
00402
00410         void IterateNext( const std::string&, Attribute** next ) const;
00411
00419         void IteratePrevious( const std::string&, Attribute** previous ) const;
00420
00424         virtual void Print( FILE* file, int depth ) const;
00425
00426     private:
00427
00435         void SetTiXmlPointer( TiXmlAttribute* newPointer );
00436     };
00437
00441     class Node : public Base
00442     {
00443     public:
00444
00452         template < class T >
00453             void GetValue( T* value) const
00454         {
00455             FromString( GetTiXmlPointer()->ValueStr(), value );
00456         }
00457
00464         std::string Value() const;
00465
00472         template < class T >
00473             void SetValue( const T& value )
00474         {
00475             GetTiXmlPointer()->SetValue( ToString( value ) );
00476         }
00477
00482         void Clear();
00483
00492         Node* Parent( bool throwIfNoParent = true ) const;
00493
00503         Node* FirstChild( bool throwIfNoChildren = true ) const;
00504
00515         Node* FirstChild( const char* value, bool throwIfNoChildren = true ) const;
00516
00526         Node* FirstChild( const std::string& value, bool throwIfNoChildren = true ) const;
00527
00537         Node* LastChild( bool throwIfNoChildren = true ) const;
00538
00549         Node* LastChild( const char* value, bool throwIfNoChildren = true ) const;
00550
00560         Node* LastChild( const std::string& value, bool throwIfNoChildren = true ) const;
00561
00569         Node* IterateChildren( Node* previous ) const;
00570
00579         Node* IterateChildren( const std::string& value, Node* previous ) const;
00580
00592         Node* InsertEndChild( Node& addThis );
00593
00604         Node* LinkEndChild( Node* childNode );
00605
00617         Node* InsertBeforeChild( Node* beforeThis, Node& addThis );
00618
00630         Node* InsertAfterChild( Node* afterThis, Node& addThis );
00631
00642         Node* ReplaceChild( Node* replaceThis, Node& withThis );
00643
00652         void RemoveChild( Node* removeThis );
00653
00662         Node* PreviousSibling( bool throwIfNoSiblings = true ) const;
00663
00673         Node* PreviousSibling( const std::string& value, bool throwIfNoSiblings = true ) const;
00674
00685         Node* PreviousSibling( const char* value, bool throwIfNoSiblings = true ) const;
00686
00695         Node* NextSibling( bool throwIfNoSiblings = true ) const;
00696
00706         Node* NextSibling( const std::string& value, bool throwIfNoSiblings = true ) const;
00707
00718         Node* NextSibling( const char* value, bool throwIfNoSiblings = true ) const;
00719
00727         template < class T >
00728             void IterateFirst( const std::string& value, T** first ) const
00729         {
00730             *first = 0;
00731             for( Node* child = FirstChild( value, false ); child; child = child->NextSibling( value, false ) )
00732             {
00733                 *first = dynamic_cast< T* >( child );
00734                 if ( 0 != *first )
00735                 {
00736                     return;
00737                 }
00738             }
00739         }
00740
00741         virtual void IterateFirst( const std::string&, Attribute** ) const
00742         {
00743             TICPPTHROW( "Attributes can only be iterated with Elements." )
00744         }
00745
00753         template < class T >
00754             void IterateNext( const std::string& value, T** next ) const
00755         {
00756             Node* sibling = NextSibling( value, false );
00757             *next = dynamic_cast< T* >( sibling );
00758
00759             while ( ( 0 != sibling ) && ( 0 == *next ) )
00760             {
00761                 sibling = sibling->NextSibling( value, false );
00762                 *next = dynamic_cast< T* >( sibling );
00763             }
00764         }
00765
00773         template < class T >
00774             void IteratePrevious( const std::string& value, T** previous  ) const
00775         {
00776             Node* sibling = PreviousSibling( value, false );
00777             *previous = dynamic_cast< T* >( sibling );
00778
00779             while ( ( 0 != sibling ) && ( 0 == *previous ) )
00780             {
00781                 sibling = sibling->PreviousSibling( value, false );
00782                 *previous = dynamic_cast< T* >( sibling );
00783             }
00784         }
00785
00794         Element* NextSiblingElement( bool throwIfNoSiblings = true ) const;
00795
00804         Element* NextSiblingElement( const std::string& value, bool throwIfNoSiblings = true ) const;
00805
00816         Element* NextSiblingElement( const char* value, bool throwIfNoSiblings = true ) const;
00817
00827         Element* FirstChildElement( bool throwIfNoChildren = true ) const;
00828
00839         Element* FirstChildElement( const char* value, bool throwIfNoChildren = true ) const;
00840
00850         Element* FirstChildElement( const std::string& value, bool throwIfNoChildren = true ) const;
00851
00855         int Type() const;
00856
00864         Document* GetDocument( bool throwIfNoDocument = true ) const;
00865
00871         bool NoChildren() const;
00872
00879         template < class T >
00880             T* To() const
00881         {
00882             T* pointer = dynamic_cast< T* >( this );
00883             if ( 0 == pointer )
00884             {
00885                 std::string thisType = typeid( this ).name();
00886                 std::string targetType = typeid( T ).name();
00887                 std::string thatType = typeid( *this ).name();
00888                 TICPPTHROW( "The " << thisType.substr( 6 ) << " could not be casted to a " << targetType.substr( 6 )
00889                     << " *, because the target object is not a " << targetType.substr( 6 ) << ". (It is a " << thatType.substr( 6 ) << ")" );
00890             }
00891             return pointer;
00892         }
00893
00899         Document* ToDocument() const;
00900
00906         Element* ToElement() const;
00907
00913         Comment* ToComment() const;
00914
00920         Text* ToText() const;
00921
00927         Declaration* ToDeclaration() const;
00928
00934         StylesheetReference* ToStylesheetReference() const;
00935
00953         std::auto_ptr< Node > Clone() const;
00954
00959         bool Accept( TiXmlVisitor* visitor ) const;
00960
00964         friend std::istream& operator >>( std::istream& in, Node& base )
00965         {
00966             in >> *base.GetTiXmlPointer();
00967             return in;
00968         }
00969
00973         friend std::ostream& operator <<( std::ostream& out, Node& base )
00974         {
00975             out << *base.GetTiXmlPointer();
00976             return out;
00977         }
00978
00979     protected:
00984         virtual TiXmlNode* GetTiXmlPointer() const = 0;
00985
00986         TiXmlBase* GetBasePointer() const
00987         {
00988             return GetTiXmlPointer();
00989         }
00990
00995         Node* NodeFactory( TiXmlNode* tiXmlNode, bool throwIfNull = true, bool rememberSpawnedWrapper = true ) const;
00996
00997     };
00998
01025     template < class T = Node >
01026         class Iterator
01027     {
01028     private:
01029         T* m_p;
01030         std::string m_value;
01032     public:
01033
01043         T* begin( const Node* parent ) const
01044         {
01045             T* pointer;
01046             parent->IterateFirst( m_value, &pointer );
01047             return pointer;
01048         }
01049
01058         T* end() const
01059         {
01060             return 0;
01061         }
01062
01071         Iterator( const std::string& value = "" )
01072             : m_p( 0 ), m_value( value )
01073         {
01074         }
01075
01077         Iterator( T* node, const std::string& value = "" )
01078             : m_p( node ), m_value( value )
01079         {
01080         }
01081
01083         Iterator( const Iterator& it, const std::string& value  = "" )
01084             : m_p( it.m_p ), m_value( value )
01085         {
01086         }
01087
01092         T* Get() const
01093         {
01094             return m_p;
01095         }
01096
01098         Iterator& operator=( const Iterator& it )
01099         {
01100             m_p = it.m_p;
01101             return *this;
01102         }
01103
01105         Iterator& operator=( T* p )
01106         {
01107             m_p = p;
01108             return *this;
01109         }
01110
01112         Iterator& operator++()
01113         {
01114             m_p->IterateNext( m_value, &m_p );
01115             return *this;
01116         }
01117
01119         Iterator& operator++(int)
01120         {
01121             return this->operator ++();
01122         }
01123
01125         Iterator& operator--()
01126         {
01127             m_p->IteratePrevious( m_value, &m_p );
01128             return *this;
01129         }
01130
01132         Iterator& operator--(int)
01133         {
01134             return this->operator --();
01135         }
01136
01138         bool operator!=( T* p ) const
01139         {
01140             return m_p != p;
01141         }
01142
01144         bool operator!=( const Iterator& it ) const
01145         {
01146             return m_p != it.m_p;
01147         }
01148
01150         bool operator==( T* p ) const
01151         {
01152             return m_p == p;
01153         }
01154
01156         bool operator==( const Iterator& it ) const
01157         {
01158             return m_p == it.m_p;
01159         }
01160
01162         T* operator->() const
01163         {
01164             return m_p;
01165         }
01166
01168         T& operator*() const
01169         {
01170             return *m_p;
01171         }
01172     };
01173
01175     template < class T >
01176         class NodeImp : public Node
01177     {
01178     protected:
01179
01180         T* m_tiXmlPointer;
01188         TiXmlNode* GetTiXmlPointer() const
01189         {
01190             ValidatePointer();
01191             return m_tiXmlPointer;
01192         }
01193
01201         void SetTiXmlPointer( T* newPointer )
01202         {
01203             m_tiXmlPointer = newPointer;
01204             SetImpRC( newPointer );
01205         }
01206
01211         NodeImp( T* tiXmlPointer )
01212         {
01213             // Check for NULL pointers
01214             if ( 0 == tiXmlPointer )
01215             {
01216                 TICPPTHROW( "Can not create a " << typeid( T ).name() );
01217             }
01218             SetTiXmlPointer( tiXmlPointer );
01219             m_impRC->IncRef();
01220         }
01221
01227         virtual void operator=( const NodeImp<T>& copy )
01228         {
01229             DeleteSpawnedWrappers();
01230
01231             // Dropping the reference to the old object
01232             this->m_impRC->DecRef();
01233
01234             // Pointing to the new Object
01235             SetTiXmlPointer( copy.m_tiXmlPointer );
01236
01237             // The internal tixml pointer changed in the above line
01238             this->m_impRC->IncRef();
01239         }
01240
01246         NodeImp( const NodeImp<T>& copy ) : Node( copy )
01247         {
01248             // Pointing to the new Object
01249             SetTiXmlPointer( copy.m_tiXmlPointer );
01250
01251             // The internal tixml pointer changed in the above line
01252             this->m_impRC->IncRef();
01253         }
01254
01255     public:
01256
01257         /*
01258         Deletes the spawned wrapper objects.
01259         Decrements reference count.
01260         */
01261         virtual ~NodeImp()
01262         {
01263             // The spawnedWrappers need to be deleted before m_tiXmlPointer
01264             DeleteSpawnedWrappers();
01265             m_impRC->DecRef();
01266         }
01267     };
01268
01270     class Comment : public NodeImp< TiXmlComment >
01271     {
01272     public:
01273
01277         Comment();
01278
01282         Comment( TiXmlComment* comment );
01283
01287         Comment( const std::string& comment );
01288     };
01289
01291     class Text : public NodeImp< TiXmlText >
01292     {
01293     public:
01294
01298         Text();
01299
01304         Text( TiXmlText* text );
01305
01310         Text( const std::string& value );
01311
01321         template < class T >
01322             Text( const T& value )
01323                 : NodeImp< TiXmlText >( new TiXmlText( ToString( value ) ) )
01324         {
01325             m_impRC->InitRef();
01326         }
01327     };
01328
01330     class Document : public NodeImp< TiXmlDocument >
01331     {
01332     public:
01337         Document();
01338
01342         Document( TiXmlDocument* document );
01343
01347         Document( const char* documentName );
01348
01355         Document( const std::string& documentName );
01356
01364         void LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
01365
01371         void SaveFile() const;
01372
01381         void LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
01382
01386         void LoadFile( const char* filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
01387
01394         void SaveFile( const std::string& filename ) const;
01395
01404         void Parse( const std::string& xml, bool throwIfParseError = true, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
01405     };
01406
01408     class Element : public NodeImp< TiXmlElement >
01409     {
01410     public:
01414         Element();
01415
01420         Element( const std::string& value );
01421
01426         Element( const char* value );
01427
01431         Element( TiXmlElement* element );
01432
01438         template < class T >
01439             Element( const std::string& value, const T& text )
01440             : NodeImp< TiXmlElement >( new TiXmlElement( value ) )
01441         {
01442             m_impRC->InitRef();
01443             SetText( text );
01444         }
01445
01452         Attribute* FirstAttribute( bool throwIfNoAttributes = true ) const;
01453
01460         Attribute* LastAttribute( bool throwIfNoAttributes = true ) const;
01461
01469         void IterateFirst( const std::string&, Attribute** first ) const
01470         {
01471             *first = 0;
01472             for( Attribute* child = FirstAttribute( false ); child; child = child->Next( false ) )
01473             {
01474                 *first = dynamic_cast< Attribute* >( child );
01475                 if ( 0 != *first )
01476                 {
01477                     return;
01478                 }
01479             }
01480         }
01481
01489         template < class T >
01490             void SetAttribute ( const std::string& name, const T& value )
01491         {
01492             ValidatePointer();
01493             m_tiXmlPointer->SetAttribute( name, ToString( value ) );
01494         }
01495
01508         std::string GetText( bool throwIfNotFound = true ) const
01509         {
01510             // Get the element's text value as a std::string
01511             std::string temp;
01512             if ( !GetTextImp( &temp ) )
01513             {
01514                 if ( throwIfNotFound )
01515                 {
01516                     TICPPTHROW( "Text does not exists in the current element" );
01517                 }
01518             }
01519
01520             return temp;
01521         }
01522
01534         std::string GetTextOrDefault( const std::string& defaultValue ) const
01535         {
01536             // Get the element's text value as a std::string
01537             std::string temp;
01538             if ( !GetTextImp( &temp ) )
01539             {
01540                 return defaultValue;
01541             }
01542
01543             return temp;
01544         }
01545
01560         template < class T, class DefaultT >
01561             void GetTextOrDefault( T* value, const DefaultT& defaultValue ) const
01562         {
01563             // Get the element's text value as a std::string
01564             std::string temp;
01565             if ( !GetTextImp( &temp ) )
01566             {
01567                 // The text value does not exist - set value to the default
01568                 *value = defaultValue;
01569                 return;
01570             }
01571
01572             // Stream the value from the string to T
01573             FromString( temp, value );
01574         }
01575
01591         template< class T >
01592             void GetText( T* value, bool throwIfNotFound = true ) const
01593         {
01594             // Get the element's text value as a std::string
01595             std::string temp;
01596             if ( !GetTextImp( &temp ) )
01597             {
01598                 if ( throwIfNotFound )
01599                 {
01600                     TICPPTHROW( "Text does not exists in the current element" );
01601                 }
01602                 else
01603                 {
01604                     return;
01605                 }
01606             }
01607
01608             // Stream the value from the string to T
01609             FromString( temp, value );
01610         }
01611
01619         template < class T >
01620             void SetText( const T& value )
01621         {
01622             ValidatePointer();
01623             std::string temp = ToString( value );
01624
01625             if ( m_tiXmlPointer->NoChildren() )
01626             {
01627                 m_tiXmlPointer->LinkEndChild( new TiXmlText( temp ) );
01628             }
01629             else
01630             {
01631                 if ( 0 == m_tiXmlPointer->GetText() )
01632                 {
01633                     m_tiXmlPointer->InsertBeforeChild( m_tiXmlPointer->FirstChild(), TiXmlText( temp ) );
01634                 }
01635                 else
01636                 {
01637                     // There already is text, so change it
01638                     m_tiXmlPointer->FirstChild()->SetValue( temp );
01639                 }
01640             }
01641         }
01642
01654         template < class T, class DefaulT >
01655             void GetAttributeOrDefault( const std::string& name, T* value, const DefaulT& defaultValue ) const
01656         {
01657             // Get the attribute's value as a std::string
01658             std::string temp;
01659             if ( !GetAttributeImp( name, &temp ) )
01660             {
01661                 // The attribute does not exist - set value to the default
01662                 *value = defaultValue;
01663                 return;
01664             }
01665
01666             // Stream the value from the string to T
01667             FromString( temp, value );
01668         }
01669
01678         std::string GetAttributeOrDefault( const std::string& name, const std::string& defaultValue ) const;
01679
01691         template< class T >
01692             void GetAttribute( const std::string& name, T* value, bool throwIfNotFound = true ) const
01693         {
01694             // Get the attribute's value as a std::string
01695             std::string temp;
01696             if ( !GetAttributeImp( name, &temp ) )
01697             {
01698                 if ( throwIfNotFound )
01699                 {
01700                     TICPPTHROW( "Attribute does not exist" );
01701                 }
01702                 else
01703                 {
01704                     return;
01705                 }
01706             }
01707
01708             // Stream the value from the string to T
01709             FromString( temp, value );
01710         }
01711
01721         std::string GetAttribute( const std::string& name ) const;
01722
01723     private:
01724
01729         bool GetAttributeImp( const std::string& name, std::string* value ) const;
01730
01735         bool GetTextImp( std::string* value ) const;
01736     };
01737
01739     class Declaration : public NodeImp< TiXmlDeclaration >
01740     {
01741     public:
01745         Declaration();
01746
01750         Declaration( TiXmlDeclaration* declaration );
01751
01755         Declaration( const std::string& version, const std::string& encoding, const std::string& standalone );
01756
01760         std::string Version() const;
01761
01765         std::string Encoding() const;
01766
01770         std::string Standalone() const;
01771     };
01772
01774     class StylesheetReference : public NodeImp< TiXmlStylesheetReference >
01775     {
01776     public:
01780         StylesheetReference();
01781
01785         StylesheetReference( TiXmlStylesheetReference* stylesheetReference );
01786
01790         StylesheetReference( const std::string& type, const std::string& href );
01791
01795         std::string Type() const;
01796
01800         std::string Href() const;
01801     };
01802 }
01803
01804 #endif  // TICPP_INCLUDED
01805
01806 #endif // TIXML_USE_TICPP
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: ticpprc.h Source File

ticpprc.h

00001 /*
00002 http://code.google.com/p/ticpp/
00003 Copyright (c) 2006 Ryan Pusztai, Ryan Mulder
00004
00005 Permission is hereby granted, free of charge, to any person obtaining a copy of
00006 this software and associated documentation files (the "Software"), to deal in
00007 the Software without restriction, including without limitation the rights to
00008 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
00009 the Software, and to permit persons to whom the Software is furnished to do so,
00010 subject to the following conditions:
00011
00012 The above copyright notice and this permission notice shall be included in all
00013 copies or substantial portions of the Software.
00014
00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
00017 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
00018 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
00019 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00020 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00021 */
00022
00023 #ifdef TIXML_USE_TICPP
00024
00025 #ifndef TICPPRC_INCLUDED
00026 #define TICPPRC_INCLUDED
00027
00028
00029 // Forward declare ticpp::Node, so it can be made a friend of TiCppRC
00030 namespace ticpp
00031 {
00032     class Base;
00033 }
00034
00035 // Forward declare TiCppRCImp so TiCppRC can hold a pointer to it
00036 class TiCppRCImp;
00037
00041 class TiCppRC
00042 {
00043     // Allow ticpp::Node to directly modify reference count
00044     friend class ticpp::Base;
00045
00046 private:
00047
00048     TiCppRCImp* m_tiRC;
00050 public:
00051
00056     TiCppRC();
00057
00063     virtual ~TiCppRC();
00064 };
00065
00066 class TiCppRCImp
00067 {
00068 private:
00069
00070     int m_count;
00072     TiCppRC* m_tiCppRC;
00074 public:
00075
00079     TiCppRCImp( TiCppRC* tiCppRC );
00080
00084     void Nullify();
00085
00089     void IncRef();
00090
00094     void DecRef();
00095
00099     void InitRef();
00100
00104     TiCppRC* Get();
00105
00109     bool IsNull();
00110 };
00111
00112 #endif // TICPP_INCLUDED
00113
00114 #endif // TIXML_USE_TICPP
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: tinystr.h Source File

tinystr.h

00001 /*
00002 www.sourceforge.net/projects/tinyxml
00003 Original file by Yves Berquin.
00004
00005 This software is provided 'as-is', without any express or implied
00006 warranty. In no event will the authors be held liable for any
00007 damages arising from the use of this software.
00008
00009 Permission is granted to anyone to use this software for any
00010 purpose, including commercial applications, and to alter it and
00011 redistribute it freely, subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must
00014 not claim that you wrote the original software. If you use this
00015 software in a product, an acknowledgment in the product documentation
00016 would be appreciated but is not required.
00017
00018 2. Altered source versions must be plainly marked as such, and
00019 must not be misrepresented as being the original software.
00020
00021 3. This notice may not be removed or altered from any source
00022 distribution.
00023 */
00024
00025 /*
00026  * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005.
00027  *
00028  * - completely rewritten. compact, clean, and fast implementation.
00029  * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems)
00030  * - fixed reserve() to work as per specification.
00031  * - fixed buggy compares operator==(), operator<(), and operator>()
00032  * - fixed operator+=() to take a const ref argument, following spec.
00033  * - added "copy" constructor with length, and most compare operators.
00034  * - added swap(), clear(), size(), capacity(), operator+().
00035  */
00036
00037 #ifndef TIXML_USE_STL
00038
00039 #ifndef TIXML_STRING_INCLUDED
00040 #define TIXML_STRING_INCLUDED
00041
00042 #include <assert.h>
00043 #include <string.h>
00044
00045 /*  The support for explicit isn't that universal, and it isn't really
00046     required - it is used to check that the TiXmlString class isn't incorrectly
00047     used. Be nice to old compilers and macro it here:
00048 */
00049 #if defined(_MSC_VER) && (_MSC_VER >= 1200 )
00050     // Microsoft visual studio, version 6 and higher.
00051     #define TIXML_EXPLICIT explicit
00052 #elif defined(__GNUC__) && (__GNUC__ >= 3 )
00053     // GCC version 3 and higher.s
00054     #define TIXML_EXPLICIT explicit
00055 #else
00056     #define TIXML_EXPLICIT
00057 #endif
00058
00059
00060 /*
00061    TiXmlString is an emulation of a subset of the std::string template.
00062    Its purpose is to allow compiling TinyXML on compilers with no or poor STL support.
00063    Only the member functions relevant to the TinyXML project have been implemented.
00064    The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase
00065    a string and there's no more room, we allocate a buffer twice as big as we need.
00066 */
00067 class TiXmlString
00068 {
00069   public :
00070     // The size type used
00071     typedef size_t size_type;
00072
00073     // Error value for find primitive
00074     static const size_type npos; // = -1;
00075
00076
00077     // TiXmlString empty constructor
00078     TiXmlString () : rep_(&nullrep_)
00079     {
00080     }
00081
00082     // TiXmlString copy constructor
00083     TiXmlString ( const TiXmlString & copy) : rep_(0)
00084     {
00085         init(copy.length());
00086         memcpy(start(), copy.data(), length());
00087     }
00088
00089     // TiXmlString constructor, based on a string
00090     TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0)
00091     {
00092         init( static_cast<size_type>( strlen(copy) ));
00093         memcpy(start(), copy, length());
00094     }
00095
00096     // TiXmlString constructor, based on a string
00097     TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0)
00098     {
00099         init(len);
00100         memcpy(start(), str, len);
00101     }
00102
00103     // TiXmlString destructor
00104     ~TiXmlString ()
00105     {
00106         quit();
00107     }
00108
00109     // = operator
00110     TiXmlString& operator = (const char * copy)
00111     {
00112         return assign( copy, (size_type)strlen(copy));
00113     }
00114
00115     // = operator
00116     TiXmlString& operator = (const TiXmlString & copy)
00117     {
00118         return assign(copy.start(), copy.length());
00119     }
00120
00121
00122     // += operator. Maps to append
00123     TiXmlString& operator += (const char * suffix)
00124     {
00125         return append(suffix, static_cast<size_type>( strlen(suffix) ));
00126     }
00127
00128     // += operator. Maps to append
00129     TiXmlString& operator += (char single)
00130     {
00131         return append(&single, 1);
00132     }
00133
00134     // += operator. Maps to append
00135     TiXmlString& operator += (const TiXmlString & suffix)
00136     {
00137         return append(suffix.data(), suffix.length());
00138     }
00139
00140
00141     // Convert a TiXmlString into a null-terminated char *
00142     const char * c_str () const { return rep_->str; }
00143
00144     // Convert a TiXmlString into a char * (need not be null terminated).
00145     const char * data () const { return rep_->str; }
00146
00147     // Return the length of a TiXmlString
00148     size_type length () const { return rep_->size; }
00149
00150     // Alias for length()
00151     size_type size () const { return rep_->size; }
00152
00153     // Checks if a TiXmlString is empty
00154     bool empty () const { return rep_->size == 0; }
00155
00156     // Return capacity of string
00157     size_type capacity () const { return rep_->capacity; }
00158
00159
00160     // single char extraction
00161     const char& at (size_type index) const
00162     {
00163         assert( index < length() );
00164         return rep_->str[ index ];
00165     }
00166
00167     // [] operator
00168     char& operator [] (size_type index) const
00169     {
00170         assert( index < length() );
00171         return rep_->str[ index ];
00172     }
00173
00174     // find a char in a string. Return TiXmlString::npos if not found
00175     size_type find (char lookup) const
00176     {
00177         return find(lookup, 0);
00178     }
00179
00180     // find a char in a string from an offset. Return TiXmlString::npos if not found
00181     size_type find (char tofind, size_type offset) const
00182     {
00183         if (offset >= length()) return npos;
00184
00185         for (const char* p = c_str() + offset; *p != '\0'; ++p)
00186         {
00187            if (*p == tofind) return static_cast< size_type >( p - c_str() );
00188         }
00189         return npos;
00190     }
00191
00192     void clear ()
00193     {
00194         //Lee:
00195         //The original was just too strange, though correct:
00196         //  TiXmlString().swap(*this);
00197         //Instead use the quit & re-init:
00198         quit();
00199         init(0,0);
00200     }
00201
00202     /*  Function to reserve a big amount of data when we know we'll need it. Be aware that this
00203         function DOES NOT clear the content of the TiXmlString if any exists.
00204     */
00205     void reserve (size_type cap);
00206
00207     TiXmlString& assign (const char* str, size_type len);
00208
00209     TiXmlString& append (const char* str, size_type len);
00210
00211     void swap (TiXmlString& other)
00212     {
00213         Rep* r = rep_;
00214         rep_ = other.rep_;
00215         other.rep_ = r;
00216     }
00217
00218   private:
00219
00220     void init(size_type sz) { init(sz, sz); }
00221     void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; }
00222     char* start() const { return rep_->str; }
00223     char* finish() const { return rep_->str + rep_->size; }
00224
00225     struct Rep
00226     {
00227         size_type size, capacity;
00228         char str[1];
00229     };
00230
00231     void init(size_type sz, size_type cap)
00232     {
00233         if (cap)
00234         {
00235             // Lee: the original form:
00236             //  rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap));
00237             // doesn't work in some cases of new being overloaded. Switching
00238             // to the normal allocation, although use an 'int' for systems
00239             // that are overly picky about structure alignment.
00240             const size_type bytesNeeded = sizeof(Rep) + cap;
00241             const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int );
00242             rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] );
00243
00244             rep_->str[ rep_->size = sz ] = '\0';
00245             rep_->capacity = cap;
00246         }
00247         else
00248         {
00249             rep_ = &nullrep_;
00250         }
00251     }
00252
00253     void quit()
00254     {
00255         if (rep_ != &nullrep_)
00256         {
00257             // The rep_ is really an array of ints. (see the allocator, above).
00258             // Cast it back before delete, so the compiler won't incorrectly call destructors.
00259             delete [] ( reinterpret_cast<int*>( rep_ ) );
00260         }
00261     }
00262
00263     Rep * rep_;
00264     static Rep nullrep_;
00265
00266 } ;
00267
00268
00269 inline bool operator == (const TiXmlString & a, const TiXmlString & b)
00270 {
00271     return    ( a.length() == b.length() )              // optimization on some platforms
00272            && ( strcmp(a.c_str(), b.c_str()) == 0 );    // actual compare
00273 }
00274 inline bool operator < (const TiXmlString & a, const TiXmlString & b)
00275 {
00276     return strcmp(a.c_str(), b.c_str()) < 0;
00277 }
00278
00279 inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); }
00280 inline bool operator >  (const TiXmlString & a, const TiXmlString & b) { return b < a; }
00281 inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); }
00282 inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); }
00283
00284 inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; }
00285 inline bool operator == (const char* a, const TiXmlString & b) { return b == a; }
00286 inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); }
00287 inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); }
00288
00289 TiXmlString operator + (const TiXmlString & a, const TiXmlString & b);
00290 TiXmlString operator + (const TiXmlString & a, const char* b);
00291 TiXmlString operator + (const char* a, const TiXmlString & b);
00292
00293
00294 /*
00295    TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString.
00296    Only the operators that we need for TinyXML have been developped.
00297 */
00298 class TiXmlOutStream : public TiXmlString
00299 {
00300 public :
00301
00302     // TiXmlOutStream << operator.
00303     TiXmlOutStream & operator << (const TiXmlString & in)
00304     {
00305         *this += in;
00306         return *this;
00307     }
00308
00309     // TiXmlOutStream << operator.
00310     TiXmlOutStream & operator << (const char * in)
00311     {
00312         *this += in;
00313         return *this;
00314     }
00315
00316 } ;
00317
00318 #endif  // TIXML_STRING_INCLUDED
00319 #endif  // TIXML_USE_STL
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3


TinyXml: tinyxml.h Source File

tinyxml.h

00001 /*
00002 www.sourceforge.net/projects/tinyxml
00003 Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
00004
00005 This software is provided 'as-is', without any express or implied
00006 warranty. In no event will the authors be held liable for any
00007 damages arising from the use of this software.
00008
00009 Permission is granted to anyone to use this software for any
00010 purpose, including commercial applications, and to alter it and
00011 redistribute it freely, subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must
00014 not claim that you wrote the original software. If you use this
00015 software in a product, an acknowledgment in the product documentation
00016 would be appreciated but is not required.
00017
00018 2. Altered source versions must be plainly marked as such, and
00019 must not be misrepresented as being the original software.
00020
00021 3. This notice may not be removed or altered from any source
00022 distribution.
00023 */
00024
00025
00026 #ifndef TINYXML_INCLUDED
00027 #define TINYXML_INCLUDED
00028
00029 #ifdef _MSC_VER
00030 #pragma warning( push )
00031 #pragma warning( disable : 4530 )
00032 #pragma warning( disable : 4786 )
00033 #endif
00034
00035 #include <ctype.h>
00036 #include <stdio.h>
00037 #include <stdlib.h>
00038 #include <string.h>
00039 #include <assert.h>
00040
00041 // Help out windows:
00042 #if defined( _DEBUG ) && !defined( DEBUG )
00043 #define DEBUG
00044 #endif
00045
00046 #ifdef TIXML_USE_TICPP
00047     #ifndef TIXML_USE_STL
00048         #define TIXML_USE_STL
00049     #endif
00050 #endif
00051
00052 #ifdef TIXML_USE_STL
00053     #include <string>
00054     #include <iostream>
00055     #include <sstream>
00056     #define TIXML_STRING        std::string
00057 #else
00058     #include "tinystr.h"
00059     #define TIXML_STRING        TiXmlString
00060 #endif
00061
00062 // Deprecated library function hell. Compilers want to use the
00063 // new safe versions. This probably doesn't fully address the problem,
00064 // but it gets closer. There are too many compilers for me to fully
00065 // test. If you get compilation troubles, undefine TIXML_SAFE
00066 #define TIXML_SAFE
00067
00068 #ifdef TIXML_SAFE
00069     #if defined(_MSC_VER) && (_MSC_VER >= 1400 )
00070         // Microsoft visual studio, version 2005 and higher.
00071         #define TIXML_SNPRINTF _snprintf_s
00072         #define TIXML_SNSCANF  _snscanf_s
00073         #define TIXML_SSCANF   sscanf_s
00074     #elif defined(_MSC_VER) && (_MSC_VER >= 1200 )
00075         // Microsoft visual studio, version 6 and higher.
00076         //#pragma message( "Using _sn* functions." )
00077         #define TIXML_SNPRINTF _snprintf
00078         #define TIXML_SNSCANF  _snscanf
00079         #define TIXML_SSCANF   sscanf
00080     #elif defined(__GNUC__) && (__GNUC__ >= 3 )
00081         // GCC version 3 and higher.s
00082         //#warning( "Using sn* functions." )
00083         #define TIXML_SNPRINTF snprintf
00084         #define TIXML_SNSCANF  snscanf
00085         #define TIXML_SSCANF   sscanf
00086     #else
00087         #define TIXML_SSCANF   sscanf
00088     #endif
00089 #endif
00090
00091 class TiXmlDocument;
00092 class TiXmlElement;
00093 class TiXmlComment;
00094 class TiXmlUnknown;
00095 class TiXmlAttribute;
00096 class TiXmlText;
00097 class TiXmlDeclaration;
00098 class TiXmlStylesheetReference;
00099 class TiXmlParsingData;
00100
00101 const int TIXML_MAJOR_VERSION = 2;
00102 const int TIXML_MINOR_VERSION = 5;
00103 const int TIXML_PATCH_VERSION = 3;
00104
00105 /*  Internal structure for tracking location of items
00106     in the XML file.
00107 */
00108 struct TiXmlCursor
00109 {
00110     TiXmlCursor()       { Clear(); }
00111     void Clear()        { row = col = -1; }
00112
00113     int row;    // 0 based.
00114     int col;    // 0 based.
00115 };
00116
00117
00136 class TiXmlVisitor
00137 {
00138 public:
00139     virtual ~TiXmlVisitor() {}
00140
00142     virtual bool VisitEnter( const TiXmlDocument& /*doc*/ )         { return true; }
00144     virtual bool VisitExit( const TiXmlDocument& /*doc*/ )          { return true; }
00145
00147     virtual bool VisitEnter( const TiXmlElement& /*element*/, const TiXmlAttribute* /*firstAttribute*/ )    { return true; }
00149     virtual bool VisitExit( const TiXmlElement& /*element*/ )       { return true; }
00150
00152     virtual bool Visit( const TiXmlDeclaration& /*declaration*/ )   { return true; }
00154     virtual bool Visit( const TiXmlStylesheetReference& /*stylesheet*/ )    { return true; }
00156     virtual bool Visit( const TiXmlText& /*text*/ )                 { return true; }
00158     virtual bool Visit( const TiXmlComment& /*comment*/ )           { return true; }
00160     virtual bool Visit( const TiXmlUnknown& /*unknown*/ )           { return true; }
00161 };
00162
00163 // Only used by Attribute::Query functions
00164 enum
00165 {
00166     TIXML_SUCCESS,
00167     TIXML_NO_ATTRIBUTE,
00168     TIXML_WRONG_TYPE
00169 };
00170
00171
00172 // Used by the parsing routines.
00173 enum TiXmlEncoding
00174 {
00175     TIXML_ENCODING_UNKNOWN,
00176     TIXML_ENCODING_UTF8,
00177     TIXML_ENCODING_LEGACY
00178 };
00179
00180 const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN;
00181
00204 #ifdef TIXML_USE_TICPP
00205 #include "ticpprc.h"
00206 class TiXmlBase : public TiCppRC
00207 #else
00208 class TiXmlBase
00209 #endif
00210 {
00211     friend class TiXmlNode;
00212     friend class TiXmlElement;
00213     friend class TiXmlDocument;
00214
00215 public:
00216     TiXmlBase() :   userData(0)     {}
00217     virtual ~TiXmlBase()            {}
00218
00228     virtual void Print( FILE* cfile, int depth ) const = 0;
00229
00236     static void SetCondenseWhiteSpace( bool condense )      { condenseWhiteSpace = condense; }
00237
00239     static bool IsWhiteSpaceCondensed()                     { return condenseWhiteSpace; }
00240
00259     int Row() const         { return location.row + 1; }
00260     int Column() const      { return location.col + 1; }
00261
00262     void  SetUserData( void* user )         { userData = user; }
00263     void* GetUserData()                     { return userData; }
00264     const void* GetUserData() const         { return userData; }
00265
00266     // Table that returs, for a given lead byte, the total number of bytes
00267     // in the UTF-8 sequence.
00268     static const int utf8ByteTable[256];
00269
00270     virtual const char* Parse(  const char* p,
00271                                 TiXmlParsingData* data,
00272                                 TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0;
00273
00277     static void EncodeString( const TIXML_STRING& str, TIXML_STRING* out );
00278
00279     enum
00280     {
00281         TIXML_NO_ERROR = 0,
00282         TIXML_ERROR,
00283         TIXML_ERROR_OPENING_FILE,
00284         TIXML_ERROR_OUT_OF_MEMORY,
00285         TIXML_ERROR_PARSING_ELEMENT,
00286         TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME,
00287         TIXML_ERROR_READING_ELEMENT_VALUE,
00288         TIXML_ERROR_READING_ATTRIBUTES,
00289         TIXML_ERROR_PARSING_EMPTY,
00290         TIXML_ERROR_READING_END_TAG,
00291         TIXML_ERROR_PARSING_UNKNOWN,
00292         TIXML_ERROR_PARSING_COMMENT,
00293         TIXML_ERROR_PARSING_DECLARATION,
00294         TIXML_ERROR_DOCUMENT_EMPTY,
00295         TIXML_ERROR_EMBEDDED_NULL,
00296         TIXML_ERROR_PARSING_CDATA,
00297         TIXML_ERROR_DOCUMENT_TOP_ONLY,
00298
00299         TIXML_ERROR_STRING_COUNT
00300     };
00301
00302 protected:
00303
00304     static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding );
00305     inline static bool IsWhiteSpace( char c )
00306     {
00307         return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' );
00308     }
00309     inline static bool IsWhiteSpace( int c )
00310     {
00311         if ( c < 256 )
00312             return IsWhiteSpace( (char) c );
00313         return false;   // Again, only truly correct for English/Latin...but usually works.
00314     }
00315
00316     #ifdef TIXML_USE_STL
00317     static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag );
00318     static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag );
00319     #endif
00320
00321     /*  Reads an XML name into the string provided. Returns
00322         a pointer just past the last character of the name,
00323         or 0 if the function has an error.
00324     */
00325     static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding );
00326
00327     /*  Reads text. Returns a pointer past the given end tag.
00328         Wickedly complex options, but it keeps the (sensitive) code in one place.
00329     */
00330     static const char* ReadText(    const char* in,             // where to start
00331                                     TIXML_STRING* text,         // the string read
00332                                     bool ignoreWhiteSpace,      // whether to keep the white space
00333                                     const char* endTag,         // what ends this text
00334                                     bool ignoreCase,            // whether to ignore case in the end tag
00335                                     TiXmlEncoding encoding );   // the current encoding
00336
00337     // If an entity has been found, transform it into a character.
00338     static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding );
00339
00340     // Get a character, while interpreting entities.
00341     // The length can be from 0 to 4 bytes.
00342     inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding )
00343     {
00344         assert( p );
00345         if ( encoding == TIXML_ENCODING_UTF8 )
00346         {
00347             *length = utf8ByteTable[ *((const unsigned char*)p) ];
00348             assert( *length >= 0 && *length < 5 );
00349         }
00350         else
00351         {
00352             *length = 1;
00353         }
00354
00355         if ( *length == 1 )
00356         {
00357             if ( *p == '&' )
00358                 return GetEntity( p, _value, length, encoding );
00359             *_value = *p;
00360             return p+1;
00361         }
00362         else if ( *length )
00363         {
00364             //strncpy( _value, p, *length );    // lots of compilers don't like this function (unsafe),
00365                                                 // and the null terminator isn't needed
00366             for( int i=0; p[i] && i<*length; ++i ) {
00367                 _value[i] = p[i];
00368             }
00369             return p + (*length);
00370         }
00371         else
00372         {
00373             // Not valid text.
00374             return 0;
00375         }
00376     }
00377
00378     // Return true if the next characters in the stream are any of the endTag sequences.
00379     // Ignore case only works for english, and should only be relied on when comparing
00380     // to English words: StringEqual( p, "version", true ) is fine.
00381     static bool StringEqual(    const char* p,
00382                                 const char* endTag,
00383                                 bool ignoreCase,
00384                                 TiXmlEncoding encoding );
00385
00386     static const char* errorString[ TIXML_ERROR_STRING_COUNT ];
00387
00388     TiXmlCursor location;
00389
00391     void*           userData;
00392
00393     // None of these methods are reliable for any language except English.
00394     // Good for approximation, not great for accuracy.
00395     static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding );
00396     static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding );
00397     inline static int ToLower( int v, TiXmlEncoding encoding )
00398     {
00399         if ( encoding == TIXML_ENCODING_UTF8 )
00400         {
00401             if ( v < 128 ) return tolower( v );
00402             return v;
00403         }
00404         else
00405         {
00406             return tolower( v );
00407         }
00408     }
00409     static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );
00410
00411 private:
00412     TiXmlBase( const TiXmlBase& );              // not implemented.
00413     void operator=( const TiXmlBase& base );    // not allowed.
00414
00415     struct Entity
00416     {
00417         const char*     str;
00418         unsigned int    strLength;
00419         char            chr;
00420     };
00421     enum
00422     {
00423         NUM_ENTITY = 5,
00424         MAX_ENTITY_LENGTH = 6
00425
00426     };
00427     static Entity entity[ NUM_ENTITY ];
00428     static bool condenseWhiteSpace;
00429 };
00430
00431
00438 class TiXmlNode : public TiXmlBase
00439 {
00440     friend class TiXmlDocument;
00441     friend class TiXmlElement;
00442
00443 public:
00444     #ifdef TIXML_USE_STL
00445
00449         friend std::istream& operator >> (std::istream& in, TiXmlNode& base);
00450
00467         friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base);
00468
00470         friend std::string& operator<< (std::string& out, const TiXmlNode& base );
00471
00472     #endif
00473
00477     enum NodeType
00478     {
00479         DOCUMENT,
00480         ELEMENT,
00481         COMMENT,
00482         UNKNOWN,
00483         TEXT,
00484         DECLARATION,
00485         STYLESHEETREFERENCE,
00486         TYPECOUNT
00487     };
00488
00489     virtual ~TiXmlNode();
00490
00503     const char *Value() const { return value.c_str (); }
00504
00505     #ifdef TIXML_USE_STL
00506
00510     const std::string& ValueStr() const { return value; }
00511     #endif
00512
00513     const TIXML_STRING& ValueTStr() const { return value; }
00514
00524     void SetValue(const char * _value) { value = _value;}
00525
00526     #ifdef TIXML_USE_STL
00528     void SetValue( const std::string& _value )  { value = _value; }
00529     #endif
00530
00532     void Clear();
00533
00535     TiXmlNode* Parent()                         { return parent; }
00536     const TiXmlNode* Parent() const             { return parent; }
00537
00538     const TiXmlNode* FirstChild()   const       { return firstChild; }
00539     TiXmlNode* FirstChild()                     { return firstChild; }
00540     const TiXmlNode* FirstChild( const char * value ) const;
00541
00542     TiXmlNode* FirstChild( const char * _value ) {
00543         // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe)
00544         // call the method, cast the return back to non-const.
00545         return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value ));
00546     }
00547     const TiXmlNode* LastChild() const  { return lastChild; }
00548     TiXmlNode* LastChild()  { return lastChild; }
00549
00550     const TiXmlNode* LastChild( const char * value ) const;
00551     TiXmlNode* LastChild( const char * _value ) {
00552         return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value ));
00553     }
00554
00555     #ifdef TIXML_USE_STL
00556     const TiXmlNode* FirstChild( const std::string& _value ) const  {   return FirstChild (_value.c_str ());    }
00557     TiXmlNode* FirstChild( const std::string& _value )              {   return FirstChild (_value.c_str ());    }
00558     const TiXmlNode* LastChild( const std::string& _value ) const   {   return LastChild (_value.c_str ()); }
00559     TiXmlNode* LastChild( const std::string& _value )               {   return LastChild (_value.c_str ()); }
00560     #endif
00561
00578     const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const;
00579     TiXmlNode* IterateChildren( const TiXmlNode* previous ) {
00580         return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) );
00581     }
00582
00584     const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const;
00585     TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) {
00586         return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) );
00587     }
00588
00589     #ifdef TIXML_USE_STL
00590     const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const  {   return IterateChildren (_value.c_str (), previous); }
00591     TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) {    return IterateChildren (_value.c_str (), previous); }
00592     #endif
00593
00597     TiXmlNode* InsertEndChild( const TiXmlNode& addThis );
00598
00599
00609     TiXmlNode* LinkEndChild( TiXmlNode* addThis );
00610
00614     TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis );
00615
00619     TiXmlNode* InsertAfterChild(  TiXmlNode* afterThis, const TiXmlNode& addThis );
00620
00624     TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis );
00625
00627     bool RemoveChild( TiXmlNode* removeThis );
00628
00630     const TiXmlNode* PreviousSibling() const            { return prev; }
00631     TiXmlNode* PreviousSibling()                        { return prev; }
00632
00634     const TiXmlNode* PreviousSibling( const char * ) const;
00635     TiXmlNode* PreviousSibling( const char *_prev ) {
00636         return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) );
00637     }
00638
00639     #ifdef TIXML_USE_STL
00640     const TiXmlNode* PreviousSibling( const std::string& _value ) const {   return PreviousSibling (_value.c_str ());   }
00641     TiXmlNode* PreviousSibling( const std::string& _value )             {   return PreviousSibling (_value.c_str ());   }
00642     const TiXmlNode* NextSibling( const std::string& _value) const      {   return NextSibling (_value.c_str ());   }
00643     TiXmlNode* NextSibling( const std::string& _value)                  {   return NextSibling (_value.c_str ());   }
00644     #endif
00645
00647     const TiXmlNode* NextSibling() const                { return next; }
00648     TiXmlNode* NextSibling()                            { return next; }
00649
00651     const TiXmlNode* NextSibling( const char * ) const;
00652     TiXmlNode* NextSibling( const char* _next ) {
00653         return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) );
00654     }
00655
00660     const TiXmlElement* NextSiblingElement() const;
00661     TiXmlElement* NextSiblingElement() {
00662         return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() );
00663     }
00664
00669     const TiXmlElement* NextSiblingElement( const char * ) const;
00670     TiXmlElement* NextSiblingElement( const char *_next ) {
00671         return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) );
00672     }
00673
00674     #ifdef TIXML_USE_STL
00675     const TiXmlElement* NextSiblingElement( const std::string& _value) const    {   return NextSiblingElement (_value.c_str ());    }
00676     TiXmlElement* NextSiblingElement( const std::string& _value)                {   return NextSiblingElement (_value.c_str ());    }
00677     #endif
00678
00680     const TiXmlElement* FirstChildElement() const;
00681     TiXmlElement* FirstChildElement() {
00682         return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() );
00683     }
00684
00686     const TiXmlElement* FirstChildElement( const char * _value ) const;
00687     TiXmlElement* FirstChildElement( const char * _value ) {
00688         return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) );
00689     }
00690
00691     #ifdef TIXML_USE_STL
00692     const TiXmlElement* FirstChildElement( const std::string& _value ) const    {   return FirstChildElement (_value.c_str ()); }
00693     TiXmlElement* FirstChildElement( const std::string& _value )                {   return FirstChildElement (_value.c_str ()); }
00694     #endif
00695
00700     int Type() const    { return type; }
00701
00705     const TiXmlDocument* GetDocument() const;
00706     TiXmlDocument* GetDocument() {
00707         return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() );
00708     }
00709
00711     bool NoChildren() const                     { return !firstChild; }
00712
00713     virtual const TiXmlDocument*    ToDocument()    const { return 0; }
00714     virtual const TiXmlElement*     ToElement()     const { return 0; }
00715     virtual const TiXmlComment*     ToComment()     const { return 0; }
00716     virtual const TiXmlUnknown*     ToUnknown()     const { return 0; }
00717     virtual const TiXmlText*        ToText()        const { return 0; }
00718     virtual const TiXmlDeclaration* ToDeclaration() const { return 0; }
00719     virtual const TiXmlStylesheetReference* ToStylesheetReference() const { return 0; }
00720
00721     virtual TiXmlDocument*          ToDocument()    { return 0; }
00722     virtual TiXmlElement*           ToElement()     { return 0; }
00723     virtual TiXmlComment*           ToComment()     { return 0; }
00724     virtual TiXmlUnknown*           ToUnknown()     { return 0; }
00725     virtual TiXmlText*              ToText()        { return 0; }
00726     virtual TiXmlDeclaration*       ToDeclaration() { return 0; }
00727     virtual TiXmlStylesheetReference*       ToStylesheetReference() { return 0; }
00728
00732     virtual TiXmlNode* Clone() const = 0;
00733
00756     virtual bool Accept( TiXmlVisitor* visitor ) const = 0;
00757
00758 protected:
00759     TiXmlNode( NodeType _type );
00760
00761     // Copy to the allocated object. Shared functionality between Clone, Copy constructor,
00762     // and the assignment operator.
00763     void CopyTo( TiXmlNode* target ) const;
00764
00765     #ifdef TIXML_USE_STL
00766         // The real work of the input operator.
00767     virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0;
00768     #endif
00769
00770     // Figure out what is at *p, and parse it. Returns null if it is not an xml node.
00771     TiXmlNode* Identify( const char* start, TiXmlEncoding encoding );
00772
00773     TiXmlNode*      parent;
00774     NodeType        type;
00775
00776     TiXmlNode*      firstChild;
00777     TiXmlNode*      lastChild;
00778
00779     TIXML_STRING    value;
00780
00781     TiXmlNode*      prev;
00782     TiXmlNode*      next;
00783
00784 private:
00785     TiXmlNode( const TiXmlNode& );              // not implemented.
00786     void operator=( const TiXmlNode& base );    // not allowed.
00787 };
00788
00789
00797 class TiXmlAttribute : public TiXmlBase
00798 {
00799     friend class TiXmlAttributeSet;
00800
00801 public:
00803     TiXmlAttribute() : TiXmlBase()
00804     {
00805         document = 0;
00806         prev = next = 0;
00807     }
00808
00809     #ifdef TIXML_USE_STL
00811     TiXmlAttribute( const std::string& _name, const std::string& _value )
00812     {
00813         name = _name;
00814         value = _value;
00815         document = 0;
00816         prev = next = 0;
00817     }
00818     #endif
00819
00821     TiXmlAttribute( const char * _name, const char * _value )
00822     {
00823         name = _name;
00824         value = _value;
00825         document = 0;
00826         prev = next = 0;
00827     }
00828
00829     const char*     Name()  const       { return name.c_str(); }
00830     const char*     Value() const       { return value.c_str(); }
00831     #ifdef TIXML_USE_STL
00832     const std::string& ValueStr() const { return value; }
00833     #endif
00834     int             IntValue() const;
00835     double          DoubleValue() const;
00836
00837     // Get the tinyxml string representation
00838     const TIXML_STRING& NameTStr() const { return name; }
00839
00849     int QueryIntValue( int* _value ) const;
00851     int QueryDoubleValue( double* _value ) const;
00852
00853     void SetName( const char* _name )   { name = _name; }
00854     void SetValue( const char* _value ) { value = _value; }
00855
00856     void SetIntValue( int _value );
00857     void SetDoubleValue( double _value );
00858
00859     #ifdef TIXML_USE_STL
00861     void SetName( const std::string& _name )    { name = _name; }
00863     void SetValue( const std::string& _value )  { value = _value; }
00864     #endif
00865
00867     const TiXmlAttribute* Next() const;
00868     TiXmlAttribute* Next() {
00869         return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() );
00870     }
00871
00873     const TiXmlAttribute* Previous() const;
00874     TiXmlAttribute* Previous() {
00875         return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() );
00876     }
00877
00878     bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; }
00879     bool operator<( const TiXmlAttribute& rhs )  const { return name < rhs.name; }
00880     bool operator>( const TiXmlAttribute& rhs )  const { return name > rhs.name; }
00881
00882     /*  Attribute parsing starts: first letter of the name
00883                          returns: the next char after the value end quote
00884     */
00885     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
00886
00887     // Prints this Attribute to a FILE stream.
00888     virtual void Print( FILE* cfile, int depth ) const {
00889         Print( cfile, depth, 0 );
00890     }
00891     void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
00892
00893     // [internal use]
00894     // Set the document pointer so the attribute can report errors.
00895     void SetDocument( TiXmlDocument* doc )  { document = doc; }
00896
00897 private:
00898     TiXmlAttribute( const TiXmlAttribute& );                // not implemented.
00899     void operator=( const TiXmlAttribute& base );   // not allowed.
00900
00901     TiXmlDocument*  document;   // A pointer back to a document, for error reporting.
00902     TIXML_STRING name;
00903     TIXML_STRING value;
00904     TiXmlAttribute* prev;
00905     TiXmlAttribute* next;
00906 };
00907
00908
00909 /*  A class used to manage a group of attributes.
00910     It is only used internally, both by the ELEMENT and the DECLARATION.
00911
00912     The set can be changed transparent to the Element and Declaration
00913     classes that use it, but NOT transparent to the Attribute
00914     which has to implement a next() and previous() method. Which makes
00915     it a bit problematic and prevents the use of STL.
00916
00917     This version is implemented with circular lists because:
00918         - I like circular lists
00919         - it demonstrates some independence from the (typical) doubly linked list.
00920 */
00921 class TiXmlAttributeSet
00922 {
00923 public:
00924     TiXmlAttributeSet();
00925     ~TiXmlAttributeSet();
00926
00927     void Add( TiXmlAttribute* attribute );
00928     void Remove( TiXmlAttribute* attribute );
00929
00930     const TiXmlAttribute* First()   const   { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
00931     TiXmlAttribute* First()                 { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
00932     const TiXmlAttribute* Last() const      { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
00933     TiXmlAttribute* Last()                  { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
00934
00935     const TiXmlAttribute*   Find( const char* _name ) const;
00936     TiXmlAttribute* Find( const char* _name ) {
00937         return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
00938     }
00939     #ifdef TIXML_USE_STL
00940     const TiXmlAttribute*   Find( const std::string& _name ) const;
00941     TiXmlAttribute* Find( const std::string& _name ) {
00942         return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
00943     }
00944
00945     #endif
00946
00947 private:
00948     //*ME:  Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element),
00949     //*ME:  this class must be also use a hidden/disabled copy-constructor !!!
00950     TiXmlAttributeSet( const TiXmlAttributeSet& );  // not allowed
00951     void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute)
00952
00953     TiXmlAttribute sentinel;
00954 };
00955
00956
00961 class TiXmlElement : public TiXmlNode
00962 {
00963 public:
00965     TiXmlElement (const char * in_value);
00966
00967     #ifdef TIXML_USE_STL
00969     TiXmlElement( const std::string& _value );
00970     #endif
00971
00972     TiXmlElement( const TiXmlElement& );
00973
00974     void operator=( const TiXmlElement& base );
00975
00976     virtual ~TiXmlElement();
00977
00981     const char* Attribute( const char* name ) const;
00982
00989     const char* Attribute( const char* name, int* i ) const;
00990
00997     const char* Attribute( const char* name, double* d ) const;
00998
01006     int QueryIntAttribute( const char* name, int* _value ) const;
01008     int QueryDoubleAttribute( const char* name, double* _value ) const;
01010     int QueryFloatAttribute( const char* name, float* _value ) const {
01011         double d;
01012         int result = QueryDoubleAttribute( name, &d );
01013         if ( result == TIXML_SUCCESS ) {
01014             *_value = (float)d;
01015         }
01016         return result;
01017     }
01018
01019     #ifdef TIXML_USE_STL
01020
01028     template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const
01029     {
01030         const TiXmlAttribute* node = attributeSet.Find( name );
01031         if ( !node )
01032             return TIXML_NO_ATTRIBUTE;
01033
01034         std::stringstream sstream( node->ValueStr() );
01035         sstream >> *outValue;
01036         if ( !sstream.fail() )
01037             return TIXML_SUCCESS;
01038         return TIXML_WRONG_TYPE;
01039     }
01040     /*
01041      This is - in theory - a bug fix for "QueryValueAtribute returns truncated std::string"
01042      but template specialization is hard to get working cross-compiler. Leaving the bug for now.
01043
01044     // The above will fail for std::string because the space character is used as a seperator.
01045     // Specialize for strings. Bug [ 1695429 ] QueryValueAtribute returns truncated std::string
01046     template<> int QueryValueAttribute( const std::string& name, std::string* outValue ) const
01047     {
01048         const TiXmlAttribute* node = attributeSet.Find( name );
01049         if ( !node )
01050             return TIXML_NO_ATTRIBUTE;
01051         *outValue = node->ValueStr();
01052         return TIXML_SUCCESS;
01053     }
01054     */
01055     #endif
01056
01060     void SetAttribute( const char* name, const char * _value );
01061
01062     #ifdef TIXML_USE_STL
01063     const std::string* Attribute( const std::string& name ) const;
01064     const std::string* Attribute( const std::string& name, int* i ) const;
01065     const std::string* Attribute( const std::string& name, double* d ) const;
01066     int QueryIntAttribute( const std::string& name, int* _value ) const;
01067     int QueryDoubleAttribute( const std::string& name, double* _value ) const;
01068
01070     void SetAttribute( const std::string& name, const std::string& _value );
01072     void SetAttribute( const std::string& name, int _value );
01073     #endif
01074
01078     void SetAttribute( const char * name, int value );
01079
01083     void SetDoubleAttribute( const char * name, double value );
01084
01087     void RemoveAttribute( const char * name );
01088     #ifdef TIXML_USE_STL
01089     void RemoveAttribute( const std::string& name ) {   RemoveAttribute (name.c_str ());    }
01090     #endif
01091
01092     const TiXmlAttribute* FirstAttribute() const    { return attributeSet.First(); }
01093     TiXmlAttribute* FirstAttribute()                { return attributeSet.First(); }
01094     const TiXmlAttribute* LastAttribute()   const   { return attributeSet.Last(); }
01095     TiXmlAttribute* LastAttribute()                 { return attributeSet.Last(); }
01096
01129     const char* GetText() const;
01130
01132     virtual TiXmlNode* Clone() const;
01133     // Print the Element to a FILE stream.
01134     virtual void Print( FILE* cfile, int depth ) const;
01135
01136     /*  Attribtue parsing starts: next char past '<'
01137                          returns: next char past '>'
01138     */
01139     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
01140
01141     virtual const TiXmlElement*     ToElement()     const { return this; }
01142     virtual TiXmlElement*           ToElement()           { return this; }
01143
01146     virtual bool Accept( TiXmlVisitor* visitor ) const;
01147
01148 protected:
01149
01150     void CopyTo( TiXmlElement* target ) const;
01151     void ClearThis();   // like clear, but initializes 'this' object as well
01152
01153     // Used to be public [internal use]
01154     #ifdef TIXML_USE_STL
01155     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
01156     #endif
01157     /*  [internal use]
01158         Reads the "value" of the element -- another element, or text.
01159         This should terminate with the current end tag.
01160     */
01161     const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding );
01162
01163 private:
01164
01165     TiXmlAttributeSet attributeSet;
01166 };
01167
01168
01171 class TiXmlComment : public TiXmlNode
01172 {
01173 public:
01175     TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {}
01177     TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::COMMENT ) {
01178         SetValue( _value );
01179     }
01180     TiXmlComment( const TiXmlComment& );
01181     void operator=( const TiXmlComment& base );
01182
01183     virtual ~TiXmlComment() {}
01184
01186     virtual TiXmlNode* Clone() const;
01187     // Write this Comment to a FILE stream.
01188     virtual void Print( FILE* cfile, int depth ) const;
01189
01190     /*  Attribtue parsing starts: at the ! of the !--
01191                          returns: next char past '>'
01192     */
01193     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
01194
01195     virtual const TiXmlComment*  ToComment() const { return this; }
01196     virtual TiXmlComment*  ToComment() { return this; }
01197
01200     virtual bool Accept( TiXmlVisitor* visitor ) const;
01201
01202 protected:
01203     void CopyTo( TiXmlComment* target ) const;
01204
01205     // used to be public
01206     #ifdef TIXML_USE_STL
01207     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
01208     #endif
01209 //  virtual void StreamOut( TIXML_OSTREAM * out ) const;
01210
01211 private:
01212
01213 };
01214
01215
01221 class TiXmlText : public TiXmlNode
01222 {
01223     friend class TiXmlElement;
01224 public:
01229     TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT)
01230     {
01231         SetValue( initValue );
01232         cdata = false;
01233     }
01234     virtual ~TiXmlText() {}
01235
01236     #ifdef TIXML_USE_STL
01238     TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT)
01239     {
01240         SetValue( initValue );
01241         cdata = false;
01242     }
01243     #endif
01244
01245     TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT )   { copy.CopyTo( this ); }
01246     void operator=( const TiXmlText& base )                             { base.CopyTo( this ); }
01247
01248     // Write this text object to a FILE stream.
01249     virtual void Print( FILE* cfile, int depth ) const;
01250
01252     bool CDATA() const              { return cdata; }
01254     void SetCDATA( bool _cdata )    { cdata = _cdata; }
01255
01256     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
01257
01258     virtual const TiXmlText* ToText() const { return this; }
01259     virtual TiXmlText*       ToText()       { return this; }
01260
01263     virtual bool Accept( TiXmlVisitor* content ) const;
01264
01265 protected :
01267     virtual TiXmlNode* Clone() const;
01268     void CopyTo( TiXmlText* target ) const;
01269
01270     bool Blank() const; // returns true if all white space and new lines
01271     // [internal use]
01272     #ifdef TIXML_USE_STL
01273     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
01274     #endif
01275
01276 private:
01277     bool cdata;         // true if this should be input and output as a CDATA style text element
01278 };
01279
01280
01294 class TiXmlDeclaration : public TiXmlNode
01295 {
01296 public:
01298     TiXmlDeclaration()   : TiXmlNode( TiXmlNode::DECLARATION ) {}
01299
01300 #ifdef TIXML_USE_STL
01302     TiXmlDeclaration(   const std::string& _version,
01303                         const std::string& _encoding,
01304                         const std::string& _standalone );
01305 #endif
01306
01308     TiXmlDeclaration(   const char* _version,
01309                         const char* _encoding,
01310                         const char* _standalone );
01311
01312     TiXmlDeclaration( const TiXmlDeclaration& copy );
01313     void operator=( const TiXmlDeclaration& copy );
01314
01315     virtual ~TiXmlDeclaration() {}
01316
01318     const char *Version() const         { return version.c_str (); }
01320     const char *Encoding() const        { return encoding.c_str (); }
01322     const char *Standalone() const      { return standalone.c_str (); }
01323
01325     virtual TiXmlNode* Clone() const;
01326     // Print this declaration to a FILE stream.
01327     virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
01328     virtual void Print( FILE* cfile, int depth ) const {
01329         Print( cfile, depth, 0 );
01330     }
01331
01332     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
01333
01334     virtual const TiXmlDeclaration* ToDeclaration() const { return this; }
01335     virtual TiXmlDeclaration*       ToDeclaration()       { return this; }
01336
01339     virtual bool Accept( TiXmlVisitor* visitor ) const;
01340
01341 protected:
01342     void CopyTo( TiXmlDeclaration* target ) const;
01343     // used to be public
01344     #ifdef TIXML_USE_STL
01345     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
01346     #endif
01347
01348 private:
01349
01350     TIXML_STRING version;
01351     TIXML_STRING encoding;
01352     TIXML_STRING standalone;
01353 };
01354
01364 class TiXmlStylesheetReference : public TiXmlNode
01365 {
01366 public:
01368     TiXmlStylesheetReference()   : TiXmlNode( TiXmlNode::STYLESHEETREFERENCE ) {}
01369
01370 #ifdef TIXML_USE_STL
01372     TiXmlStylesheetReference(   const std::string& _type,
01373                                 const std::string& _href );
01374 #endif
01375
01377     TiXmlStylesheetReference(   const char* _type,
01378                                 const char* _href );
01379
01380     TiXmlStylesheetReference( const TiXmlStylesheetReference& copy );
01381     void operator=( const TiXmlStylesheetReference& copy );
01382
01383     virtual ~TiXmlStylesheetReference() {}
01384
01386     const char *Type() const { return type.c_str (); }
01388     const char *Href() const        { return href.c_str (); }
01389
01391     virtual TiXmlNode* Clone() const;
01392     // Print this declaration to a FILE stream.
01393     virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
01394     virtual void Print( FILE* cfile, int depth ) const {
01395         Print( cfile, depth, 0 );
01396     }
01397
01398     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
01399
01400     virtual const TiXmlStylesheetReference* ToStylesheetReference() const { return this; }
01401     virtual TiXmlStylesheetReference*       ToStylesheetReference()       { return this; }
01402
01405     virtual bool Accept( TiXmlVisitor* visitor ) const;
01406
01407 protected:
01408     void CopyTo( TiXmlStylesheetReference* target ) const;
01409     // used to be public
01410     #ifdef TIXML_USE_STL
01411     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
01412     #endif
01413
01414 private:
01415
01416     TIXML_STRING type;
01417     TIXML_STRING href;
01418 };
01419
01427 class TiXmlUnknown : public TiXmlNode
01428 {
01429 public:
01430     TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN )    {}
01431     virtual ~TiXmlUnknown() {}
01432
01433     TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN )      { copy.CopyTo( this ); }
01434     void operator=( const TiXmlUnknown& copy )                                      { copy.CopyTo( this ); }
01435
01437     virtual TiXmlNode* Clone() const;
01438     // Print this Unknown to a FILE stream.
01439     virtual void Print( FILE* cfile, int depth ) const;
01440
01441     virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
01442
01443     virtual const TiXmlUnknown*     ToUnknown()     const { return this; }
01444     virtual TiXmlUnknown*           ToUnknown()     { return this; }
01445
01448     virtual bool Accept( TiXmlVisitor* content ) const;
01449
01450 protected:
01451     void CopyTo( TiXmlUnknown* target ) const;
01452
01453     #ifdef TIXML_USE_STL
01454     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
01455     #endif
01456
01457 private:
01458
01459 };
01460
01461
01466 class TiXmlDocument : public TiXmlNode
01467 {
01468 public:
01470     TiXmlDocument();
01472     TiXmlDocument( const char * documentName );
01473
01474     #ifdef TIXML_USE_STL
01476     TiXmlDocument( const std::string& documentName );
01477     #endif
01478
01479     TiXmlDocument( const TiXmlDocument& copy );
01480     void operator=( const TiXmlDocument& copy );
01481
01482     virtual ~TiXmlDocument() {}
01483
01488     bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
01490     bool SaveFile() const;
01492     bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
01494     bool SaveFile( const char * filename ) const;
01500     bool LoadFile( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
01502     bool SaveFile( FILE* ) const;
01503
01504     #ifdef TIXML_USE_STL
01505     bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING )
01506     {
01507 //      StringToBuffer f( filename );
01508 //      return ( f.buffer && LoadFile( f.buffer, encoding ));
01509         return LoadFile( filename.c_str(), encoding );
01510     }
01511     bool SaveFile( const std::string& filename ) const
01512     {
01513 //      StringToBuffer f( filename );
01514 //      return ( f.buffer && SaveFile( f.buffer ));
01515         return SaveFile( filename.c_str() );
01516     }
01517     #endif
01518
01523     virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
01524
01529     const TiXmlElement* RootElement() const     { return FirstChildElement(); }
01530     TiXmlElement* RootElement()                 { return FirstChildElement(); }
01531
01537     bool Error() const                      { return error; }
01538
01540     const char * ErrorDesc() const  { return errorDesc.c_str (); }
01541
01545     int ErrorId()   const               { return errorId; }
01546
01554     int ErrorRow() const    { return errorLocation.row+1; }
01555     int ErrorCol() const    { return errorLocation.col+1; }
01556
01581     void SetTabSize( int _tabsize )     { tabsize = _tabsize; }
01582
01583     int TabSize() const { return tabsize; }
01584
01588     void ClearError()                       {   error = false;
01589                                                 errorId = 0;
01590                                                 errorDesc = "";
01591                                                 errorLocation.row = errorLocation.col = 0;
01592                                                 //errorLocation.last = 0;
01593                                             }
01594
01596     void Print() const                      { Print( stdout, 0 ); }
01597
01598     /* Write the document to a string using formatted printing ("pretty print"). This
01599         will allocate a character array (new char[]) and return it as a pointer. The
01600         calling code pust call delete[] on the return char* to avoid a memory leak.
01601     */
01602     //char* PrintToMemory() const;
01603
01605     virtual void Print( FILE* cfile, int depth = 0 ) const;
01606     // [internal use]
01607     void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding );
01608
01609     virtual const TiXmlDocument*    ToDocument()    const { return this; }
01610     virtual TiXmlDocument*          ToDocument()          { return this; }
01611
01614     virtual bool Accept( TiXmlVisitor* content ) const;
01615
01616 protected :
01617     // [internal use]
01618     virtual TiXmlNode* Clone() const;
01619     #ifdef TIXML_USE_STL
01620     virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
01621     #endif
01622
01623 private:
01624     void CopyTo( TiXmlDocument* target ) const;
01625
01626     bool error;
01627     int  errorId;
01628     TIXML_STRING errorDesc;
01629     int tabsize;
01630     TiXmlCursor errorLocation;
01631     bool useMicrosoftBOM;       // the UTF-8 BOM were found when read. Note this, and try to write.
01632 };
01633
01634
01715 class TiXmlHandle
01716 {
01717 public:
01719     TiXmlHandle( TiXmlNode* _node )                 { this->node = _node; }
01721     TiXmlHandle( const TiXmlHandle& ref )           { this->node = ref.node; }
01722     TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; }
01723
01725     TiXmlHandle FirstChild() const;
01727     TiXmlHandle FirstChild( const char * value ) const;
01729     TiXmlHandle FirstChildElement() const;
01731     TiXmlHandle FirstChildElement( const char * value ) const;
01732
01736     TiXmlHandle Child( const char* value, int index ) const;
01740     TiXmlHandle Child( int index ) const;
01745     TiXmlHandle ChildElement( const char* value, int index ) const;
01750     TiXmlHandle ChildElement( int index ) const;
01751
01752     #ifdef TIXML_USE_STL
01753     TiXmlHandle FirstChild( const std::string& _value ) const               { return FirstChild( _value.c_str() ); }
01754     TiXmlHandle FirstChildElement( const std::string& _value ) const        { return FirstChildElement( _value.c_str() ); }
01755
01756     TiXmlHandle Child( const std::string& _value, int index ) const         { return Child( _value.c_str(), index ); }
01757     TiXmlHandle ChildElement( const std::string& _value, int index ) const  { return ChildElement( _value.c_str(), index ); }
01758     #endif
01759
01762     TiXmlNode* ToNode() const           { return node; }
01765     TiXmlElement* ToElement() const     { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); }
01768     TiXmlText* ToText() const           { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); }
01771     TiXmlUnknown* ToUnknown() const     { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); }
01772
01776     TiXmlNode* Node() const         { return ToNode(); }
01780     TiXmlElement* Element() const   { return ToElement(); }
01784     TiXmlText* Text() const         { return ToText(); }
01788     TiXmlUnknown* Unknown() const   { return ToUnknown(); }
01789
01790 private:
01791     TiXmlNode* node;
01792 };
01793
01794
01814 class TiXmlPrinter : public TiXmlVisitor
01815 {
01816 public:
01817     TiXmlPrinter() : depth( 0 ), simpleTextPrint( false ),
01818                      buffer(), indent( "    " ), lineBreak( "\n" ) {}
01819
01820     virtual bool VisitEnter( const TiXmlDocument& doc );
01821     virtual bool VisitExit( const TiXmlDocument& doc );
01822
01823     virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute );
01824     virtual bool VisitExit( const TiXmlElement& element );
01825
01826     virtual bool Visit( const TiXmlDeclaration& declaration );
01827     virtual bool Visit( const TiXmlText& text );
01828     virtual bool Visit( const TiXmlComment& comment );
01829     virtual bool Visit( const TiXmlUnknown& unknown );
01830
01834     void SetIndent( const char* _indent )           { indent = _indent ? _indent : "" ; }
01836     const char* Indent()                            { return indent.c_str(); }
01841     void SetLineBreak( const char* _lineBreak )     { lineBreak = _lineBreak ? _lineBreak : ""; }
01843     const char* LineBreak()                         { return lineBreak.c_str(); }
01844
01848     void SetStreamPrinting()                        { indent = "";
01849                                                       lineBreak = "";
01850                                                     }
01852     const char* CStr()                              { return buffer.c_str(); }
01854     size_t Size()                                   { return buffer.size(); }
01855
01856     #ifdef TIXML_USE_STL
01858     const std::string& Str()                        { return buffer; }
01859     #endif
01860
01861 private:
01862     void DoIndent() {
01863         for( int i=0; i<depth; ++i )
01864             buffer += indent;
01865     }
01866     void DoLineBreak() {
01867         buffer += lineBreak;
01868     }
01869
01870     int depth;
01871     bool simpleTextPrint;
01872     TIXML_STRING buffer;
01873     TIXML_STRING indent;
01874     TIXML_STRING lineBreak;
01875 };
01876
01877
01878 #ifdef _MSC_VER
01879 #pragma warning( pop )
01880 #endif
01881
01882 #endif
01883
Generated on Tue Oct 2 10:39:49 2007 for TinyXml by doxygen 1.5.3