diagnostic_handler.h
Go to the documentation of this file.
1 /*
2  * Copyright 2006-2008 The FLWOR Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ZORBA_DIAGNOSTIC_HANDLER_API_H
18 #define ZORBA_DIAGNOSTIC_HANDLER_API_H
19 
20 #include <zorba/config.h>
21 
22 #include <zorba/xquery_warning.h>
23 
24 namespace zorba {
25 
26 /**
27  * When registered with an XQuery object, a %DiagnosticHandler handles all
28  * exceptions and warnings that otherwise would have been thrown or reported.
29  */
30 class ZORBA_DLL_PUBLIC DiagnosticHandler {
31 public:
32  virtual ~DiagnosticHandler();
33 
34  /**
35  * This function is called for all exceptions.
36  *
37  * @param exception The exception.
38  */
39  virtual void error( ZorbaException const &exception );
40 
41  /**
42  * This function is called for all warnings.
43  *
44  * @param warning The warning.
45  */
46  virtual void warning( XQueryWarning const &warning );
47 };
48 
49 } // namespace zorba
50 
51 #endif /* ZORBA_DIAGNOSTIC_HANDLER_API_H */
52 /* vim:set et sw=2 ts=2: */