10#ifndef TEUCHOS_XMLOBJECTIMPLEM_H
11#define TEUCHOS_XMLOBJECTIMPLEM_H
32 typedef Teuchos::map<std::string, std::string> Map;
42 void addAttribute(
const std::string& name,
const std::string& value);
48 void addContent(
const std::string& contentLine);
51 const std::string&
getTag()
const {
return tag_;}
55 {
return attributes_.find(name) != attributes_.end();}
59 {
return (*(attributes_.find(name))).second;}
62 int numChildren()
const ;
78 content_[i].append(str);
82 void removeContentLine(
const size_t& i);
85 void print(std::ostream& os,
int indent)
const ;
88 std::string toString()
const ;
91 std::string header(
bool strictXML =
false)
const ;
94 std::string terminatedHeader(
bool strictXML =
false)
const ;
102 void printContent(std::ostream& os,
int indent)
const ;
105 static std::string XMLifyAttVal(
const std::string &attval);
Templated array class derived from the STL std::vector.
Reference-counted pointer class and non-member templated function implementations.
Provides std::map class for deficient platforms.
Replacement for std::vector that is compatible with the Teuchos Memory Management classes.
const std::string & getAttribute(const std::string &name) const
Look up an attribute by name.
XMLObjectImplem * deepCopy() const
Deep copy.
const std::string & getTag() const
Return the tag std::string.
const Map & getAttributes() const
Get all attributes.
void addAttribute(const std::string &name, const std::string &value)
Add a [name, value] attribute.
int numContentLines() const
Get the number of content lines.
bool hasAttribute(const std::string &name) const
Determine whether an attribute exists.
const std::string & getContentLine(int i) const
Look up a content line by index.
void addContent(const std::string &contentLine)
Add a content line.
XMLObjectImplem(const std::string &tag)
Construct with a 'tag'.
void appendContentLine(const size_t &i, const std::string &str)
Add string at the the end of a content line.
void addChild(const XMLObject &child)
Add a child XMLObject.
std::string footer() const
Write the footer.
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object,...
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...