osgEarth 2.1.1
Namespaces | Defines | Functions | Variables

/home/cube/sources/osgearth/src/osgEarth/XmlUtils.cpp File Reference

#include <osgEarth/XmlUtils>
#include <osgEarth/StringUtils>
#include <osgEarth/HTTPClient>
#include <osg/Notify>
#include "tinyxml.h"
#include <algorithm>
#include <sstream>
#include <iomanip>
Include dependency graph for XmlUtils.cpp:

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{XmlUtils.cpp}

Defines

#define INDENT   4

Functions

XmlAttributes anonymous_namespace{XmlUtils.cpp}::getAttributes (const char **attrs)
void anonymous_namespace{XmlUtils.cpp}::processNode (XmlElement *parent, TiXmlNode *node)
void anonymous_namespace{XmlUtils.cpp}::removeDocType (std::string &xmlStr)
static void storeNode (const XmlNode *node, int depth, std::ostream &out)

Variables

static std::string EMPTY_VALUE = ""

Define Documentation

#define INDENT   4

Definition at line 444 of file XmlUtils.cpp.


Function Documentation

static void storeNode ( const XmlNode node,
int  depth,
std::ostream &  out 
) [static]

Definition at line 447 of file XmlUtils.cpp.

{
    out << std::fixed; // always use fixed notation

    for( int k=0; k<depth*INDENT; k++ ) out << " ";

    if ( node->isElement() )
    {
        XmlElement* e = (XmlElement*)node;
        out << "<" << e->getName();
        for( XmlAttributes::iterator a = e->getAttrs().begin(); a != e->getAttrs().end(); a++ )
        {
            out << " " << a->first << "=" << "\"" << a->second << "\"";
        }
        out << ">" << std::endl;
        for( XmlNodeList::iterator i = e->getChildren().begin(); i != e->getChildren().end(); i++ )
        {
            storeNode( i->get(), depth+1, out );
        }
        for( int k=0; k<depth*INDENT; k++ ) out << " ";
        out << "</" << e->getName() << ">" << std::endl;
    }
    else if ( node->isText() )
    {
        XmlText* t = (XmlText*)node;
        const std::string& text = t->getValue();
        if ( text.find_first_of( "<&" ) != std::string::npos )
            out << "<![CDATA[" << text << "]]>" << std::endl;
        else
            out << text << std::endl;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

std::string EMPTY_VALUE = "" [static]

Definition at line 33 of file XmlUtils.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines