Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:27:01

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_DOMERRORIMPL_HPP)
0023 #define XERCESC_INCLUDE_GUARD_DOMERRORIMPL_HPP
0024 
0025 #include <xercesc/dom/DOMError.hpp>
0026 #include <xercesc/util/XMLString.hpp>
0027 
0028 XERCES_CPP_NAMESPACE_BEGIN
0029 
0030 
0031 /**
0032   * Introduced in DOM Level 3
0033   * Implementation of a DOMError interface.
0034   *
0035   * @see DOMError#DOMError
0036   */
0037 
0038 class CDOM_EXPORT DOMErrorImpl : public DOMError
0039 {
0040 public:
0041     /** @name Constructors and Destructor */
0042     //@{
0043 
0044     /** Constructors */
0045     DOMErrorImpl(const ErrorSeverity severity);
0046 
0047     DOMErrorImpl
0048     (
0049         const ErrorSeverity severity
0050         , const XMLCh* const message
0051         , DOMLocator* const location
0052     );
0053 
0054     DOMErrorImpl
0055     (
0056         const ErrorSeverity severity
0057         , const XMLCh* type
0058         , const XMLCh* message
0059         , void* relatedData
0060     );
0061 
0062     /** Desctructor */
0063     virtual ~DOMErrorImpl();
0064 
0065     //@}
0066 
0067     // DOMError interface
0068     virtual ErrorSeverity getSeverity() const;
0069     virtual const XMLCh* getMessage() const;
0070     virtual DOMLocator* getLocation() const;
0071     virtual void* getRelatedException() const;
0072     virtual const XMLCh* getType() const;
0073     virtual void* getRelatedData() const;
0074 
0075     // Setters
0076     void setSeverity(const ErrorSeverity severity);
0077     void setMessage(const XMLCh* const message);
0078     void setLocation(DOMLocator* const location);
0079     void setAdoptLocation(const bool value);
0080     void setRelatedException(void* exc) const;
0081     void setType(const XMLCh* type);
0082     void setRelatedData(void* relatedData);
0083 
0084 private:
0085     /* Unimplemented constructors and operators */
0086 
0087     /* Copy constructor */
0088     DOMErrorImpl(const DOMErrorImpl&);
0089 
0090     /* Assignment operator */
0091     DOMErrorImpl& operator=(const DOMErrorImpl&);
0092 
0093 protected:
0094     // -----------------------------------------------------------------------
0095     //  Private data members
0096     //
0097     //  fAdoptLocation
0098     //      Indicates whether we own the DOMLocator object or not.
0099     //
0100     //  fSeverity
0101     //      The type of the error.
0102     //
0103     //  fMessage
0104     //      The error message.
0105     //
0106     //  fLocation
0107     //      The location info of the error.
0108     //
0109     //  fType
0110     //      The type of the error.
0111     //
0112     //  fRelatedData
0113     //      The data related to this error.
0114     //
0115     // -----------------------------------------------------------------------
0116     bool          fAdoptLocation;
0117     ErrorSeverity fSeverity;
0118     const XMLCh*  fMessage;
0119     DOMLocator*   fLocation;
0120     const XMLCh*  fType;
0121     void*         fRelatedData;
0122 };
0123 
0124 // ---------------------------------------------------------------------------
0125 //  DOMErrorImpl: Getter methods
0126 // ---------------------------------------------------------------------------
0127 inline DOMError::ErrorSeverity DOMErrorImpl::getSeverity() const
0128 {
0129     return fSeverity;
0130 }
0131 
0132 inline const XMLCh* DOMErrorImpl::getMessage() const
0133 {
0134     return fMessage;
0135 }
0136 
0137 inline DOMLocator* DOMErrorImpl::getLocation() const
0138 {
0139     return fLocation;
0140 }
0141 
0142 inline void* DOMErrorImpl::getRelatedException() const
0143 {
0144     return 0;
0145 }
0146 
0147 inline const XMLCh* DOMErrorImpl::getType() const
0148 {
0149     return fType;
0150 }
0151 
0152 inline void* DOMErrorImpl::getRelatedData() const
0153 {
0154     return fRelatedData;
0155 }
0156 
0157 // ---------------------------------------------------------------------------
0158 //  DOMErrorImpl: Setter methods
0159 // ---------------------------------------------------------------------------
0160 inline void DOMErrorImpl::setSeverity(const ErrorSeverity severity)
0161 {
0162     fSeverity = severity;
0163 }
0164 
0165 inline void DOMErrorImpl::setMessage(const XMLCh* const message)
0166 {
0167     fMessage = message;
0168 }
0169 
0170 inline void DOMErrorImpl::setAdoptLocation(const bool value)
0171 {
0172     fAdoptLocation = value;
0173 }
0174 
0175 inline void DOMErrorImpl::setType(const XMLCh* type)
0176 {
0177     fType = type;
0178 }
0179 
0180 inline void DOMErrorImpl::setRelatedData(void* relatedData)
0181 {
0182     fRelatedData = relatedData;
0183 }
0184 
0185 
0186 XERCES_CPP_NAMESPACE_END
0187 
0188 #endif