List of all members.
Detailed Description
Definition at line 55 of file XmlUtils.
Constructor & Destructor Documentation
XmlElement::XmlElement |
( |
const std::string & |
name | ) |
|
XmlElement::XmlElement |
( |
const std::string & |
name, |
|
|
const XmlAttributes & |
attrs |
|
) |
| |
XmlElement::XmlElement |
( |
const Config & |
conf | ) |
|
Definition at line 69 of file XmlUtils.cpp.
{
name = conf.key();
for( Properties::const_iterator i = conf.attrs().begin(); i != conf.attrs().end(); i++ )
attrs[i->first] = i->second;
for( ConfigSet::const_iterator j = conf.children().begin(); j != conf.children().end(); j++ )
{
if (!j->children().empty())
{
children.push_back( new XmlElement( *j ) );
}
else
{
addSubElement(j->key(), j->attrs(), j->value());
}
}
}
virtual osgEarth::XmlElement::~XmlElement |
( |
| ) |
[inline, virtual] |
Member Function Documentation
void XmlElement::addSubElement |
( |
const std::string & |
tag, |
|
|
const std::string & |
text |
|
) |
| |
void XmlElement::addSubElement |
( |
const std::string & |
tag, |
|
|
const Properties & |
attrs, |
|
|
const std::string & |
text |
|
) |
| |
const std::string & XmlElement::getAttr |
( |
const std::string & |
key | ) |
const |
Config XmlElement::getConfig |
( |
| ) |
const [virtual] |
const std::string & XmlElement::getName |
( |
| ) |
const |
XmlElement * XmlElement::getSubElement |
( |
const std::string & |
name | ) |
const |
Definition at line 131 of file XmlUtils.cpp.
{
std::string name_lower = name;
std::transform( name_lower.begin(), name_lower.end(), name_lower.begin(), tolower );
for( XmlNodeList::const_iterator i = getChildren().begin(); i != getChildren().end(); i++ )
{
if ( i->get()->isElement() )
{
XmlElement* e = (XmlElement*)i->get();
std::string name = e->getName();
std::transform( name.begin(), name.end(), name.begin(), tolower );
if ( name == name_lower )
return e;
}
}
return NULL;
}
XmlNodeList XmlElement::getSubElements |
( |
const std::string & |
name | ) |
const |
Definition at line 180 of file XmlUtils.cpp.
{
XmlNodeList results;
std::string name_lower = name;
std::transform( name_lower.begin(), name_lower.end(), name_lower.begin(), tolower );
for( XmlNodeList::const_iterator i = getChildren().begin(); i != getChildren().end(); i++ )
{
if ( i->get()->isElement() )
{
XmlElement* e = (XmlElement*)i->get();
std::string name = e->getName();
std::transform( name.begin(), name.end(), name.begin(), tolower );
if ( name == name_lower )
results.push_back( e );
}
}
return results;
}
std::string XmlElement::getSubElementText |
( |
const std::string & |
tag | ) |
const |
std::string XmlElement::getText |
( |
| ) |
const |
Definition at line 152 of file XmlUtils.cpp.
{
std::stringstream builder;
for( XmlNodeList::const_iterator i = getChildren().begin(); i != getChildren().end(); i++ )
{
if ( i->get()->isText() )
{
builder << ( static_cast<XmlText*>( i->get() ) )->getValue();
}
}
std::string builderStr;
builderStr = builder.str();
std::string result = trim( builderStr );
return result;
}
virtual bool osgEarth::XmlElement::isElement |
( |
| ) |
const [inline, virtual] |
virtual bool osgEarth::XmlElement::isText |
( |
| ) |
const [inline, virtual] |
void XmlElement::setName |
( |
const std::string & |
name | ) |
|
Member Data Documentation
The documentation for this class was generated from the following files:
- /home/cube/sources/osgearth/src/osgEarth/XmlUtils
- /home/cube/sources/osgearth/src/osgEarth/XmlUtils.cpp