44 #include "Teuchos_Assert.hpp"
46 using namespace Teuchos;
49 : root_(), current_(), path_()
57 "TreeBuildingXMLHandler::trying to add content to an empty node");
61 if(chars.compare(
"\n")==0) {
78 const Map& attributes)
92 for (Map::const_iterator i=attributes.begin(); i != attributes.end(); ++i)
94 const std::string& key = (*i).first;
95 const std::string& val = (*i).second;
103 if (path_.size() > 0)
105 if (current_.
getTag() != tag) {
111 current_.removeContentLine(k);
113 current_ = path_.top();
const std::string & getTag() const
Return the tag of the current node.
void characters(const std::string &chars)
Process character data.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
void addChild(const XMLObject &child)
Add a child node to the node.
Defines a class for assembling an XMLObject from XML input.
int endElement(const std::string &tag)
Receive notification of the end of an element.
bool isEmpty() const
Find out if a node is empty.
A std::string utilities class for Teuchos.
Representation of an XML data tree. XMLObject is a ref-counted handle to a XMLObjectImplem object...
TreeBuildingXMLHandler()
Empty constructor.
void startElement(const std::string &tag, const Map &attributes)
Receive notification of the start of an element.
void addAttribute(const std::string &name, T value)
Lookup whether or not Doubles are allowed.
static bool isWhite(const std::string &str)
Returns true if a std::string consists entirely of whitespace.
static std::string fixUnprintableCharacters(const std::string &str)
Convert unprintable non-null characters to whitespace.
void addContent(const std::string &contentLine)
Add a line of character content.
int numContentLines() const
Return the number of lines of character content stored in this node.
const std::string & getContentLine(int i) const
Return the i-th line of character content stored in this node.