42 #ifndef TEUCHOS_XMLOBJECTIMPLEM_H
43 #define TEUCHOS_XMLOBJECTIMPLEM_H
74 void addAttribute(
const std::string& name,
const std::string& value);
80 void addContent(
const std::string& contentLine);
83 const std::string&
getTag()
const {
return tag_;}
87 {
return attributes_.find(name) != attributes_.end();}
91 {
return (*(attributes_.find(name))).second;}
94 int numChildren()
const ;
110 content_[i].append(str);
114 void removeContentLine(
const size_t& i);
117 void print(std::ostream& os,
int indent)
const ;
120 std::string toString()
const ;
123 std::string header(
bool strictXML =
false)
const ;
126 std::string terminatedHeader(
bool strictXML =
false)
const ;
129 std::string
footer()
const {
return "</" + getTag() +
">";}
134 void printContent(std::ostream& os,
int indent)
const ;
137 static std::string XMLifyAttVal(
const std::string &attval);
bool hasAttribute(const std::string &name) const
Determine whether an attribute exists.
void appendContentLine(const size_t &i, const std::string &str)
Add string at the the end of a content line.
const Map & getAttributes() const
Get all attributes.
std::string footer() const
Write the footer.
const std::string & getAttribute(const std::string &name) const
Look up an attribute by name.
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object...
int numContentLines() const
Get the number of content lines.
Provides std::map class for deficient platforms.
Templated array class derived from the STL std::vector.
The XMLObjectImplem class takes care of the low-level implementation details of XMLObject.
const std::string & getContentLine(int i) const
Look up a content line by index.
const std::string & getTag() const
Return the tag std::string.
Reference-counted pointer class and non-member templated function implementations.
Replacement for std::vector that is compatible with the Teuchos Memory Management classes...