X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fxmltooling.git;a=blobdiff_plain;f=xmltooling%2FXMLObject.h;fp=xmltooling%2FXMLObject.h;h=85f70548a50d9c8159a4c156d759cadbf9bcb573;hp=176a973ff93216ada245a59b0ffd6e76fb2cb598;hb=ebb2772c2c65d4fe6f52e7978b9c7f656829614e;hpb=862161ef6283127928bd9307e1a184bf2ea0a6c8 diff --git a/xmltooling/XMLObject.h b/xmltooling/XMLObject.h index 176a973..85f7054 100644 --- a/xmltooling/XMLObject.h +++ b/xmltooling/XMLObject.h @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -124,6 +125,53 @@ namespace xmltooling { * @return an ID value or NULL */ virtual const XMLCh* getXMLID() const=0; + + /** + * Returns the xsi:nil property of the object, or false if not set. + * + * @return the xsi:nil property + */ + bool nil() const { + switch (getNil()) { + case xmlconstants::XML_BOOL_TRUE: + case xmlconstants::XML_BOOL_ONE: + return true; + case xmlconstants::XML_BOOL_FALSE: + case xmlconstants::XML_BOOL_ZERO: + default: + return false; + } + } + + /** + * Returns the xsi:nil property as an explicit enumerated value. + * + * @return the xsi:nil property + */ + virtual xmlconstants::xmltooling_bool_t getNil() const=0; + + /** + * Sets the xsi:nil property using an enumerated value. + * + * @param value value to set + */ + virtual void nil(xmlconstants::xmltooling_bool_t value)=0; + + /** + * Sets the xsi:nil property. + * + * @param value value to set + */ + void nil(bool value) { + nil(value ? xmlconstants::XML_BOOL_ONE : xmlconstants::XML_BOOL_ZERO); + } + + /** + * Sets the xsi:nil property using a string constant. + * + * @param value value to set + */ + void setNil(const XMLCh* value); /** * Checks to see if this object has a parent.