| API Docs for SAX and DOM |
| Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages # XMLNotationDecl.hpp Go to the documentation of this file.
    00001 /*
    00002  * Copyright 1999-2004 The Apache Software Foundation.
    00003  *
    00004  * Licensed under the Apache License, Version 2.0 (the "License");
    00005  * you may not use this file except in compliance with the License.
    00006  * You may obtain a copy of the License at
    00007  *
    00008  *      http://www.apache.org/licenses/LICENSE-2.0
    00009  *
    00010  * Unless required by applicable law or agreed to in writing, software
    00011  * distributed under the License is distributed on an "AS IS" BASIS,
    00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013  * See the License for the specific language governing permissions and
    00014  * limitations under the License.
    00015  */
    00016
    00017 /*
    00018  * $Id: XMLNotationDecl.hpp 191054 2005-06-17 02:56:35Z jberry $
    00019  */
    00020
    00021 #if !defined(XMLNOTATIONDECL_HPP)
    00022 #define XMLNOTATIONDECL_HPP
    00023
    00024 #include <xercesc/util/XMemory.hpp>
    00025 #include <xercesc/util/PlatformUtils.hpp>
    00026 #include <xercesc/util/XMLString.hpp>
    00027 #include <xercesc/internal/XSerializable.hpp>
    00028
    00029 XERCES_CPP_NAMESPACE_BEGIN
    00030
    00040 class  XMLNotationDecl : public XSerializable, public XMemory
    00041 {
    00042 public:
    00043     // -----------------------------------------------------------------------
    00044     //  Constructors and Destructor
    00045     // -----------------------------------------------------------------------
    00046
    00049     XMLNotationDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
    00050     XMLNotationDecl
    00051     (
    00052         const   XMLCh* const    notName
    00053         , const XMLCh* const    pubId
    00054         , const XMLCh* const    sysId
    00055         , const XMLCh* const    baseURI = 0
    00056         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
    00057     );
    00059
    00062     ~XMLNotationDecl();
    00064
    00065
    00066     // -----------------------------------------------------------------------
    00067     //  Getter methods
    00068     // -----------------------------------------------------------------------
    00069     unsigned int getId() const;
    00070     const XMLCh* getName() const;
    00071     const XMLCh* getPublicId() const;
    00072     const XMLCh* getSystemId() const;
    00073     const XMLCh* getBaseURI() const;
    00074     unsigned int getNameSpaceId() const;
    00075     MemoryManager* getMemoryManager() const;
    00076
    00077
    00078     // -----------------------------------------------------------------------
    00079     //  Setter methods
    00080     // -----------------------------------------------------------------------
    00081     void setId(const unsigned int newId);
    00082     void setName
    00083     (
    00084         const   XMLCh* const    notName
    00085     );
    00086     void setPublicId(const XMLCh* const newId);
    00087     void setSystemId(const XMLCh* const newId);
    00088     void setBaseURI(const XMLCh* const newId);
    00089     void setNameSpaceId(const unsigned int newId);
    00090
    00091     // -----------------------------------------------------------------------
    00092     //  Support named collection element semantics
    00093     // -----------------------------------------------------------------------
    00094     const XMLCh* getKey() const;
    00095
    00096     /***
    00097      * Support for Serialization/De-serialization
    00098      ***/
    00099     DECL_XSERIALIZABLE(XMLNotationDecl)
    00100
    00101 private :
    00102     // -----------------------------------------------------------------------
    00103     //  Unimplemented constructors and operators
    00104     // -----------------------------------------------------------------------
    00105     XMLNotationDecl(const XMLNotationDecl&);
    00106     XMLNotationDecl& operator=(const XMLNotationDecl&);
    00107
    00108
    00109     // -----------------------------------------------------------------------
    00110     //  XMLNotationDecl: Private helper methods
    00111     // -----------------------------------------------------------------------
    00112     void cleanUp();
    00113
    00114
    00115     // -----------------------------------------------------------------------
    00116     //  Private data members
    00117     //
    00118     //  fId
    00119     //      This is the unique id given to this notation decl.
    00120     //
    00121     //  fName
    00122     //      The notation's name, which identifies the type of notation it
    00123     //      applies to.
    00124     //
    00125     //  fPublicId
    00126     //      The text of the notation's public id, if any.
    00127     //
    00128     //  fSystemId
    00129     //      The text of the notation's system id, if any.
    00130     //
    00131     //  fBaseURI
    00132     //      The text of the notation's base URI
    00133     // -----------------------------------------------------------------------
    00134     unsigned int    fId;
    00135     unsigned int    fNameSpaceId;
    00136     XMLCh*          fName;
    00137     XMLCh*          fPublicId;
    00138     XMLCh*          fSystemId;
    00139     XMLCh*          fBaseURI;
    00140     MemoryManager*  fMemoryManager;
    00141 };
    00142
    00143
    00144 // -----------------------------------------------------------------------
    00145 //  Getter methods
    00146 // -----------------------------------------------------------------------
    00147 inline unsigned int XMLNotationDecl::getId() const
    00148 {
    00149     return fId;
    00150 }
    00151
    00152 inline const XMLCh* XMLNotationDecl::getName() const
    00153 {
    00154     return fName;
    00155 }
    00156
    00157 inline unsigned int XMLNotationDecl::getNameSpaceId() const
    00158 {
    00159     return fNameSpaceId;
    00160 }
    00161
    00162 inline const XMLCh* XMLNotationDecl::getPublicId() const
    00163 {
    00164     return fPublicId;
    00165 }
    00166
    00167 inline const XMLCh* XMLNotationDecl::getSystemId() const
    00168 {
    00169     return fSystemId;
    00170 }
    00171
    00172 inline const XMLCh* XMLNotationDecl::getBaseURI() const
    00173 {
    00174     return fBaseURI;
    00175 }
    00176
    00177 inline MemoryManager* XMLNotationDecl::getMemoryManager() const
    00178 {
    00179     return fMemoryManager;
    00180 }
    00181
    00182 // -----------------------------------------------------------------------
    00183 //  Setter methods
    00184 // -----------------------------------------------------------------------
    00185 inline void XMLNotationDecl::setId(const unsigned int newId)
    00186 {
    00187     fId = newId;
    00188 }
    00189
    00190 inline void XMLNotationDecl::setNameSpaceId(const unsigned int newId)
    00191 {
    00192     fNameSpaceId = newId;
    00193 }
    00194
    00195 inline void XMLNotationDecl::setPublicId(const XMLCh* const newId)
    00196 {
    00197     if (fPublicId)
    00198         fMemoryManager->deallocate(fPublicId);
    00199
    00200     fPublicId = XMLString::replicate(newId, fMemoryManager);
    00201 }
    00202
    00203 inline void XMLNotationDecl::setSystemId(const XMLCh* const newId)
    00204 {
    00205     if (fSystemId)
    00206         fMemoryManager->deallocate(fSystemId);
    00207
    00208     fSystemId = XMLString::replicate(newId, fMemoryManager);
    00209 }
    00210
    00211 inline void XMLNotationDecl::setBaseURI(const XMLCh* const newId)
    00212 {
    00213     if (fBaseURI)
    00214         fMemoryManager->deallocate(fBaseURI);
    00215
    00216     fBaseURI = XMLString::replicate(newId, fMemoryManager);
    00217 }
    00218
    00219
    00220 // ---------------------------------------------------------------------------
    00221 //  XMLNotationDecl: Support named pool element semantics
    00222 // ---------------------------------------------------------------------------
    00223 inline const XMLCh* XMLNotationDecl::getKey() const
    00224 {
    00225     return fName;
    00226 }
    00227
    00228 XERCES_CPP_NAMESPACE_END
    00229
    00230 #endif

Copyright © 1994-2004 The Apache Software Foundation. All Rights Reserved.