98 "Got non-whitespace for element content and didn't expect it. "
99 "Element=" +
toString() +
" content=\"" +
112 return "<" +
_sTypeName +
" " +
"name=\"" + _name +
"\" type=\"" + _type +
"\" >";
121 if ( !(_type.empty() || _type ==
"attribute" || _type ==
"variable") )
124 "Illegal type in remove element: type=" + _type +
125 " This version of the parser can only remove type=\"attribute\" or type=\"variable\".");
128 if (_type ==
"attribute")
130 processRemoveAttribute(p);
132 else if (_type ==
"variable")
134 processRemoveVariable(p);
143 RemoveElement::processRemoveAttribute(NCMLParser& p)
145 AttrTable::Attr_iter it;
146 bool gotIt = p.findAttribute(_name, it);
150 "In remove element, could not find attribute to remove name=" + _name +
151 " at the current scope=" + p.getScopeString());
155 BESDEBUG(
"ncml",
"Removing attribute name=" << _name <<
" at scope=" << p.getScopeString() << endl);
156 AttrTable* pTab = p.getCurrentAttrTable();
158 pTab->del_attr(_name);
162 RemoveElement::processRemoveVariable(NCMLParser& p)
164 BESDEBUG(
"ncml",
"Removing variable name=" + _name +
" at scope=" + p.getScopeString());
167 p.deleteVariableAtCurrentScope(_name);
171 RemoveElement::getValidAttributes()
173 vector<string> validAttrs;
174 validAttrs.reserve(2);
175 validAttrs.push_back(
"name");
176 validAttrs.push_back(
"type");
virtual bool validateAttributes(const XMLAttributeMap &attrs, const vector< string > &validAttrs, vector< string > *pInvalidAttrs=0, bool printInvalid=true, bool throwOnError=true)
Check that the given attributes are all in the valid set, otherwise fill in *pInvalidAttrs with the p...
virtual RemoveElement * clone() const
Make and return a copy of this.
virtual void setAttributes(const XMLAttributeMap &attrs)
Set the attributes of this from the map.
An abstract superclass for NCMLArray that handles the non-parameterized functionality and allows u...
virtual void handleBegin()
Handle a begin on this element.
const string getValueForLocalNameOrDefault(const string &localname, const string &defVal="") const
If there is an attribute with localname, return its value, else return default.
static bool isAllWhitespace(const std::string &str)
Is all the string whitespace as defined by chars in WHITESPACE ?
static const vector< string > _sValidAttributes
virtual void handleContent(const std::string &content)
Handle the characters content for the element.
Concrete subclass for the NcML element.
int getParseLineNumber() const
Get the line of the NCML file the parser is currently parsing.
#define THROW_NCML_PARSE_ERROR(parseLine, msg)
static const std::string _sTypeName
Base class for NcML element concrete classes.
#define THROW_NCML_INTERNAL_ERROR(msg)
virtual const std::string & getTypeName() const
Return the type of the element, which should be: the same as ConcreteClassName::getTypeName() ...
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
virtual void handleEnd()
Handle the closing of this element.
virtual std::string toString() const
Return a string describing the element.