source: icXML/icXML-devel/src/xercesc/validators/schema/XSDErrorReporter.hpp

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

Original Xerces files with import mods for icxercesc

File size: 4.2 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: XSDErrorReporter.hpp 527149 2007-04-10 14:56:39Z amassari $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_XSDERRORREPORTER_HPP)
23#define XERCESC_INCLUDE_GUARD_XSDERRORREPORTER_HPP
24
25#include <xercesc/util/XMemory.hpp>
26
27XERCES_CPP_NAMESPACE_BEGIN
28
29class Locator;
30class XMLErrorReporter;
31
32
33/**
34 *  This class reports schema errors
35 */
36class VALIDATORS_EXPORT XSDErrorReporter : public XMemory
37{
38public:
39    // -----------------------------------------------------------------------
40    //  Constructors are hidden, only the virtual destructor is exposed
41    // -----------------------------------------------------------------------
42    XSDErrorReporter(XMLErrorReporter* const errorReporter = 0);
43
44    virtual ~XSDErrorReporter()
45    {
46    }
47
48    // -----------------------------------------------------------------------
49    //  Getter methods
50    // -----------------------------------------------------------------------
51    bool getExitOnFirstFatal() const;
52
53    // -----------------------------------------------------------------------
54    //  Setter methods
55    // -----------------------------------------------------------------------
56    void setErrorReporter(XMLErrorReporter* const errorReporter);
57    void setExitOnFirstFatal(const bool newValue);
58
59    // -----------------------------------------------------------------------
60    //  Report error methods
61    // -----------------------------------------------------------------------
62    void emitError(const unsigned int toEmit,
63                   const XMLCh* const msgDomain,
64                   const Locator* const aLocator);
65    void emitError(const unsigned int toEmit,
66                   const XMLCh* const msgDomain,
67                   const Locator* const aLocator,
68                   const XMLCh* const text1,
69                   const XMLCh* const text2 = 0,
70                   const XMLCh* const text3 = 0,
71                   const XMLCh* const text4 = 0,
72                   MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
73                   );
74    void emitError(const XMLException&  except,
75                   const Locator* const aLocator);
76
77private:
78    // -----------------------------------------------------------------------
79    //  Unimplemented constructors and destructor
80    // -----------------------------------------------------------------------
81    XSDErrorReporter(const XSDErrorReporter&);
82    XSDErrorReporter& operator=(const XSDErrorReporter&);
83
84    // -----------------------------------------------------------------------
85    //  Private data members
86    // -----------------------------------------------------------------------
87    bool              fExitOnFirstFatal;
88    XMLErrorReporter* fErrorReporter;
89};
90
91
92// ---------------------------------------------------------------------------
93//  XSDErrorReporter: Getter methods
94// ---------------------------------------------------------------------------
95inline bool XSDErrorReporter::getExitOnFirstFatal() const
96{
97    return fExitOnFirstFatal;
98}
99
100// ---------------------------------------------------------------------------
101//  XSDErrorReporter: Setter methods
102// ---------------------------------------------------------------------------
103inline void XSDErrorReporter::setExitOnFirstFatal(const bool newValue)
104{
105    fExitOnFirstFatal = newValue;
106}
107
108inline void XSDErrorReporter::setErrorReporter(XMLErrorReporter* const errorReporter)
109{
110    fErrorReporter = errorReporter;
111}
112
113XERCES_CPP_NAMESPACE_END
114
115#endif
Note: See TracBrowser for help on using the repository browser.