Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:54

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_ENDOFENTITYEXCEPTION_HPP)
0023 #define XERCESC_INCLUDE_GUARD_ENDOFENTITYEXCEPTION_HPP
0024 
0025 #include <xercesc/util/XercesDefs.hpp>
0026 
0027 XERCES_CPP_NAMESPACE_BEGIN
0028 
0029 class XMLEntityDecl;
0030 
0031 //
0032 //  This class is only used internally. Its thrown by the ReaderMgr class,
0033 //  when an entity ends, and is caught in the scanner. This tells the scanner
0034 //  that an entity has ended, and allows it to do the right thing according
0035 //  to what was going on when the entity ended.
0036 //
0037 //  Since its internal, it does not bother implementing XMLException.
0038 //
0039 class XMLPARSER_EXPORT EndOfEntityException
0040 {
0041 public:
0042     // -----------------------------------------------------------------------
0043     //  Constructors and Destructor
0044     // -----------------------------------------------------------------------
0045     EndOfEntityException(       XMLEntityDecl*  entityThatEnded
0046                         , const XMLSize_t       readerNum) :
0047 
0048         fEntity(entityThatEnded)
0049         , fReaderNum(readerNum)
0050     {
0051     }
0052 
0053     EndOfEntityException(const EndOfEntityException& toCopy) :
0054 
0055         fEntity(toCopy.fEntity)
0056         , fReaderNum(toCopy.fReaderNum)
0057     {
0058     }
0059 
0060     ~EndOfEntityException()
0061     {
0062     }
0063 
0064 
0065     // -----------------------------------------------------------------------
0066     //  Getter methods
0067     // -----------------------------------------------------------------------
0068     XMLEntityDecl& getEntity();
0069     const XMLEntityDecl& getEntity() const;
0070     XMLSize_t getReaderNum() const;
0071 
0072 
0073 private :
0074     // -----------------------------------------------------------------------
0075     // Unimplemented constructors and operators
0076     // -----------------------------------------------------------------------
0077     EndOfEntityException& operator = (const  EndOfEntityException&);
0078 
0079     // -----------------------------------------------------------------------
0080     //  Private data members
0081     //
0082     //  fEntity
0083     //      This is a reference to the entity that ended, causing this
0084     //      exception.
0085     //
0086     //  fReaderNum
0087     //      The unique reader number of the reader that was handling this
0088     //      entity. This is used to know whether a particular entity has
0089     //      ended.
0090     // -----------------------------------------------------------------------
0091     XMLEntityDecl*  fEntity;
0092     XMLSize_t       fReaderNum;
0093 };
0094 
0095 
0096 // ---------------------------------------------------------------------------
0097 //  EndOfEntityException: Getter methods
0098 // ---------------------------------------------------------------------------
0099 inline XMLEntityDecl& EndOfEntityException::getEntity()
0100 {
0101     return *fEntity;
0102 }
0103 
0104 inline const XMLEntityDecl& EndOfEntityException::getEntity() const
0105 {
0106     return *fEntity;
0107 }
0108 
0109 inline XMLSize_t EndOfEntityException::getReaderNum() const
0110 {
0111     return fReaderNum;
0112 }
0113 
0114 XERCES_CPP_NAMESPACE_END
0115 
0116 #endif