SaxonC  11.6
Saxon Processor library for C/C++, PHP and Python
SaxonApiException.h
1 #ifndef SAXON_API_EXCEPTION_H
2 #define SAXON_API_EXCEPTION_H
3 
5 // Copyright (c) 2022 Saxonica Limited.
6 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
7 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
10 
11 #include <iostream>
12 #include <exception>
13 
14 
15 
19 class SaxonApiException: public std::exception {
20 
21 public:
22 
27 
28 
33  SaxonApiException(const char * message);
34 
40 
41 
42 
48  virtual const char * what ();
49 
57  SaxonApiException(const char * message, const char * errorCode, const char * systemId, int linenumber);
58 
59 
63  virtual ~SaxonApiException() throw() {
64  message.clear();
65  errorCode.clear();
66  systemId.clear();
67 
68  }
69 
70 
71 
76  const char * getErrorCode();
77 
83  int getLineNumber();
84 
85 
91  const char * getMessage();
92 
98  std::string getMessageStr();
99 
103  const char * getSystemId();
104 
105 
106 
107 
108 private:
109  std::string message;
110  int lineNumber;
111  std::string errorCode;
112  std::string systemId;
113 };
114 
115 #endif /* SAXON_API_EXCEPTION_H */
Definition: SaxonApiException.h:19
const char * getMessage()
Definition: SaxonApiException.cpp:91
SaxonApiException()
Definition: SaxonApiException.cpp:15
const char * getSystemId()
Definition: SaxonApiException.cpp:87
const char * getErrorCode()
Definition: SaxonApiException.cpp:77
int getLineNumber()
Definition: SaxonApiException.cpp:82
std::string getMessageStr()
Definition: SaxonApiException.cpp:96
virtual const char * what()
Definition: SaxonApiException.cpp:11
virtual ~SaxonApiException()
Definition: SaxonApiException.h:63