From 60058d95e579f98bdbd5798bcc2dbac1a71e67fe Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Tue, 1 Jul 2008 22:12:57 +0000 Subject: [PATCH] https://issues.shibboleth.net/jira/browse/CPPXT-18 --- xmltooling/AbstractXMLObject.cpp | 25 +++-- xmltooling/AbstractXMLObject.h | 92 ++++++++-------- xmltooling/base.h | 221 +++++++++++++++++++++------------------ 3 files changed, 184 insertions(+), 154 deletions(-) diff --git a/xmltooling/AbstractXMLObject.cpp b/xmltooling/AbstractXMLObject.cpp index 6448856..a8461a4 100644 --- a/xmltooling/AbstractXMLObject.cpp +++ b/xmltooling/AbstractXMLObject.cpp @@ -1,6 +1,6 @@ /* * Copyright 2001-2007 Internet2 - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,7 +16,7 @@ /** * AbstractXMLObject.cpp - * + * * An abstract implementation of XMLObject. */ @@ -49,6 +49,13 @@ AbstractXMLObject::AbstractXMLObject(const AbstractXMLObject& src) m_typeQname=new QName(*src.m_typeQname); } +AbstractXMLObject::~AbstractXMLObject() +{ + delete m_typeQname; + xercesc::XMLString::release(&m_schemaLocation); + xercesc::XMLString::release(&m_noNamespaceSchemaLocation); +} + void XMLObject::setNil(const XMLCh* value) { if (value) { switch (*value) { @@ -121,21 +128,27 @@ DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, const Date return newValue ? new DateTime(*newValue) : NULL; } -DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, time_t newValue) +DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, time_t newValue, bool duration) { delete oldValue; releaseThisandParentDOM(); DateTime* ret = new DateTime(newValue); - ret->parseDateTime(); + if (duration) + ret->parseDuration(); + else + ret->parseDateTime(); return ret; } -DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, const XMLCh* newValue) +DateTime* AbstractXMLObject::prepareForAssignment(DateTime* oldValue, const XMLCh* newValue, bool duration) { delete oldValue; releaseThisandParentDOM(); DateTime* ret = new DateTime(newValue); - ret->parseDateTime(); + if (duration) + ret->parseDuration(); + else + ret->parseDateTime(); return ret; } diff --git a/xmltooling/AbstractXMLObject.h b/xmltooling/AbstractXMLObject.h index 7767167..fc4c23b 100644 --- a/xmltooling/AbstractXMLObject.h +++ b/xmltooling/AbstractXMLObject.h @@ -1,6 +1,6 @@ /* * Copyright 2001-2007 Internet2 - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,7 +16,7 @@ /** * @file xmltooling/AbstractXMLObject.h - * + * * An abstract implementation of XMLObject. */ @@ -44,11 +44,7 @@ namespace xmltooling { class XMLTOOL_API AbstractXMLObject : public virtual XMLObject { public: - virtual ~AbstractXMLObject() { - delete m_typeQname; - xercesc::XMLString::release(&m_schemaLocation); - xercesc::XMLString::release(&m_noNamespaceSchemaLocation); - } + virtual ~AbstractXMLObject(); void detach(); @@ -59,7 +55,7 @@ namespace xmltooling { const std::set& getNamespaces() const { return m_namespaces; } - + void addNamespace(const Namespace& ns) const { std::set::iterator i = m_namespaces.find(ns); if (i == m_namespaces.end()) @@ -67,23 +63,23 @@ namespace xmltooling { else if (ns.alwaysDeclare()) const_cast(*i).setAlwaysDeclare(true); } - + void removeNamespace(const Namespace& ns) { m_namespaces.erase(ns); } - + const QName* getSchemaType() const { return m_typeQname; } - + const XMLCh* getXMLID() const { return NULL; } - + xmlconstants::xmltooling_bool_t getNil() const { return m_nil; } - + void nil(xmlconstants::xmltooling_bool_t value) { if (m_nil != value) { releaseThisandParentDOM(); @@ -94,11 +90,11 @@ namespace xmltooling { bool hasParent() const { return m_parent != NULL; } - + XMLObject* getParent() const { return m_parent; } - + void setParent(XMLObject* parent) { m_parent = parent; } @@ -106,7 +102,7 @@ namespace xmltooling { protected: /** * Constructor - * + * * @param nsURI the namespace of the element * @param localName the local name of the XML element this Object represents * @param prefix the namespace prefix to use @@ -118,17 +114,17 @@ namespace xmltooling { /** Copy constructor. */ AbstractXMLObject(const AbstractXMLObject& src); - + /** * A helper function for derived classes, for assignment of strings. * * This 'normalizes' newString, and then if it is different from oldString, * it invalidates the DOM, frees the old string, and returns the new. * If not different, it frees the new string and just returns the old value. - * - * @param oldValue - the current value - * @param newValue - the new value - * + * + * @param oldValue the current value + * @param newValue the new value + * * @return the value that should be assigned */ XMLCh* prepareForAssignment(XMLCh* oldValue, const XMLCh* newValue); @@ -137,10 +133,10 @@ namespace xmltooling { * A helper function for derived classes, for assignment of date/time data. * * It invalidates the DOM, frees the old object, and returns the new. - * - * @param oldValue - the current value - * @param newValue - the new value - * + * + * @param oldValue the current value + * @param newValue the new value + * * @return the value that should be assigned */ DateTime* prepareForAssignment(DateTime* oldValue, const DateTime* newValue); @@ -149,50 +145,52 @@ namespace xmltooling { * A helper function for derived classes, for assignment of date/time data. * * It invalidates the DOM, frees the old object, and returns the new. - * - * @param oldValue - the current value - * @param newValue - the epoch to assign as the new value - * + * + * @param oldValue the current value + * @param newValue the epoch to assign as the new value + * @param duration true iff the value is a duration rather than an absolute timestamp + * * @return the value that should be assigned */ - DateTime* prepareForAssignment(DateTime* oldValue, time_t newValue); + DateTime* prepareForAssignment(DateTime* oldValue, time_t newValue, bool duration=false); /** * A helper function for derived classes, for assignment of date/time data. * * It invalidates the DOM, frees the old object, and returns the new. - * - * @param oldValue - the current value - * @param newValue - the new value in string form - * + * + * @param oldValue the current value + * @param newValue the new value in string form + * @param duration true iff the value is a duration rather than an absolute timestamp + * * @return the value that should be assigned */ - DateTime* prepareForAssignment(DateTime* oldValue, const XMLCh* newValue); + DateTime* prepareForAssignment(DateTime* oldValue, const XMLCh* newValue, bool duration=false); /** * A helper function for derived classes, for assignment of QName data. * * It invalidates the DOM, frees the old object, and returns the new. - * - * @param oldValue - the current value - * @param newValue - the new value - * + * + * @param oldValue the current value + * @param newValue the new value + * * @return the value that should be assigned */ QName* prepareForAssignment(QName* oldValue, const QName* newValue); /** * A helper function for derived classes, for assignment of (singleton) XML objects. - * - * It is indifferent to whether either the old or the new version of the value is null. + * + * It is indifferent to whether either the old or the new version of the value is null. * This method will do a safe compare of the objects and will also invalidate the DOM if appropriate. * Note that since the new value (even if NULL) is always returned, it may be more efficient * to discard the return value and just assign independently if a dynamic cast would be involved. - * - * @param oldValue - current value - * @param newValue - proposed new value - * @return the new value - * + * + * @param oldValue current value + * @param newValue proposed new value + * @return the new value + * * @throws XMLObjectException if the new child already has a parent. */ XMLObject* prepareForAssignment(XMLObject* oldValue, XMLObject* newValue); @@ -216,7 +214,7 @@ namespace xmltooling { * Stores off xsi:noNamespaceSchemaLocation attribute. */ XMLCh* m_noNamespaceSchemaLocation; - + /** * Stores off xsi:nil attribute. */ diff --git a/xmltooling/base.h b/xmltooling/base.h index 450c37f..05128dd 100644 --- a/xmltooling/base.h +++ b/xmltooling/base.h @@ -1,6 +1,6 @@ /* * Copyright 2001-2007 Internet2 - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,7 +16,7 @@ /** * @file xmltooling/base.h - * + * * Base header file definitions * Must be included prior to including any other header */ @@ -208,7 +208,7 @@ * Begins the declaration of an XMLObject specialization for an abstract element/type. * Basic boilerplate includes a protected constructor, empty virtual destructor, * and Unicode constants for the default associated element's name and prefix. - * + * * @param linkage linkage specifier for the class * @param cname the name of the class to declare * @param base the base class to derive from using public virtual inheritance @@ -229,7 +229,7 @@ * Begins the declaration of an XMLObject specialization. * Basic boilerplate includes a protected constructor, empty virtual destructor, * and Unicode constants for the default associated element's name and prefix. - * + * * @param linkage linkage specifier for the class * @param cname the name of the class to declare * @param base the base class to derive from using public virtual inheritance @@ -251,7 +251,7 @@ * Begins the declaration of an XMLObject specialization with two base classes. * Basic boilerplate includes a protected constructor, empty virtual destructor, * and Unicode constants for the default associated element's name and prefix. - * + * * @param linkage linkage specifier for the class * @param cname the name of the class to declare * @param base the first base class to derive from using public virtual inheritance @@ -274,7 +274,7 @@ * Begins the declaration of an XMLObject specialization with three base classes. * Basic boilerplate includes a protected constructor, empty virtual destructor, * and Unicode constants for the default associated element's name and prefix. - * + * * @param linkage linkage specifier for the class * @param cname the name of the class to declare * @param base the first base class to derive from using public virtual inheritance @@ -298,7 +298,7 @@ * Begins the declaration of an XMLObject specialization with four base classes. * Basic boilerplate includes a protected constructor, empty virtual destructor, * and Unicode constants for the default associated element's name and prefix. - * + * * @param linkage linkage specifier for the class * @param cname the name of the class to declare * @param base the first base class to derive from using public virtual inheritance @@ -323,7 +323,7 @@ * Begins the declaration of an XMLObject specialization with five base classes. * Basic boilerplate includes a protected constructor, empty virtual destructor, * and Unicode constants for the default associated element's name and prefix. - * + * * @param linkage linkage specifier for the class * @param cname the name of the class to declare * @param base the first base class to derive from using public virtual inheritance @@ -368,7 +368,7 @@ /** * Implements a static variable holding an XMLObject's element QName. - * + * * @param cname the name of the XMLObject specialization * @param namespaceURI the XML namespace of the default associated element * @param namespacePrefix the XML namespace prefix of the default associated element @@ -378,7 +378,7 @@ /** * Implements a static variable holding an XMLObject's schema type QName. - * + * * @param cname the name of the XMLObject specialization * @param namespaceURI the XML namespace of the default associated element * @param namespacePrefix the XML namespace prefix of the default associated element @@ -389,7 +389,7 @@ /** * Declares abstract set method for a typed XML attribute. * The get method is omitted. - * + * * @param proper the proper name of the attribute * @param upcased the upcased name of the attribute * @param type the attribute's data type @@ -403,7 +403,7 @@ /** * Declares abstract get/set methods for a typed XML attribute. - * + * * @param proper the proper name of the attribute * @param upcased the upcased name of the attribute * @param type the attribute's data type @@ -420,7 +420,7 @@ /** * Declares abstract set method for a string XML attribute. * The get method is omitted. - * + * * @param proper the proper name of the attribute * @param upcased the upcased name of the attribute */ @@ -429,7 +429,7 @@ /** * Declares abstract get/set methods for a string XML attribute. - * + * * @param proper the proper name of the attribute * @param upcased the upcased name of the attribute */ @@ -439,7 +439,7 @@ /** * Declares abstract set method for a DateTime XML attribute. * The get method is omitted. - * + * * @param proper the proper name of the attribute * @param upcased the upcased name of the attribute */ @@ -452,7 +452,7 @@ /** * Declares abstract get/set methods for a DateTime XML attribute. - * + * * @param proper the proper name of the attribute * @param upcased the upcased name of the attribute */ @@ -468,7 +468,7 @@ /** * Declares abstract set method for an integer XML attribute. * The get method is omitted. - * + * * @param proper the proper name of the attribute * @param upcased the upcased name of the attribute */ @@ -483,7 +483,7 @@ /** * Declares abstract get/set methods for an integer XML attribute. - * + * * @param proper the proper name of the attribute * @param upcased the upcased name of the attribute */ @@ -500,7 +500,7 @@ /** * Declares abstract get/set methods for a boolean XML attribute. - * + * * @param proper the proper name of the attribute * @param upcased the upcased name of the attribute * @param def the default/presumed value, if no explicit value has been set @@ -556,7 +556,7 @@ /** * Implements get/set methods and a private member for a typed XML attribute. - * + * * @param proper the proper name of the attribute * @param type the attribute's data type */ @@ -573,7 +573,7 @@ /** * Implements get/set methods and a private member for a string XML attribute. - * + * * @param proper the proper name of the attribute */ #define IMPL_STRING_ATTRIB(proper) \ @@ -582,7 +582,7 @@ /** * Implements get/set methods and a private member for a string XML attribute, * plus a getXMLID override. - * + * * @param proper the proper name of the attribute */ #define IMPL_ID_ATTRIB(proper) \ @@ -593,11 +593,30 @@ /** * Implements get/set methods and a private member for a DateTime XML attribute. - * + * * @param proper the proper name of the attribute * @param fallback epoch to return when attribute is NULL */ #define IMPL_DATETIME_ATTRIB(proper,fallback) \ + IMPL_DATETIME_ATTRIB_EX(proper,fallback,false) + +/** + * Implements get/set methods and a private member for a duration-valued DateTime XML attribute. + * + * @param proper the proper name of the attribute + * @param fallback epoch to return when attribute is NULL + */ +#define IMPL_DURATION_ATTRIB(proper,fallback) \ + IMPL_DATETIME_ATTRIB_EX(proper,fallback,true) + +/** + * Implements get/set methods and a private member for a DateTime XML attribute. + * + * @param proper the proper name of the attribute + * @param fallback epoch to return when attribute is NULL + * @param duration true iff the attribute should be handled as a duration + */ +#define IMPL_DATETIME_ATTRIB_EX(proper,fallback,duration) \ protected: \ DateTime* m_##proper; \ time_t m_##proper##Epoch; \ @@ -614,18 +633,18 @@ m_##proper##Epoch=m_##proper->getEpoch(); \ } \ void set##proper(time_t proper) { \ - m_##proper = prepareForAssignment(m_##proper,proper); \ + m_##proper = prepareForAssignment(m_##proper,proper,duration); \ m_##proper##Epoch = proper; \ } \ void set##proper(const XMLCh* proper) { \ - m_##proper = prepareForAssignment(m_##proper,proper); \ + m_##proper = prepareForAssignment(m_##proper,proper,duration); \ if (m_##proper) \ m_##proper##Epoch=m_##proper->getEpoch(); \ } /** * Implements get/set methods and a private member for an integer XML attribute. - * + * * @param proper the proper name of the attribute */ #define IMPL_INTEGER_ATTRIB(proper) \ @@ -647,7 +666,7 @@ /** * Implements get/set methods and a private member for a boolean XML attribute. - * + * * @param proper the proper name of the attribute */ #define IMPL_BOOLEAN_ATTRIB(proper) \ @@ -667,7 +686,7 @@ /** * Declares abstract set method for a typed XML child object in a foreign namespace. * The get method is omitted. - * + * * @param proper the proper name of the child type * @param ns the C++ namespace for the type */ @@ -678,7 +697,7 @@ /** * Declares abstract get/set methods for a typed XML child object in a foreign namespace. - * + * * @param proper the proper name of the child type * @param ns the C++ namespace for the type */ @@ -692,7 +711,7 @@ /** * Declares abstract set method for a typed XML child object. * The get method is omitted. - * + * * @param proper the proper name of the child type */ #define DECL_INHERITED_TYPED_CHILD(proper) \ @@ -702,7 +721,7 @@ /** * Declares abstract get/set methods for a typed XML child object. - * + * * @param proper the proper name of the child type */ #define DECL_TYPED_CHILD(proper) \ @@ -714,7 +733,7 @@ /** * Declares abstract get/set methods for a generic XML child object. - * + * * @param proper the proper name of the child */ #define DECL_XMLOBJECT_CHILD(proper) \ @@ -727,7 +746,7 @@ /** * Implements get/set methods and a private list iterator member for a typed XML child object. - * + * * @param proper the proper name of the child type */ #define IMPL_TYPED_CHILD(proper) \ @@ -746,7 +765,7 @@ /** * Implements get/set methods and a private list iterator member for * a typed XML child object in a foreign namespace - * + * * @param proper the proper name of the child type * @param ns the C++ namespace for the type */ @@ -765,7 +784,7 @@ /** * Implements get/set methods and a private list iterator member for a generic XML child object. - * + * * @param proper the proper name of the child */ #define IMPL_XMLOBJECT_CHILD(proper) \ @@ -783,7 +802,7 @@ /** * Declares abstract get/set methods for a typed XML child collection. - * + * * @param proper the proper name of the child type */ #define DECL_TYPED_CHILDREN(proper) \ @@ -795,7 +814,7 @@ /** * Declares abstract get/set methods for a typed XML child collection in a foreign namespace. - * + * * @param proper the proper name of the child type * @param ns the C++ namespace for the type */ @@ -808,7 +827,7 @@ /** * Declares abstract get/set methods for a generic XML child collection. - * + * * @param proper the proper name of the child */ #define DECL_XMLOBJECT_CHILDREN(proper) \ @@ -820,7 +839,7 @@ /** * Implements get method and a private vector member for a typed XML child collection. - * + * * @param proper the proper name of the child type * @param fence insertion fence for new objects of the child collection in backing list */ @@ -833,12 +852,12 @@ } \ const std::vector& get##proper##s() const { \ return m_##proper##s; \ - } + } /** * Implements get method and a private vector member for a typed XML child collection * in a foreign namespace. - * + * * @param proper the proper name of the child type * @param ns the C++ namespace for the type * @param fence insertion fence for new objects of the child collection in backing list @@ -852,11 +871,11 @@ } \ const std::vector& get##proper##s() const { \ return m_##proper##s; \ - } + } /** * Implements get method and a private vector member for a generic XML child collection. - * + * * @param proper the proper name of the child * @param fence insertion fence for new objects of the child collection in backing list */ @@ -869,11 +888,11 @@ } \ const std::vector& get##proper##s() const { \ return m_##proper##s; \ - } + } /** * Implements marshalling for a string attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -885,7 +904,7 @@ /** * Implements marshalling for a DateTime attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -897,7 +916,7 @@ /** * Implements marshalling for an integer attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -909,7 +928,7 @@ /** * Implements marshalling for a boolean attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -934,7 +953,7 @@ /** * Implements marshalling for a QName attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -947,7 +966,7 @@ /** * Implements marshalling for an ID attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -960,7 +979,7 @@ /** * Implements unmarshalling process branch for a string attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -973,7 +992,7 @@ /** * Implements unmarshalling process branch for an ID attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -987,7 +1006,7 @@ /** * Implements unmarshalling process branch for a DateTime attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -997,7 +1016,7 @@ /** * Implements unmarshalling process branch for a DateTime attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -1010,7 +1029,7 @@ /** * Implements unmarshalling process branch for an integer attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -1020,7 +1039,7 @@ /** * Implements unmarshalling process branch for a boolean attribute - * + * * @param proper the proper name of the attribute * @param ucase the upcased name of the attribute * @param namespaceURI the XML namespace of the attribute @@ -1030,7 +1049,7 @@ /** * Implements unmarshalling process branch for typed child collection element - * + * * @param proper the proper name of the child type * @param namespaceURI the XML namespace of the child element * @param force bypass use of hint and just cast down to check child @@ -1047,7 +1066,7 @@ /** * Implements unmarshalling process branch for typed child collection element * in a foreign namespace. - * + * * @param proper the proper name of the child type * @param ns the C++ namespace for the type * @param namespaceURI the XML namespace of the child element @@ -1064,7 +1083,7 @@ /** * Implements unmarshalling process branch for typed child singleton element - * + * * @param proper the proper name of the child type * @param namespaceURI the XML namespace of the child element * @param force bypass use of hint and just cast down to check child @@ -1082,7 +1101,7 @@ /** * Implements unmarshalling process branch for typed child singleton element * in a foreign namespace. - * + * * @param proper the proper name of the child type * @param ns the C++ namespace for the type * @param namespaceURI the XML namespace of the child element @@ -1100,7 +1119,7 @@ /** * Implements unmarshalling process branch for a generic child singleton element - * + * * @param proper the proper name of the child type * @param namespaceURI the XML namespace of the child element */ @@ -1115,7 +1134,7 @@ /** * Declares aliased get/set methods for named XML element simple content. - * + * * @param proper the proper name to label the element's content */ #define DECL_SIMPLE_CONTENT(proper) \ @@ -1130,7 +1149,7 @@ /** * Declares aliased get/set methods for named integer XML element content. - * + * * @param proper the proper name to label the element's content */ #define DECL_INTEGER_CONTENT(proper) \ @@ -1152,7 +1171,7 @@ /** * Implements cloning methods for an XMLObject specialization implementation class. - * + * * @param cname the name of the XMLObject specialization */ #define IMPL_XMLOBJECT_CLONE(cname) \ @@ -1172,7 +1191,7 @@ /** * Declares an XMLObject specialization with a simple content model and type, * handling it as string data. - * + * * @param linkage linkage specifier for the class * @param cname the name of the XMLObject specialization * @param proper the proper name to label the element's content @@ -1186,7 +1205,7 @@ /** * Declares and defines an implementation class for an XMLObject with * a simple content model and type, handling it as string data. - * + * * @param linkage linkage specifier for the class * @param cname the name of the XMLObject specialization */ @@ -1216,7 +1235,7 @@ * Begins the declaration of an XMLObjectBuilder specialization. * Basic boilerplate includes an empty virtual destructor, and * a default builder that defaults the element name. - * + * * @param linkage linkage specifier for the class * @param cname the name of the XMLObject specialization * @param namespaceURI the XML namespace of the default associated element @@ -1243,7 +1262,7 @@ /** * Declares a generic XMLObjectBuilder specialization. - * + * * @param linkage linkage specifier for the class * @param cname the name of the XMLObject specialization * @param namespaceURI the XML namespace of the default associated element @@ -1263,8 +1282,8 @@ END_XMLOBJECTBUILDER /** - * Implements the standard XMLObjectBuilder specialization function. - * + * Implements the standard XMLObjectBuilder specialization function. + * * @param cname the name of the XMLObject specialization */ #define IMPL_XMLOBJECTBUILDER(cname) \ @@ -1281,7 +1300,7 @@ * Begins the declaration of an XMLObjectBuilder specialization. * Basic boilerplate includes an empty virtual destructor, and * a default builder that defaults the element name. - * + * * @param linkage linkage specifier for the class * @param cname the name of the XMLObject specialization * @param namespaceURI the XML namespace of the default associated element @@ -1308,7 +1327,7 @@ /** * Declares a generic XMLObjectBuilder specialization. - * + * * @param linkage linkage specifier for the class * @param cname the name of the XMLObject specialization * @param namespaceURI the XML namespace of the default associated element @@ -1328,8 +1347,8 @@ END_XMLOBJECTBUILDER /** - * Implements the standard XMLObjectBuilder specialization function. - * + * Implements the standard XMLObjectBuilder specialization function. + * * @param cname the name of the XMLObject specialization */ #define IMPL_XMLOBJECTBUILDER(cname) \ @@ -1344,7 +1363,7 @@ /** * Begins the declaration of a Schema Validator specialization. - * + * * @param linkage linkage specifier for the class * @param cname the base name of the Validator specialization */ @@ -1362,7 +1381,7 @@ /** * Begins the declaration of a Schema Validator specialization subclass. - * + * * @param linkage linkage specifier for the class * @param cname the base name of the Validator specialization * @param base base class for the validator @@ -1384,7 +1403,7 @@ /** * Validator code that checks the object type. - * + * * @param cname the name of the XMLObject specialization */ #define XMLOBJECTVALIDATOR_CHECKTYPE(cname) \ @@ -1394,9 +1413,9 @@ /** * Validator code that checks for a required attribute, content, or singleton. - * + * * @param cname the name of the XMLObject specialization - * @param proper the proper name of the attribute, content, or singleton member + * @param proper the proper name of the attribute, content, or singleton member */ #define XMLOBJECTVALIDATOR_REQUIRE(cname,proper) \ if (!ptr->get##proper()) \ @@ -1404,9 +1423,9 @@ /** * Validator code that checks for a required integer attribute - * + * * @param cname the name of the XMLObject specialization - * @param proper the proper name of the attribute, content, or singleton member + * @param proper the proper name of the attribute, content, or singleton member */ #define XMLOBJECTVALIDATOR_REQUIRE_INTEGER(cname,proper) \ if (!ptr->get##proper().first) \ @@ -1415,10 +1434,10 @@ /** * Validator code that checks for one of a pair of * required attributes, content, or singletons. - * + * * @param cname the name of the XMLObject specialization - * @param proper1 the proper name of the first attribute, content, or singleton member - * @param proper2 the proper name of the second attribute, content, or singleton member + * @param proper1 the proper name of the first attribute, content, or singleton member + * @param proper2 the proper name of the second attribute, content, or singleton member */ #define XMLOBJECTVALIDATOR_ONEOF(cname,proper1,proper2) \ if (!ptr->get##proper1() && !ptr->get##proper2()) \ @@ -1427,10 +1446,10 @@ /** * Validator code that checks for one of a pair of * required attributes, content, or singletons, but disallows both. - * + * * @param cname the name of the XMLObject specialization - * @param proper1 the proper name of the first attribute, content, or singleton member - * @param proper2 the proper name of the second attribute, content, or singleton member + * @param proper1 the proper name of the first attribute, content, or singleton member + * @param proper2 the proper name of the second attribute, content, or singleton member */ #define XMLOBJECTVALIDATOR_ONLYONEOF(cname,proper1,proper2) \ if ((!ptr->get##proper1() && !ptr->get##proper2()) || (ptr->get##proper1() && ptr->get##proper2())) \ @@ -1439,7 +1458,7 @@ /** * Validator code that checks for one of a set of three * required attributes, content, or singletons. - * + * * @param cname the name of the XMLObject specialization * @param proper1 the proper name of the first attribute, content, or singleton member * @param proper2 the proper name of the second attribute, content, or singleton member @@ -1452,7 +1471,7 @@ /** * Validator code that checks for one of a set of three * required attributes, content, or singletons but disallows more than one. - * + * * @param cname the name of the XMLObject specialization * @param proper1 the proper name of the first attribute, content, or singleton member * @param proper2 the proper name of the second attribute, content, or singleton member @@ -1472,10 +1491,10 @@ /** * Validator code that checks a co-constraint (if one present, the other must be) * between a pair of attributes, content, or singletons. - * + * * @param cname the name of the XMLObject specialization - * @param proper1 the proper name of the first attribute, content, or singleton member - * @param proper2 the proper name of the second attribute, content, or singleton member + * @param proper1 the proper name of the first attribute, content, or singleton member + * @param proper2 the proper name of the second attribute, content, or singleton member */ #define XMLOBJECTVALIDATOR_NONEORBOTH(cname,proper1,proper2) \ if ((ptr->get##proper1() && !ptr->get##proper2()) || (!ptr->get##proper1() && ptr->get##proper2())) \ @@ -1483,9 +1502,9 @@ /** * Validator code that checks for a non-empty collection. - * + * * @param cname the name of the XMLObject specialization - * @param proper the proper name of the collection item + * @param proper the proper name of the collection item */ #define XMLOBJECTVALIDATOR_NONEMPTY(cname,proper) \ if (ptr->get##proper##s().empty()) \ @@ -1494,7 +1513,7 @@ /** * Declares/defines a Validator specialization that checks object type and * a non-empty simple content model. - * + * * @param linkage linkage specifier for the class * @param cname the name of the XMLObject specialization */ @@ -1515,7 +1534,7 @@ namespace xmltooling { * Template function for cloning a sequence of XMLObjects. * Invokes the clone() member on each element of the input sequence and adds the copy to * the output sequence. Order is preserved. - * + * * @param in input sequence to clone * @param out output sequence to copy cloned pointers into */ @@ -1535,14 +1554,14 @@ namespace xmltooling { { /** * Function operator to delete an object. - * + * * @param ptr object to delete */ void operator()(T* ptr) {delete ptr;} - + /** * Function operator to delete an object stored as const. - * + * * @param ptr object to delete after casting away const */ void operator()(const T* ptr) {delete const_cast(ptr);} @@ -1555,7 +1574,7 @@ namespace xmltooling { { /** * Function operator to delete an object. - * + * * @param p a pair in which the second component is the object to delete */ void operator()(const std::pair& p) {delete p.second;} @@ -1568,7 +1587,7 @@ namespace xmltooling { { /** * Function operator to delete an object stored as const - * + * * @param p a pair in which the second component is the const object to delete */ void operator()(const std::pair& p) {delete const_cast(p.second);} -- 2.1.4