Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:18

0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one or more
0003  * contributor license agreements.  See the NOTICE file distributed with
0004  * this work for additional information regarding copyright ownership.
0005  * The ASF licenses this file to You under the Apache License, Version 2.0
0006  * (the "License"); you may not use this file except in compliance with
0007  * the License.  You may obtain a copy of the License at
0008  * 
0009  *      http://www.apache.org/licenses/LICENSE-2.0
0010  * 
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  */
0017 
0018 /*
0019  * $Id$
0020  */
0021 
0022 #if !defined(XERCESC_INCLUDE_GUARD_DTDENTITYDECL_HPP)
0023 #define XERCESC_INCLUDE_GUARD_DTDENTITYDECL_HPP
0024 
0025 #include <xercesc/framework/XMLEntityDecl.hpp>
0026 
0027 XERCES_CPP_NAMESPACE_BEGIN
0028 
0029 //
0030 //  This is a derivative of the abstract version of an entity decl in the
0031 //  framework directory. We just need to provide implementation of a couple
0032 //  of methods.
0033 //
0034 class VALIDATORS_EXPORT DTDEntityDecl : public XMLEntityDecl
0035 {
0036 public :
0037     // -----------------------------------------------------------------------
0038     //  Constructors and Destructor
0039     // -----------------------------------------------------------------------
0040     DTDEntityDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
0041     DTDEntityDecl
0042     (
0043         const   XMLCh* const   entName
0044         , const bool           fromIntSubset = false
0045         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0046     );
0047     DTDEntityDecl
0048     (
0049         const   XMLCh* const   entName
0050         , const XMLCh* const   value
0051         , const bool           fromIntSubset = false
0052         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0053     );
0054     DTDEntityDecl
0055     (
0056         const   XMLCh* const    entName
0057         , const XMLCh           value
0058         , const bool            fromIntSubset = false
0059         , const bool            specialChar = false
0060     );
0061     ~DTDEntityDecl();
0062 
0063 
0064     // -----------------------------------------------------------------------
0065     //  Implementation of the virtual XMLEntityDecl interface
0066     // -----------------------------------------------------------------------
0067     virtual bool getDeclaredInIntSubset() const;
0068     virtual bool getIsParameter() const;
0069     virtual bool getIsSpecialChar() const;
0070 
0071 
0072     // -----------------------------------------------------------------------
0073     //  Setter methods
0074     // -----------------------------------------------------------------------
0075     void setDeclaredInIntSubset(const bool newValue);
0076     void setIsParameter(const bool newValue);
0077     void setIsSpecialChar(const bool newValue);
0078 
0079     /***
0080      * Support for Serialization/De-serialization
0081      ***/
0082     DECL_XSERIALIZABLE(DTDEntityDecl)
0083 
0084 private :
0085     // -----------------------------------------------------------------------
0086     //  Unimplemented constructors and operators
0087     // -----------------------------------------------------------------------
0088     DTDEntityDecl(const DTDEntityDecl&);
0089     DTDEntityDecl& operator=(DTDEntityDecl&);
0090 
0091 
0092     // -----------------------------------------------------------------------
0093     //  Private data members
0094     //
0095     //  fDeclaredInIntSubset
0096     //      Indicates whether the entity was declared in the internal subset
0097     //      or not. If not, it cannot be referred to from a standalone
0098     //      document.
0099     //
0100     //  fIsParameter
0101     //      Indicates whether this is a parameter entity or a general entity.
0102     //
0103     //  fIsSpecialChar
0104     //      This indicates that its one of the special character entities,
0105     //      e.g. lt or gt or amp. We need to know this because there are
0106     //      places where only a numeric char ref or special char ref is valid
0107     //      and all others are ignored or illegal.
0108     // -----------------------------------------------------------------------
0109     bool    fDeclaredInIntSubset;
0110     bool    fIsParameter;
0111     bool    fIsSpecialChar;
0112 };
0113 
0114 
0115 // ---------------------------------------------------------------------------
0116 //  DTDEntityDecl: Constructors and Destructor
0117 // ---------------------------------------------------------------------------
0118 inline DTDEntityDecl::DTDEntityDecl(MemoryManager* const manager) :
0119 
0120     XMLEntityDecl(manager)
0121     , fDeclaredInIntSubset(false)
0122     , fIsParameter(false)
0123     , fIsSpecialChar(false)
0124 {
0125 }
0126 
0127 inline DTDEntityDecl::DTDEntityDecl( const XMLCh* const   entName
0128                                    , const bool           fromIntSubset
0129                                    , MemoryManager* const manager) :
0130 
0131     XMLEntityDecl(entName, manager)
0132     , fDeclaredInIntSubset(fromIntSubset)
0133     , fIsParameter(false)
0134     , fIsSpecialChar(false)
0135 {
0136 }
0137 
0138 inline DTDEntityDecl::DTDEntityDecl( const XMLCh* const   entName
0139                                    , const XMLCh* const   value
0140                                    , const bool           fromIntSubset
0141                                    , MemoryManager* const manager) :
0142     XMLEntityDecl(entName, value, manager)
0143     , fDeclaredInIntSubset(fromIntSubset)
0144     , fIsParameter(false)
0145     , fIsSpecialChar(false)
0146 {
0147 }
0148 
0149 inline DTDEntityDecl::DTDEntityDecl(const   XMLCh* const    entName
0150                                     , const XMLCh           value
0151                                     , const bool            fromIntSubset
0152                                     , const bool            specialChar) :
0153     XMLEntityDecl(entName, value, XMLPlatformUtils::fgMemoryManager)
0154     , fDeclaredInIntSubset(fromIntSubset)
0155     , fIsParameter(false)
0156     , fIsSpecialChar(specialChar)
0157 {
0158 }
0159 
0160 inline DTDEntityDecl::~DTDEntityDecl()
0161 {
0162 }
0163 
0164 
0165 // ---------------------------------------------------------------------------
0166 //  DTDEntityDecl: Getter methods
0167 // ---------------------------------------------------------------------------
0168 inline bool DTDEntityDecl::getDeclaredInIntSubset() const
0169 {
0170     return fDeclaredInIntSubset;
0171 }
0172 
0173 inline bool DTDEntityDecl::getIsParameter() const
0174 {
0175     return fIsParameter;
0176 }
0177 
0178 inline bool DTDEntityDecl::getIsSpecialChar() const
0179 {
0180     return fIsSpecialChar;
0181 }
0182 
0183 
0184 // ---------------------------------------------------------------------------
0185 //  DTDEntityDecl: Setter methods
0186 // ---------------------------------------------------------------------------
0187 inline void DTDEntityDecl::setDeclaredInIntSubset(const bool newValue)
0188 {
0189     fDeclaredInIntSubset = newValue;
0190 }
0191 
0192 inline void DTDEntityDecl::setIsParameter(const bool newValue)
0193 {
0194     fIsParameter = newValue;
0195 }
0196 
0197 inline void DTDEntityDecl::setIsSpecialChar(const bool newValue)
0198 {
0199     fIsSpecialChar = newValue;
0200 }
0201 
0202 XERCES_CPP_NAMESPACE_END
0203 
0204 #endif