Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
|
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... | |
XMLObjectImplem * | deepCopy () 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 XMLObject & | getChild (int i) const |
Look up a child by its index. More... | |
int | numContentLines () const |
Get the number of content lines. More... | |
const Map & | getAttributes () 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< XMLObject > | children_ |
Array< std::string > | content_ |
The XMLObjectImplem class takes care of the low-level implementation details of XMLObject.
Definition at line 62 of file Teuchos_XMLObjectImplem.hpp.
|
private |
Definition at line 64 of file Teuchos_XMLObjectImplem.hpp.
XMLObjectImplem::XMLObjectImplem | ( | const std::string & | tag | ) |
Construct with a 'tag'.
Definition at line 49 of file Teuchos_XMLObjectImplem.cpp.
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.
|
inline |
Return the tag std::string.
Definition at line 83 of file Teuchos_XMLObjectImplem.hpp.
|
inline |
Determine whether an attribute exists.
Definition at line 86 of file Teuchos_XMLObjectImplem.hpp.
|
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.
|
inline |
Get the number of content lines.
Definition at line 100 of file Teuchos_XMLObjectImplem.hpp.
|
inline |
Get all attributes.
Definition at line 103 of file Teuchos_XMLObjectImplem.hpp.
|
inline |
Look up a content line by index.
Definition at line 106 of file Teuchos_XMLObjectImplem.hpp.
|
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.
|
inline |
Write the footer.
Definition at line 129 of file Teuchos_XMLObjectImplem.hpp.
|
private |
Print content lines using the given indentation level.
Definition at line 266 of file Teuchos_XMLObjectImplem.cpp.
|
staticprivate |
Convert attribute value text into well-formed XML.
Definition at line 123 of file Teuchos_XMLObjectImplem.cpp.
|
private |
Definition at line 139 of file Teuchos_XMLObjectImplem.hpp.
|
private |
Definition at line 140 of file Teuchos_XMLObjectImplem.hpp.
Definition at line 141 of file Teuchos_XMLObjectImplem.hpp.
|
private |
Definition at line 142 of file Teuchos_XMLObjectImplem.hpp.