| API Docs for SAX and DOM |
| Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members # 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  * $Log: XMLNotationDecl.hpp,v $
    00019  * Revision 1.13  2004/09/08 13:55:59  peiyongz
    00020  * Apache License Version 2.0
    00021  *
    00022  * Revision 1.12  2004/02/15 19:37:16  amassari
    00023  * Removed cause for warnings in VC 7.1
    00024  *
    00025  * Revision 1.11  2003/11/21 22:34:46  neilg
    00026  * More schema component model implementation, thanks to David Cargill.
    00027  * In particular, this cleans up and completes the XSModel, XSNamespaceItem,
    00028  * XSAttributeDeclaration and XSAttributeGroup implementations.
    00029  *
    00030  * Revision 1.10  2003/11/06 15:30:06  neilg
    00031  * first part of PSVI/schema component model implementation, thanks to David Cargill.  This covers setting the PSVIHandler on parser objects, as well as implementing XSNotation, XSSimpleTypeDefinition, XSIDCDefinition, and most of XSWildcard, XSComplexTypeDefinition, XSElementDeclaration, XSAttributeDeclaration and XSAttributeUse.
    00032  *
    00033  * Revision 1.9  2003/10/10 16:23:29  peiyongz
    00034  * Implementation of Serialization/Deserialization
    00035  *
    00036  * Revision 1.8  2003/05/22 02:10:51  knoaman
    00037  * Default the memory manager.
    00038  *
    00039  * Revision 1.7  2003/05/16 21:36:55  knoaman
    00040  * Memory manager implementation: Modify constructors to pass in the memory manager.
    00041  *
    00042  * Revision 1.6  2003/05/15 18:26:07  knoaman
    00043  * Partial implementation of the configurable memory manager.
    00044  *
    00045  * Revision 1.5  2003/04/21 20:46:01  knoaman
    00046  * Use XMLString::release to prepare for configurable memory manager.
    00047  *
    00048  * Revision 1.4  2003/03/07 18:08:10  tng
    00049  * Return a reference instead of void for operator=
    00050  *
    00051  * Revision 1.3  2002/11/04 15:00:21  tng
    00052  * C++ Namespace Support.
    00053  *
    00054  * Revision 1.2  2002/08/22 19:27:41  tng
    00055  * [Bug 11448] DomCount has problems with XHTML1.1 DTD.
    00056  *
    00057  * Revision 1.1.1.1  2002/02/01 22:21:52  peiyongz
    00058  * sane_include
    00059  *
    00060  * Revision 1.5  2000/03/02 19:54:25  roddey
    00061  * This checkin includes many changes done while waiting for the
    00062  * 1.1.0 code to be finished. I can't list them all here, but a list is
    00063  * available elsewhere.
    00064  *
    00065  * Revision 1.4  2000/02/24 20:00:23  abagchi
    00066  * Swat for removing Log from API docs
    00067  *
    00068  * Revision 1.3  2000/02/15 01:21:31  roddey
    00069  * Some initial documentation improvements. More to come...
    00070  *
    00071  * Revision 1.2  2000/02/06 07:47:48  rahulj
    00072  * Year 2K copyright swat.
    00073  *
    00074  * Revision 1.1.1.1  1999/11/09 01:08:35  twl
    00075  * Initial checkin
    00076  *
    00077  * Revision 1.2  1999/11/08 20:44:39  rahul
    00078  * Swat for adding in Product name and CVS comment log variable.
    00079  *
    00080  */
    00081
    00082 #if !defined(XMLNOTATIONDECL_HPP)
    00083 #define XMLNOTATIONDECL_HPP
    00084
    00085 #include <xercesc/util/XMemory.hpp>
    00086 #include <xercesc/util/PlatformUtils.hpp>
    00087 #include <xercesc/util/XMLString.hpp>
    00088 #include <xercesc/internal/XSerializable.hpp>
    00089
    00090 XERCES_CPP_NAMESPACE_BEGIN
    00091
    00101 class  XMLNotationDecl : public XSerializable, public XMemory
    00102 {
    00103 public:
    00104     // -----------------------------------------------------------------------
    00105     //  Constructors and Destructor
    00106     // -----------------------------------------------------------------------
    00107
    00110     XMLNotationDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
    00111     XMLNotationDecl
    00112     (
    00113         const   XMLCh* const    notName
    00114         , const XMLCh* const    pubId
    00115         , const XMLCh* const    sysId
    00116         , const XMLCh* const    baseURI = 0
    00117         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
    00118     );
    00120
    00123     ~XMLNotationDecl();
    00125
    00126
    00127     // -----------------------------------------------------------------------
    00128     //  Getter methods
    00129     // -----------------------------------------------------------------------
    00130     unsigned int getId() const;
    00131     const XMLCh* getName() const;
    00132     const XMLCh* getPublicId() const;
    00133     const XMLCh* getSystemId() const;
    00134     const XMLCh* getBaseURI() const;
    00135     unsigned int getNameSpaceId() const;
    00136     MemoryManager* getMemoryManager() const;
    00137
    00138
    00139     // -----------------------------------------------------------------------
    00140     //  Setter methods
    00141     // -----------------------------------------------------------------------
    00142     void setId(const unsigned int newId);
    00143     void setName
    00144     (
    00145         const   XMLCh* const    notName
    00146     );
    00147     void setPublicId(const XMLCh* const newId);
    00148     void setSystemId(const XMLCh* const newId);
    00149     void setBaseURI(const XMLCh* const newId);
    00150     void setNameSpaceId(const unsigned int newId);
    00151
    00152     // -----------------------------------------------------------------------
    00153     //  Support named collection element semantics
    00154     // -----------------------------------------------------------------------
    00155     const XMLCh* getKey() const;
    00156
    00157     /***
    00158      * Support for Serialization/De-serialization
    00159      ***/
    00160     DECL_XSERIALIZABLE(XMLNotationDecl)
    00161
    00162 private :
    00163     // -----------------------------------------------------------------------
    00164     //  Unimplemented constructors and operators
    00165     // -----------------------------------------------------------------------
    00166     XMLNotationDecl(const XMLNotationDecl&);
    00167     XMLNotationDecl& operator=(const XMLNotationDecl&);
    00168
    00169
    00170     // -----------------------------------------------------------------------
    00171     //  XMLNotationDecl: Private helper methods
    00172     // -----------------------------------------------------------------------
    00173     void cleanUp();
    00174
    00175
    00176     // -----------------------------------------------------------------------
    00177     //  Private data members
    00178     //
    00179     //  fId
    00180     //      This is the unique id given to this notation decl.
    00181     //
    00182     //  fName
    00183     //      The notation's name, which identifies the type of notation it
    00184     //      applies to.
    00185     //
    00186     //  fPublicId
    00187     //      The text of the notation's public id, if any.
    00188     //
    00189     //  fSystemId
    00190     //      The text of the notation's system id, if any.
    00191     //
    00192     //  fBaseURI
    00193     //      The text of the notation's base URI
    00194     // -----------------------------------------------------------------------
    00195     unsigned int    fId;
    00196     XMLCh*          fName;
    00197     XMLCh*          fPublicId;
    00198     XMLCh*          fSystemId;
    00199     XMLCh*          fBaseURI;
    00200     unsigned int    fNameSpaceId;
    00201     MemoryManager*  fMemoryManager;
    00202 };
    00203
    00204
    00205 // -----------------------------------------------------------------------
    00206 //  Getter methods
    00207 // -----------------------------------------------------------------------
    00208 inline unsigned int XMLNotationDecl::getId() const
    00209 {
    00210     return fId;
    00211 }
    00212
    00213 inline const XMLCh* XMLNotationDecl::getName() const
    00214 {
    00215     return fName;
    00216 }
    00217
    00218 inline unsigned int XMLNotationDecl::getNameSpaceId() const
    00219 {
    00220     return fNameSpaceId;
    00221 }
    00222
    00223 inline const XMLCh* XMLNotationDecl::getPublicId() const
    00224 {
    00225     return fPublicId;
    00226 }
    00227
    00228 inline const XMLCh* XMLNotationDecl::getSystemId() const
    00229 {
    00230     return fSystemId;
    00231 }
    00232
    00233 inline const XMLCh* XMLNotationDecl::getBaseURI() const
    00234 {
    00235     return fBaseURI;
    00236 }
    00237
    00238 inline MemoryManager* XMLNotationDecl::getMemoryManager() const
    00239 {
    00240     return fMemoryManager;
    00241 }
    00242
    00243 // -----------------------------------------------------------------------
    00244 //  Setter methods
    00245 // -----------------------------------------------------------------------
    00246 inline void XMLNotationDecl::setId(const unsigned int newId)
    00247 {
    00248     fId = newId;
    00249 }
    00250
    00251 inline void XMLNotationDecl::setNameSpaceId(const unsigned int newId)
    00252 {
    00253     fNameSpaceId = newId;
    00254 }
    00255
    00256 inline void XMLNotationDecl::setPublicId(const XMLCh* const newId)
    00257 {
    00258     if (fPublicId)
    00259         fMemoryManager->deallocate(fPublicId);
    00260
    00261     fPublicId = XMLString::replicate(newId, fMemoryManager);
    00262 }
    00263
    00264 inline void XMLNotationDecl::setSystemId(const XMLCh* const newId)
    00265 {
    00266     if (fSystemId)
    00267         fMemoryManager->deallocate(fSystemId);
    00268
    00269     fSystemId = XMLString::replicate(newId, fMemoryManager);
    00270 }
    00271
    00272 inline void XMLNotationDecl::setBaseURI(const XMLCh* const newId)
    00273 {
    00274     if (fBaseURI)
    00275         fMemoryManager->deallocate(fBaseURI);
    00276
    00277     fBaseURI = XMLString::replicate(newId, fMemoryManager);
    00278 }
    00279
    00280
    00281 // ---------------------------------------------------------------------------
    00282 //  XMLNotationDecl: Support named pool element semantics
    00283 // ---------------------------------------------------------------------------
    00284 inline const XMLCh* XMLNotationDecl::getKey() const
    00285 {
    00286     return fName;
    00287 }
    00288
    00289 XERCES_CPP_NAMESPACE_END
    00290
    00291 #endif

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