17 #ifndef ZORBA_XQUERY_EXCEPTION_API_H
18 #define ZORBA_XQUERY_EXCEPTION_API_H
25 namespace serialization {
27 void operator&( Archiver&, ZorbaException*& );
77 bool has_source() const throw() {
90 void set_source(
char const *uri,
92 column_type column = 0,
93 line_type line_end = 0,
94 column_type column_end = 0 );
102 return source_loc_.file();
111 return source_loc_.line();
120 return source_loc_.column();
129 return source_loc_.line_end();
138 return source_loc_.column_end();
161 void set_data(
char const *uri,
163 column_type column = 0,
164 line_type line_end = 0,
165 column_type column_end = 0 );
173 return data_loc_.file();
182 return data_loc_.line();
191 return data_loc_.column();
200 return data_loc_.line_end();
209 return data_loc_.column_end();
234 void set_applied(
char const *uri,
236 column_type column = 0,
237 line_type line_end = 0,
238 column_type column_end = 0 );
246 return applied_loc_.file();
255 return applied_loc_.line();
265 return applied_loc_.column();
275 return applied_loc_.line_end();
285 return applied_loc_.column_end();
298 return !!( o.iword( get_ios_trace_index() ) );
327 o.iword( get_ios_trace_index() ) = print;
333 void polymorphic_throw()
const;
336 std::ostream& print_stack_trace( std::ostream& )
const;
337 static bool print_uri( std::ostream&,
char const *uri );
341 std::ostream& print_impl( std::ostream& )
const;
358 line_type raise_line,
char const *message );
360 location source_loc_;
362 location applied_loc_;
365 static int get_ios_trace_index();
369 parameters
const&, location
const&
374 parameters
const&, location
const&
377 friend void set_applied(
ZorbaException&,
char const*, line_type, column_type,
378 line_type, column_type,
bool );
380 friend void set_data(
ZorbaException&,
char const*, line_type, column_type,
381 line_type, column_type,
bool );
383 friend void set_source(
ZorbaException&,
char const*, line_type, column_type,
384 line_type, column_type,
bool );
static void set_print_trace(std::ostream &o, bool print)
Sets whether XQuery stack traces will be included when XQueryExceptions are printed to the given ostr...
char const * applied_uri() const
Gets the XQuery source-code "applied at" URI containing the error.
A location holds the file location of an error.
A ZorbaException is the base class for all Zorba exceptions.
line_type applied_line() const
Gets the XQuery source-code "applied at" line number containing the error.
column_type applied_column_end() const
Gets the XQuery source-code "applied at" end column number containing the error.
XQueryStackTrace & query_trace()
Gets the XQuery stack trace, if any.
unsigned short column_type
The column-number type.
line_type data_line_end() const
Gets the data end line number containing the error.
An XQueryException is-a ZorbaException for errors with the user's XQuery.
bool has_data() const
Checks whether the XQuery data location has been set.
line_type source_line() const
Gets the XQuery source-code line number containing the error.
line_type source_line_end() const
Gets the XQuery source-code end line number containing the error.
A UserException is-an XQueryException for errors raised via fn:error().
char const * source_uri() const
Gets the XQuery source-code URI containing the error.
A Diagnostic is the base class for all Zorba diagnostics (errors and warnings).
column_type data_column() const
Gets the data column number containing the error.
line_type applied_line_end() const
Gets the XQuery source-code "applied at" end line number containing the error.
column_type data_column_end() const
Gets the data end column number containing the error.
internal::diagnostic::location::column_type column_type
bool has_applied() const
Checks whether the XQuery "applied at" location has been set.
static bool get_print_trace(std::ostream &o)
Gets whether XQuery stack traces will be included when XQueryExceptions are printed to the given ostr...
column_type source_column() const
Gets the XQuery source-code column number containing the error.
internal::diagnostic::location::line_type line_type
char const * data_uri() const
Gets the data URI containing the error.
print_trace
Whether to include the XQuery stack trace for the XQueryException that's printed to an ostream...
ZORBA_DLL_PUBLIC std::ostream & operator<<(std::ostream &os, const QueryLocation &aQuery)
void operator&(serialization::Archiver &, const Diagnostic *&)
XQueryStackTrace const & query_trace() const
Gets the XQuery stack trace, if any.
column_type source_column_end() const
Gets the XQuery source-code end column number containing the error.
column_type applied_column() const
Gets the XQuery source-code "applied at" column number containing the error.
line_type data_line() const
Gets the data line number containing the error.