source: icXML/icXML-devel/src/xercesc/internal/EndOfEntityException.hpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 3.6 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: EndOfEntityException.hpp 676911 2008-07-15 13:27:32Z amassari $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_ENDOFENTITYEXCEPTION_HPP)
23#define XERCESC_INCLUDE_GUARD_ENDOFENTITYEXCEPTION_HPP
24
25#include <xercesc/util/XercesDefs.hpp>
26
27XERCES_CPP_NAMESPACE_BEGIN
28
29class XMLEntityDecl;
30
31//
32//  This class is only used internally. Its thrown by the ReaderMgr class,
33//  when an entity ends, and is caught in the scanner. This tells the scanner
34//  that an entity has ended, and allows it to do the right thing according
35//  to what was going on when the entity ended.
36//
37//  Since its internal, it does not bother implementing XMLException.
38//
39class XMLPARSER_EXPORT EndOfEntityException
40{
41public:
42    // -----------------------------------------------------------------------
43    //  Constructors and Destructor
44    // -----------------------------------------------------------------------
45    EndOfEntityException(       XMLEntityDecl*  entityThatEnded
46                        , const XMLSize_t       readerNum) :
47
48        fEntity(entityThatEnded)
49        , fReaderNum(readerNum)
50    {
51    }
52
53    EndOfEntityException(const EndOfEntityException& toCopy) :
54
55        fEntity(toCopy.fEntity)
56        , fReaderNum(toCopy.fReaderNum)
57    {
58    }
59
60    ~EndOfEntityException()
61    {
62    }
63
64
65    // -----------------------------------------------------------------------
66    //  Getter methods
67    // -----------------------------------------------------------------------
68    XMLEntityDecl& getEntity();
69    const XMLEntityDecl& getEntity() const;
70    XMLSize_t getReaderNum() const;
71
72
73private :
74    // -----------------------------------------------------------------------
75    // Unimplemented constructors and operators
76    // -----------------------------------------------------------------------
77    EndOfEntityException& operator = (const  EndOfEntityException&);
78
79    // -----------------------------------------------------------------------
80    //  Private data members
81    //
82    //  fEntity
83    //      This is a reference to the entity that ended, causing this
84    //      exception.
85    //
86    //  fReaderNum
87    //      The unique reader number of the reader that was handling this
88    //      entity. This is used to know whether a particular entity has
89    //      ended.
90    // -----------------------------------------------------------------------
91    XMLEntityDecl*  fEntity;
92    XMLSize_t       fReaderNum;
93};
94
95
96// ---------------------------------------------------------------------------
97//  EndOfEntityException: Getter methods
98// ---------------------------------------------------------------------------
99inline XMLEntityDecl& EndOfEntityException::getEntity()
100{
101    return *fEntity;
102}
103
104inline const XMLEntityDecl& EndOfEntityException::getEntity() const
105{
106    return *fEntity;
107}
108
109inline XMLSize_t EndOfEntityException::getReaderNum() const
110{
111    return fReaderNum;
112}
113
114XERCES_CPP_NAMESPACE_END
115
116#endif
Note: See TracBrowser for help on using the repository browser.