Base classes for open content models.
[shibboleth/cpp-xmltooling.git] / xmltooling / AttributeExtensibleXMLObject.h
diff --git a/xmltooling/AttributeExtensibleXMLObject.h b/xmltooling/AttributeExtensibleXMLObject.h
new file mode 100644 (file)
index 0000000..2d1472f
--- /dev/null
@@ -0,0 +1,60 @@
+/*\r
+ *  Copyright 2001-2006 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/**\r
+ * @file AttributeExtensibleXMLObject.h\r
+ * \r
+ * An XMLObject that supports arbitrary attributes \r
+ */\r
+\r
+#if !defined(__xmltooling_attrextxmlobj_h__)\r
+#define __xmltooling_attrextxmlobj_h__\r
+\r
+#include <xmltooling/XMLObject.h>\r
+\r
+using namespace xercesc;\r
+\r
+namespace xmltooling {\r
+\r
+    /**\r
+     * An XMLObject that supports arbitrary attributes.\r
+     */\r
+    class XMLTOOL_API AttributeExtensibleXMLObject : public virtual XMLObject\r
+    {\r
+    public:\r
+        AttributeExtensibleXMLObject() {}\r
+        virtual ~AttributeExtensibleXMLObject() {}\r
+        \r
+        /**\r
+         * Gets the value of an XML attribute of the object\r
+         * \r
+         * @param   qualifiedName   qualified name of the attribute   \r
+         * @return the attribute value, or NULL\r
+         */\r
+        virtual const XMLCh* getAttribute(QName& qualifiedName) const=0;\r
+        \r
+        /**\r
+         * Sets (or clears) an XML attribute of the object \r
+         * \r
+         * @param qualifiedName qualified name of the attribute   \r
+         * @param value         value to set, or NULL to clear\r
+         */\r
+        virtual void setAttribute(QName& qualifiedName, const XMLCh* value)=0;\r
+    };\r
+    \r
+};\r
+\r
+#endif /* __xmltooling_attrextxmlobj_h__ */\r