#include #include "agddHasTag.hh" #include "ExpatInterface/Element.h" namespace agdd { void HasTag::setTag(const string & s) { if (s=="") { cerr << "ERROR: A tag may not be set to the empty string." << endl; }; assert (s!=""); _tag = s; _isSet = true; }; HasTag::HasTag(const string & s) : _isSet(false), _tag(), _elt(0) { setTag(s); }; const string HasTag::getTag() const { if (!_isSet) { cerr << "ERROR: A tag has been requested before being set." << endl; } assert (_isSet); return _tag; }; void HasTag::makeTheElement() { assert (!_elt); // Currently no support for duplicate elements. _elt = new (xml::Element); assert(_elt); _elt->setTagName(getTag()); }; xml::Element * HasTag::theElement() { assert(_elt); return _elt; }; };