source: icXML/icXML-devel/src/xercesc/dom/impl/DOMErrorImpl.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: 4.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: DOMErrorImpl.hpp 676853 2008-07-15 09:58:05Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMERRORIMPL_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMERRORIMPL_HPP
24
25#include <xercesc/dom/DOMError.hpp>
26#include <icxercesc/util/XMLString.hpp>
27
28XERCES_CPP_NAMESPACE_BEGIN
29
30
31/**
32  * Introduced in DOM Level 3
33  * Implementation of a DOMError interface.
34  *
35  * @see DOMError#DOMError
36  */
37
38class CDOM_EXPORT DOMErrorImpl : public DOMError
39{
40public:
41    /** @name Constructors and Destructor */
42    //@{
43
44    /** Constructors */
45    DOMErrorImpl(const ErrorSeverity severity);
46
47    DOMErrorImpl
48    (
49        const ErrorSeverity severity
50        , const XMLCh* const message
51        , DOMLocator* const location
52    );
53
54    DOMErrorImpl
55    (
56        const ErrorSeverity severity
57        , const XMLCh* type
58        , const XMLCh* message
59        , void* relatedData
60    );
61
62    /** Desctructor */
63    virtual ~DOMErrorImpl();
64
65    //@}
66
67    // DOMError interface
68    virtual ErrorSeverity getSeverity() const;
69    virtual const XMLCh* getMessage() const;
70    virtual DOMLocator* getLocation() const;
71    virtual void* getRelatedException() const;
72    virtual const XMLCh* getType() const;
73    virtual void* getRelatedData() const;
74
75    // Setters
76    void setSeverity(const ErrorSeverity severity);
77    void setMessage(const XMLCh* const message);
78    void setLocation(DOMLocator* const location);
79    void setAdoptLocation(const bool value);
80    void setRelatedException(void* exc) const;
81    void setType(const XMLCh* type);
82    void setRelatedData(void* relatedData);
83
84private:
85    /* Unimplemented constructors and operators */
86
87    /* Copy constructor */
88    DOMErrorImpl(const DOMErrorImpl&);
89
90    /* Assignment operator */
91    DOMErrorImpl& operator=(const DOMErrorImpl&);
92
93protected:
94    // -----------------------------------------------------------------------
95    //  Private data members
96    //
97    //  fAdoptLocation
98    //      Indicates whether we own the DOMLocator object or not.
99    //
100    //  fSeverity
101    //      The type of the error.
102    //
103    //  fMessage
104    //      The error message.
105    //
106    //  fLocation
107    //      The location info of the error.
108    //
109    //  fType
110    //      The type of the error.
111    //
112    //  fRelatedData
113    //      The data related to this error.
114    //
115    // -----------------------------------------------------------------------
116    bool          fAdoptLocation;
117    ErrorSeverity fSeverity;
118    const XMLCh*  fMessage;
119    DOMLocator*   fLocation;
120    const XMLCh*  fType;
121    void*         fRelatedData;
122};
123
124// ---------------------------------------------------------------------------
125//  DOMErrorImpl: Getter methods
126// ---------------------------------------------------------------------------
127inline DOMError::ErrorSeverity DOMErrorImpl::getSeverity() const
128{
129    return fSeverity;
130}
131
132inline const XMLCh* DOMErrorImpl::getMessage() const
133{
134    return fMessage;
135}
136
137inline DOMLocator* DOMErrorImpl::getLocation() const
138{
139    return fLocation;
140}
141
142inline void* DOMErrorImpl::getRelatedException() const
143{
144    return 0;
145}
146
147inline const XMLCh* DOMErrorImpl::getType() const
148{
149    return fType;
150}
151
152inline void* DOMErrorImpl::getRelatedData() const
153{
154    return fRelatedData;
155}
156
157// ---------------------------------------------------------------------------
158//  DOMErrorImpl: Setter methods
159// ---------------------------------------------------------------------------
160inline void DOMErrorImpl::setSeverity(const ErrorSeverity severity)
161{
162    fSeverity = severity;
163}
164
165inline void DOMErrorImpl::setMessage(const XMLCh* const message)
166{
167    fMessage = message;
168}
169
170inline void DOMErrorImpl::setAdoptLocation(const bool value)
171{
172    fAdoptLocation = value;
173}
174
175inline void DOMErrorImpl::setType(const XMLCh* type)
176{
177    fType = type;
178}
179
180inline void DOMErrorImpl::setRelatedData(void* relatedData)
181{
182    fRelatedData = relatedData;
183}
184
185
186XERCES_CPP_NAMESPACE_END
187
188#endif
Note: See TracBrowser for help on using the repository browser.