IncredibleXMLParser  3.05
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions | Variables
IXMLTest.cpp File Reference
#include <stdio.h>
#include "IXMLParser.h"

Go to the source code of this file.

Functions

void myfree (char *t)
 
void example1 ()
 Example 1: Basic operations to parse and collect data from a XML file //. More...
 
void example2 ()
 Example 2: memory management: when to use the 'stringDup' and the 'free' functions //. More...
 
void example3 ()
 Example 3: constructing & updating a tree of XMLNode //. More...
 
void example4 ()
 Example 4: by default, the XML parser is "forgiving" with respect to errors inside XML strings&files //. More...
 
void example5 ()
 Example 5: deleting a part of the tree of XMLNode //. More...
 
void example6 ()
 Example 6: inserting (and moving) a new XMLNode in the middle of an already existing XMLNode structure //. More...
 
void example7 ()
 Example 7: enumerate all the content of a xmlNode in the order in which they appear inside the XML //. More...
 
void example8 ()
 Example 8: base 64 encoding/decoding //. More...
 
void example9 ()
 Example 9: demonstration of multi-lingual XML file parsing //. More...
 
void example10 ()
 Example 10: usage of the "getParentNode()" method //. More...
 
void example11 ()
 Example 11: usage of the ToXMLStringTool class //. More...
 
void example12 ()
 Example 12: JSON Parser //. More...
 
int main (int argc, char **argv)
 

Variables

ToIXMLStringTool tx
 
ToIXMLStringTool tx2
 
const char * t2 ="<a><b>some text</b><b>other text </a>"
 

Detailed Description

IXMTest.cpp - Incredible XML Parser - test examples - char* version

Version
V3.05
Author
Frank Vanden Berghen

Copyright (c) 2013, Frank Vanden Berghen - All rights reserved.
See the file "AFPL-license.txt" about the licensing terms

This file contains 11 examples that demonstrates how to use the different functionnalities of the Incredible XML Parser in char* mode.

Definition in file IXMLTest.cpp.

Function Documentation

void example1 ( )
void example10 ( )

Example 10: usage of the "getParentNode()" method //.

Definition at line 258 of file IXMLTest.cpp.

References ITCXMLNode::deepCopy(), IXMLNode::getChildNode(), ITCXMLNode::getName(), IXMLNode::getParentNode(), IXMLDomParser::parseString(), and t2.

Referenced by main().

void example11 ( )

Example 11: usage of the ToXMLStringTool class //.

Definition at line 287 of file IXMLTest.cpp.

References ToIXMLStringTool::toXML().

Referenced by main().

void example12 ( )

Example 12: JSON Parser //.

Definition at line 325 of file IXMLTest.cpp.

References ITCXMLNode::getElementByPath(), IXMLDomParser::parse(), and IXMLRenderer::writeToFile().

Referenced by main().

void example2 ( )

Example 2: memory management: when to use the 'stringDup' and the 'free' functions //.

Definition at line 71 of file IXMLTest.cpp.

References IXMLDomParser::clear(), ITCXMLNode::getAttribute(), IXMLStringDup(), myfree(), and IXMLDomParser::openFileHelper().

Referenced by main().

void example3 ( )
void example4 ( )

Example 4: by default, the XML parser is "forgiving" with respect to errors inside XML strings&files //.

Definition at line 131 of file IXMLTest.cpp.

References IXMLResults::errorCode, IPullParser::getErrorMessage(), IXMLRenderer::getString(), IXMLDomParser::parseStringNonT(), and t2.

Referenced by main().

void example5 ( )

Example 5: deleting a part of the tree of XMLNode //.

Definition at line 150 of file IXMLTest.cpp.

References ITCXMLNode::deepCopy(), IXMLNode::deleteNodeContent(), IXMLNode::getChildNode(), IXMLDomParser::parseString(), and t2.

Referenced by main().

void example6 ( )

Example 6: inserting (and moving) a new XMLNode in the middle of an already existing XMLNode structure //.

Definition at line 176 of file IXMLTest.cpp.

References IXMLNode::addChild(), ITCXMLNode::deepCopy(), IXMLRenderer::getString(), IXMLDomParser::parseString(), IXMLNode::positionOfChildNode(), and t2.

Referenced by main().

void example7 ( )

Example 7: enumerate all the content of a xmlNode in the order in which they appear inside the XML //.

Definition at line 197 of file IXMLTest.cpp.

References IPullParser::findPath(), ITCXMLNode::getAttributeName(), ITCXMLNode::getAttributeValue(), ITCXMLNode::getClear(), ITCXMLNode::getName(), ITCXMLNode::nElement(), IXMLDomParser::parseOneChild(), IXMLDomParser::setRemoveClears(), and IXMLClear::sValue.

Referenced by main().

void example8 ( )

Example 8: base 64 encoding/decoding //.

Definition at line 224 of file IXMLTest.cpp.

References IXMLParserBase64Tool::decode(), and IXMLParserBase64Tool::encode().

Referenced by main().

void example9 ( )

Example 9: demonstration of multi-lingual XML file parsing //.

Definition at line 244 of file IXMLTest.cpp.

References IXMLDomParser::parseFileNonT(), and IXMLRenderer::writeToFile().

Referenced by main().

int main ( int  argc,
char **  argv 
)
void myfree ( char *  t)

Definition at line 353 of file IXMLTest.cpp.

Referenced by example2().

Variable Documentation

const char* t2 ="<a><b>some text</b><b>other text </a>"

Definition at line 25 of file IXMLTest.cpp.

Referenced by example10(), example4(), example5(), and example6().

Definition at line 24 of file IXMLTest.cpp.

Definition at line 24 of file IXMLTest.cpp.