[358] | 1 | /*
|
---|
| 2 | * Copyright 1999-2000,2004 The Apache Software Foundation.
|
---|
| 3 | *
|
---|
| 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
| 5 | * you may not use this file except in compliance with the License.
|
---|
| 6 | * You may obtain a copy of the License at
|
---|
| 7 | *
|
---|
| 8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 9 | *
|
---|
| 10 | * Unless required by applicable law or agreed to in writing, software
|
---|
| 11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
| 13 | * See the License for the specific language governing permissions and
|
---|
| 14 | * limitations under the License.
|
---|
| 15 | */
|
---|
| 16 |
|
---|
| 17 | /*
|
---|
| 18 | * $Log: EndOfEntityException.hpp,v $
|
---|
| 19 | * Revision 1.4 2004/09/08 13:56:13 peiyongz
|
---|
| 20 | * Apache License Version 2.0
|
---|
| 21 | *
|
---|
| 22 | * Revision 1.3 2004/01/29 11:46:30 cargilld
|
---|
| 23 | * Code cleanup changes to get rid of various compiler diagnostic messages.
|
---|
| 24 | *
|
---|
| 25 | * Revision 1.2 2002/11/04 14:58:18 tng
|
---|
| 26 | * C++ Namespace Support.
|
---|
| 27 | *
|
---|
| 28 | * Revision 1.1.1.1 2002/02/01 22:21:58 peiyongz
|
---|
| 29 | * sane_include
|
---|
| 30 | *
|
---|
| 31 | * Revision 1.3 2000/02/24 20:18:07 abagchi
|
---|
| 32 | * Swat for removing Log from API docs
|
---|
| 33 | *
|
---|
| 34 | * Revision 1.2 2000/02/06 07:47:53 rahulj
|
---|
| 35 | * Year 2K copyright swat.
|
---|
| 36 | *
|
---|
| 37 | * Revision 1.1.1.1 1999/11/09 01:08:07 twl
|
---|
| 38 | * Initial checkin
|
---|
| 39 | *
|
---|
| 40 | * Revision 1.2 1999/11/08 20:44:42 rahul
|
---|
| 41 | * Swat for adding in Product name and CVS comment log variable.
|
---|
| 42 | *
|
---|
| 43 | */
|
---|
| 44 |
|
---|
| 45 |
|
---|
| 46 | #if !defined(ENDOFENTITYEXCEPTION_HPP)
|
---|
| 47 | #define ENDOFENTITYEXCEPTION_HPP
|
---|
| 48 |
|
---|
| 49 | #include <xercesc/util/XercesDefs.hpp>
|
---|
| 50 |
|
---|
| 51 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
| 52 |
|
---|
| 53 | class XMLEntityDecl;
|
---|
| 54 |
|
---|
| 55 | //
|
---|
| 56 | // This class is only used internally. Its thrown by the ReaderMgr class,
|
---|
| 57 | // when an entity ends, and is caught in the scanner. This tells the scanner
|
---|
| 58 | // that an entity has ended, and allows it to do the right thing according
|
---|
| 59 | // to what was going on when the entity ended.
|
---|
| 60 | //
|
---|
| 61 | // Since its internal, it does not bother implementing XMLException.
|
---|
| 62 | //
|
---|
| 63 | class XMLPARSER_EXPORT EndOfEntityException
|
---|
| 64 | {
|
---|
| 65 | public:
|
---|
| 66 | // -----------------------------------------------------------------------
|
---|
| 67 | // Constructors and Destructor
|
---|
| 68 | // -----------------------------------------------------------------------
|
---|
| 69 | EndOfEntityException( XMLEntityDecl* entityThatEnded
|
---|
| 70 | , const unsigned int readerNum) :
|
---|
| 71 |
|
---|
| 72 | fEntity(entityThatEnded)
|
---|
| 73 | , fReaderNum(readerNum)
|
---|
| 74 | {
|
---|
| 75 | }
|
---|
| 76 |
|
---|
| 77 | EndOfEntityException(const EndOfEntityException& toCopy) :
|
---|
| 78 |
|
---|
| 79 | fEntity(toCopy.fEntity)
|
---|
| 80 | , fReaderNum(toCopy.fReaderNum)
|
---|
| 81 | {
|
---|
| 82 | }
|
---|
| 83 |
|
---|
| 84 | ~EndOfEntityException()
|
---|
| 85 | {
|
---|
| 86 | }
|
---|
| 87 |
|
---|
| 88 |
|
---|
| 89 | // -----------------------------------------------------------------------
|
---|
| 90 | // Getter methods
|
---|
| 91 | // -----------------------------------------------------------------------
|
---|
| 92 | XMLEntityDecl& getEntity();
|
---|
| 93 | const XMLEntityDecl& getEntity() const;
|
---|
| 94 | unsigned int getReaderNum() const;
|
---|
| 95 |
|
---|
| 96 |
|
---|
| 97 | private :
|
---|
| 98 | // -----------------------------------------------------------------------
|
---|
| 99 | // Unimplemented constructors and operators
|
---|
| 100 | // -----------------------------------------------------------------------
|
---|
| 101 | EndOfEntityException& operator = (const EndOfEntityException&);
|
---|
| 102 |
|
---|
| 103 | // -----------------------------------------------------------------------
|
---|
| 104 | // Private data members
|
---|
| 105 | //
|
---|
| 106 | // fEntity
|
---|
| 107 | // This is a reference to the entity that ended, causing this
|
---|
| 108 | // exception.
|
---|
| 109 | //
|
---|
| 110 | // fReaderNum
|
---|
| 111 | // The unique reader number of the reader that was handling this
|
---|
| 112 | // entity. This is used to know whether a particular entity has
|
---|
| 113 | // ended.
|
---|
| 114 | // -----------------------------------------------------------------------
|
---|
| 115 | XMLEntityDecl* fEntity;
|
---|
| 116 | unsigned int fReaderNum;
|
---|
| 117 | };
|
---|
| 118 |
|
---|
| 119 |
|
---|
| 120 | // ---------------------------------------------------------------------------
|
---|
| 121 | // EndOfEntityException: Getter methods
|
---|
| 122 | // ---------------------------------------------------------------------------
|
---|
| 123 | inline XMLEntityDecl& EndOfEntityException::getEntity()
|
---|
| 124 | {
|
---|
| 125 | return *fEntity;
|
---|
| 126 | }
|
---|
| 127 |
|
---|
| 128 | inline const XMLEntityDecl& EndOfEntityException::getEntity() const
|
---|
| 129 | {
|
---|
| 130 | return *fEntity;
|
---|
| 131 | }
|
---|
| 132 |
|
---|
| 133 | inline unsigned int EndOfEntityException::getReaderNum() const
|
---|
| 134 | {
|
---|
| 135 | return fReaderNum;
|
---|
| 136 | }
|
---|
| 137 |
|
---|
| 138 | XERCES_CPP_NAMESPACE_END
|
---|
| 139 |
|
---|
| 140 | #endif
|
---|