Teuchos::XMLObjectImplem Class Reference

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

#include <Teuchos_XMLObjectImplem.hpp>

List of all members.

Public Member Functions

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

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.

Static Private Member Functions

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

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 49 of file Teuchos_XMLObjectImplem.hpp.


Member Typedef Documentation

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

Definition at line 51 of file Teuchos_XMLObjectImplem.hpp.


Constructor & Destructor Documentation

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

Construct with a 'tag'.

Definition at line 35 of file Teuchos_XMLObjectImplem.cpp.


Member Function Documentation

XMLObjectImplem * XMLObjectImplem::deepCopy (  )  const

Deep copy.

Definition at line 39 of file Teuchos_XMLObjectImplem.cpp.

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

Add a [name, value] attribute.

Definition at line 59 of file Teuchos_XMLObjectImplem.cpp.

void XMLObjectImplem::addChild ( const XMLObject child  ) 

Add a child XMLObject.

Definition at line 65 of file Teuchos_XMLObjectImplem.cpp.

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

Add a content line.

Definition at line 70 of file Teuchos_XMLObjectImplem.cpp.

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

Return the tag std::string.

Definition at line 70 of file Teuchos_XMLObjectImplem.hpp.

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

Determine whether an attribute exists.

Definition at line 73 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 77 of file Teuchos_XMLObjectImplem.hpp.

int XMLObjectImplem::numChildren (  )  const

Return the number of children.

Definition at line 54 of file Teuchos_XMLObjectImplem.cpp.

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

Look up a child by its index.

Definition at line 75 of file Teuchos_XMLObjectImplem.cpp.

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

Get the number of content lines.

Definition at line 87 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 90 of file Teuchos_XMLObjectImplem.hpp.

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 223 of file Teuchos_XMLObjectImplem.cpp.

std::string XMLObjectImplem::toString (  )  const

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

Definition at line 187 of file Teuchos_XMLObjectImplem.cpp.

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

Write the header.

Definition at line 80 of file Teuchos_XMLObjectImplem.cpp.

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

Write the header terminated as <Header>.

Definition at line 165 of file Teuchos_XMLObjectImplem.cpp.

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

Write the footer.

Definition at line 105 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 245 of file Teuchos_XMLObjectImplem.cpp.

std::string XMLObjectImplem::XMLifyAttVal ( const std::string &  attval  )  [static, private]

Convert attribute value text into well-formed XML.

Definition at line 102 of file Teuchos_XMLObjectImplem.cpp.


Member Data Documentation

std::string Teuchos::XMLObjectImplem::tag_ [private]

Definition at line 115 of file Teuchos_XMLObjectImplem.hpp.

Definition at line 116 of file Teuchos_XMLObjectImplem.hpp.

Definition at line 117 of file Teuchos_XMLObjectImplem.hpp.

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

Definition at line 118 of file Teuchos_XMLObjectImplem.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Tue Oct 20 10:14:05 2009 for Teuchos Package Browser (Single Doxygen Collection) by  doxygen 1.6.1