Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Teuchos::XMLObjectImplem Class Reference

The XMLObjectImplem class takes care of the low-level implementation details of XMLObject. More...

#include <Teuchos_XMLObjectImplem.hpp>

Public Member Functions

 XMLObjectImplem (const std::string &tag)
 Construct with a 'tag'. More...
 
XMLObjectImplemdeepCopy () const
 Deep copy. More...
 
void addAttribute (const std::string &name, const std::string &value)
 Add a [name, value] attribute. More...
 
void addChild (const XMLObject &child)
 Add a child XMLObject. More...
 
void addContent (const std::string &contentLine)
 Add a content line. More...
 
const std::string & getTag () const
 Return the tag std::string. More...
 
bool hasAttribute (const std::string &name) const
 Determine whether an attribute exists. More...
 
const std::string & getAttribute (const std::string &name) const
 Look up an attribute by name. More...
 
int numChildren () const
 Return the number of children. More...
 
const XMLObjectgetChild (int i) const
 Look up a child by its index. More...
 
int numContentLines () const
 Get the number of content lines. More...
 
const MapgetAttributes () const
 Get all attributes. More...
 
const std::string & getContentLine (int i) const
 Look up a content line by index. More...
 
void appendContentLine (const size_t &i, const std::string &str)
 Add string at the the end of a content line. More...
 
void removeContentLine (const size_t &i)
 Remove content line by index. More...
 
void print (std::ostream &os, int indent) const
 Print to stream with the given indentation level. Output will be well-formed XML. More...
 
std::string toString () const
 Write as a std::string. Output may be ill-formed XML. More...
 
std::string header (bool strictXML=false) const
 Write the header. More...
 
std::string terminatedHeader (bool strictXML=false) const
 Write the header terminated as <Header> More...
 
std::string footer () const
 Write the footer. More...
 

Private Types

typedef Teuchos::map
< std::string, std::string > 
Map
 

Private Member Functions

void printContent (std::ostream &os, int indent) const
 Print content lines using the given indentation level. More...
 

Static Private Member Functions

static std::string XMLifyAttVal (const std::string &attval)
 Convert attribute value text into well-formed XML. More...
 

Private Attributes

std::string tag_
 
Map attributes_
 
Array< XMLObjectchildren_
 
Array< std::string > content_
 

Detailed Description

The XMLObjectImplem class takes care of the low-level implementation details of XMLObject.

Definition at line 62 of file Teuchos_XMLObjectImplem.hpp.

Member Typedef Documentation

typedef Teuchos::map<std::string, std::string> Teuchos::XMLObjectImplem::Map
private

Definition at line 64 of file Teuchos_XMLObjectImplem.hpp.

Constructor & Destructor Documentation

XMLObjectImplem::XMLObjectImplem ( const std::string &  tag)

Construct with a 'tag'.

Definition at line 49 of file Teuchos_XMLObjectImplem.cpp.

Member Function Documentation

XMLObjectImplem * XMLObjectImplem::deepCopy ( ) const

Deep copy.

Definition at line 53 of file Teuchos_XMLObjectImplem.cpp.

void XMLObjectImplem::addAttribute ( const std::string &  name,
const std::string &  value 
)

Add a [name, value] attribute.

Definition at line 73 of file Teuchos_XMLObjectImplem.cpp.

void XMLObjectImplem::addChild ( const XMLObject child)

Add a child XMLObject.

Definition at line 79 of file Teuchos_XMLObjectImplem.cpp.

void XMLObjectImplem::addContent ( const std::string &  contentLine)

Add a content line.

Definition at line 84 of file Teuchos_XMLObjectImplem.cpp.

const std::string& Teuchos::XMLObjectImplem::getTag ( ) const
inline

Return the tag std::string.

Definition at line 83 of file Teuchos_XMLObjectImplem.hpp.

bool Teuchos::XMLObjectImplem::hasAttribute ( const std::string &  name) const
inline

Determine whether an attribute exists.

Definition at line 86 of file Teuchos_XMLObjectImplem.hpp.

const std::string& Teuchos::XMLObjectImplem::getAttribute ( const std::string &  name) const
inline

Look up an attribute by name.

Definition at line 90 of file Teuchos_XMLObjectImplem.hpp.

int XMLObjectImplem::numChildren ( ) const

Return the number of children.

Definition at line 68 of file Teuchos_XMLObjectImplem.cpp.

const XMLObject & XMLObjectImplem::getChild ( int  i) const

Look up a child by its index.

Definition at line 96 of file Teuchos_XMLObjectImplem.cpp.

int Teuchos::XMLObjectImplem::numContentLines ( ) const
inline

Get the number of content lines.

Definition at line 100 of file Teuchos_XMLObjectImplem.hpp.

const Map& Teuchos::XMLObjectImplem::getAttributes ( ) const
inline

Get all attributes.

Definition at line 103 of file Teuchos_XMLObjectImplem.hpp.

const std::string& Teuchos::XMLObjectImplem::getContentLine ( int  i) const
inline

Look up a content line by index.

Definition at line 106 of file Teuchos_XMLObjectImplem.hpp.

void Teuchos::XMLObjectImplem::appendContentLine ( const size_t &  i,
const std::string &  str 
)
inline

Add string at the the end of a content line.

Definition at line 109 of file Teuchos_XMLObjectImplem.hpp.

void XMLObjectImplem::removeContentLine ( const size_t &  i)

Remove content line by index.

Definition at line 89 of file Teuchos_XMLObjectImplem.cpp.

void XMLObjectImplem::print ( std::ostream &  os,
int  indent 
) const

Print to stream with the given indentation level. Output will be well-formed XML.

Definition at line 244 of file Teuchos_XMLObjectImplem.cpp.

std::string XMLObjectImplem::toString ( ) const

Write as a std::string. Output may be ill-formed XML.

Definition at line 208 of file Teuchos_XMLObjectImplem.cpp.

std::string XMLObjectImplem::header ( bool  strictXML = false) const

Write the header.

Definition at line 101 of file Teuchos_XMLObjectImplem.cpp.

std::string XMLObjectImplem::terminatedHeader ( bool  strictXML = false) const

Write the header terminated as <Header>

Definition at line 186 of file Teuchos_XMLObjectImplem.cpp.

std::string Teuchos::XMLObjectImplem::footer ( ) const
inline

Write the footer.

Definition at line 129 of file Teuchos_XMLObjectImplem.hpp.

void XMLObjectImplem::printContent ( std::ostream &  os,
int  indent 
) const
private

Print content lines using the given indentation level.

Definition at line 266 of file Teuchos_XMLObjectImplem.cpp.

std::string XMLObjectImplem::XMLifyAttVal ( const std::string &  attval)
staticprivate

Convert attribute value text into well-formed XML.

Definition at line 123 of file Teuchos_XMLObjectImplem.cpp.

Member Data Documentation

std::string Teuchos::XMLObjectImplem::tag_
private

Definition at line 139 of file Teuchos_XMLObjectImplem.hpp.

Map Teuchos::XMLObjectImplem::attributes_
private

Definition at line 140 of file Teuchos_XMLObjectImplem.hpp.

Array<XMLObject> Teuchos::XMLObjectImplem::children_
private

Definition at line 141 of file Teuchos_XMLObjectImplem.hpp.

Array<std::string> Teuchos::XMLObjectImplem::content_
private

Definition at line 142 of file Teuchos_XMLObjectImplem.hpp.


The documentation for this class was generated from the following files: