Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:20

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_XSDERRORREPORTER_HPP)
0023 #define XERCESC_INCLUDE_GUARD_XSDERRORREPORTER_HPP
0024 
0025 #include <xercesc/util/XMemory.hpp>
0026 
0027 XERCES_CPP_NAMESPACE_BEGIN
0028 
0029 class Locator;
0030 class XMLErrorReporter;
0031 
0032 
0033 /**
0034  *  This class reports schema errors
0035  */
0036 class VALIDATORS_EXPORT XSDErrorReporter : public XMemory
0037 {
0038 public:
0039     // -----------------------------------------------------------------------
0040     //  Constructors are hidden, only the virtual destructor is exposed
0041     // -----------------------------------------------------------------------
0042     XSDErrorReporter(XMLErrorReporter* const errorReporter = 0);
0043 
0044     virtual ~XSDErrorReporter()
0045     {
0046     }
0047 
0048     // -----------------------------------------------------------------------
0049     //  Getter methods
0050     // -----------------------------------------------------------------------
0051     bool getExitOnFirstFatal() const;
0052 
0053     // -----------------------------------------------------------------------
0054     //  Setter methods
0055     // -----------------------------------------------------------------------
0056     void setErrorReporter(XMLErrorReporter* const errorReporter);
0057     void setExitOnFirstFatal(const bool newValue);
0058 
0059     // -----------------------------------------------------------------------
0060     //  Report error methods
0061     // -----------------------------------------------------------------------
0062     void emitError(const unsigned int toEmit,
0063                    const XMLCh* const msgDomain,
0064                    const Locator* const aLocator);
0065     void emitError(const unsigned int toEmit,
0066                    const XMLCh* const msgDomain,
0067                    const Locator* const aLocator,
0068                    const XMLCh* const text1,
0069                    const XMLCh* const text2 = 0,
0070                    const XMLCh* const text3 = 0,
0071                    const XMLCh* const text4 = 0,
0072                    MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0073                    );
0074     void emitError(const XMLException&  except,
0075                    const Locator* const aLocator);
0076 
0077 private:
0078     // -----------------------------------------------------------------------
0079     //  Unimplemented constructors and destructor
0080     // -----------------------------------------------------------------------
0081     XSDErrorReporter(const XSDErrorReporter&);
0082     XSDErrorReporter& operator=(const XSDErrorReporter&);
0083 
0084     // -----------------------------------------------------------------------
0085     //  Private data members
0086     // -----------------------------------------------------------------------
0087     bool              fExitOnFirstFatal;
0088     XMLErrorReporter* fErrorReporter;
0089 };
0090 
0091 
0092 // ---------------------------------------------------------------------------
0093 //  XSDErrorReporter: Getter methods
0094 // ---------------------------------------------------------------------------
0095 inline bool XSDErrorReporter::getExitOnFirstFatal() const
0096 {
0097     return fExitOnFirstFatal;
0098 }
0099 
0100 // ---------------------------------------------------------------------------
0101 //  XSDErrorReporter: Setter methods
0102 // ---------------------------------------------------------------------------
0103 inline void XSDErrorReporter::setExitOnFirstFatal(const bool newValue)
0104 {
0105     fExitOnFirstFatal = newValue;
0106 }
0107 
0108 inline void XSDErrorReporter::setErrorReporter(XMLErrorReporter* const errorReporter)
0109 {
0110     fErrorReporter = errorReporter;
0111 }
0112 
0113 XERCES_CPP_NAMESPACE_END
0114 
0115 #endif