X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=blobdiff_plain;f=xmltooling%2FAbstractXMLObject.h;h=3dd53ff71e908ed27706a5928b4218baa43880fb;hp=9d6319eb46aae70fe5d37ea72fff66c4f23081bc;hb=HEAD;hpb=2d0ee406f017bd67eef9e1b4b7a487025bc71f31 diff --git a/xmltooling/AbstractXMLObject.h b/xmltooling/AbstractXMLObject.h index 9d6319e..3dd53ff 100644 --- a/xmltooling/AbstractXMLObject.h +++ b/xmltooling/AbstractXMLObject.h @@ -1,17 +1,21 @@ -/* -* Copyright 2001-2009 Internet2 +/** + * Licensed to the University Corporation for Advanced Internet + * Development, Inc. (UCAID) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. * -* 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 + * UCAID licenses this file to you 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 * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. */ /** @@ -24,8 +28,10 @@ #define __xmltooling_abstractxmlobj_h__ #include +#include #include -#include + +#include #if defined (_MSC_VER) #pragma warning( push ) @@ -34,6 +40,8 @@ namespace xmltooling { + class XMLTOOL_API DateTime; + /** * An abstract implementation of XMLObject. * This is the primary concrete base class, and supplies basic namespace, @@ -46,52 +54,19 @@ namespace xmltooling { public: virtual ~AbstractXMLObject(); + // Virtual function overrides. void detach(); - - const QName& getElementQName() const { - return m_elementQname; - } - - const std::set& getNamespaces() const { - return m_namespaces; - } - + const QName& getElementQName() const; + const std::set& getNamespaces() const; void addNamespace(const Namespace& ns) const; - - 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(); - m_nil = value; - } - } - - bool hasParent() const { - return m_parent != NULL; - } - - XMLObject* getParent() const { - return m_parent; - } - - void setParent(XMLObject* parent) { - m_parent = parent; - } + void removeNamespace(const Namespace& ns); + const QName* getSchemaType() const; + const XMLCh* getXMLID() const; + xmlconstants::xmltooling_bool_t getNil() const; + void nil(xmlconstants::xmltooling_bool_t value); + bool hasParent() const; + XMLObject* getParent() const; + void setParent(XMLObject* parent); protected: /** @@ -103,7 +78,7 @@ namespace xmltooling { * @param schemaType the xsi:type to use */ AbstractXMLObject( - const XMLCh* nsURI=NULL, const XMLCh* localName=NULL, const XMLCh* prefix=NULL, const QName* schemaType=NULL + const XMLCh* nsURI=nullptr, const XMLCh* localName=nullptr, const XMLCh* prefix=nullptr, const QName* schemaType=nullptr ); /** Copy constructor. */ @@ -178,7 +153,7 @@ namespace xmltooling { * * 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 + * Note that since the new value (even if nullptr) 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 @@ -217,7 +192,7 @@ namespace xmltooling { private: XMLObject* m_parent; QName m_elementQname; - QName* m_typeQname; + std::auto_ptr m_typeQname; }; };