Public Types | Public Member Functions | Protected Member Functions | Friends
zorba::XQueryException Class Reference

An XQueryException is-a ZorbaException for errors with the user's XQuery. More...

#include <zorba/xquery_exception.h>

Inheritance diagram for zorba::XQueryException:
Inheritance graph
[legend]
Collaboration diagram for zorba::XQueryException:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
internal::diagnostic::location::column_type 
column_type
typedef
internal::diagnostic::location::line_type 
line_type

Public Member Functions

Diagnostic const & diagnostic () const throw ()
 Gets the diagnostic carried by this exception.
bool has_source () const throw ()
 Checks whether the XQuery source location has been set.
XQueryExceptionoperator= (XQueryException const &from)
 Assigns this XQueryException from another.
void polymorphic_throw () const
 Throws itself polymorphically; see http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.16.
XQueryStackTracequery_trace () throw ()
 Gets the XQuery stack trace, if any.
XQueryStackTrace const & query_trace () const throw ()
 Gets the XQuery stack trace, if any.
char const * raise_file () const throw ()
 Gets the C++ source-code file name whence this exception was raised.
line_type raise_line () const throw ()
 Gets the C++ source-code line number whence this exception was raised.
void set_diagnostic (Diagnostic const &diagnostic) throw ()
 Sets the diagnostic.
void set_source (char const *uri, line_type line, column_type column=0, line_type line_end=0, column_type column_end=0)
 Sets the XQuery source-code URI name, line, and column numbers.
column_type source_column () const throw ()
 Gets the XQuery source-code column number containing the error.
column_type source_column_end () const throw ()
 Gets the XQuery source-code end column number containing the error.
line_type source_line () const throw ()
 Gets the XQuery source-code line number containing the error.
line_type source_line_end () const throw ()
 Gets the XQuery source-code end line number containing the error.
char const * source_uri () const throw ()
 Gets the XQuery source URI containing the error.
char const * what () const throw ()
 XQueryException (XQueryException const &from)
 Copy-constructs an XQueryException.
 ~XQueryException () throw ()
 Destroys this XQueryException.

Protected Member Functions

std::unique_ptr< ZorbaExceptionclone () const
 Clones this exception object.
std::ostream & print (std::ostream &o) const
 Prints the exception to the given ostream.
 XQueryException (serialization::Archiver &ar)

Friends

XQueryException make_xquery_exception (char const *, ZorbaException::line_type, Diagnostic const &, internal::diagnostic::parameters const &, internal::diagnostic::location const &)
XQueryExceptionnew_xquery_exception (char const *, ZorbaException::line_type, Diagnostic const &, internal::diagnostic::parameters const &, internal::diagnostic::location const &)
std::ostream & operator<< (std::ostream &, ZorbaException const &)
 Emits the given ZorbaException to the given ostream.
void serialization::operator& (serialization::Archiver &, ZorbaException *&)
void set_source (ZorbaException &, char const *, line_type, column_type, line_type, column_type, bool)
class UserException

Detailed Description

An XQueryException is-a ZorbaException for errors with the user's XQuery.

An XQueryException therefore also contains the XQuery source URI, line, and column numbers.

Examples:

context.cpp, and errors.cpp.


Member Typedef Documentation

Definition at line 39 of file xquery_exception.h.

Definition at line 44 of file zorba_exception.h.


Constructor & Destructor Documentation

zorba::XQueryException::XQueryException ( XQueryException const &  from)

Copy-constructs an XQueryException.

Parameters:
fromThe XQueryException to copy from.
zorba::XQueryException::~XQueryException ( ) throw ()

Destroys this XQueryException.

zorba::XQueryException::XQueryException ( serialization::Archiver &  ar) [protected]

Member Function Documentation

std::unique_ptr<ZorbaException> zorba::XQueryException::clone ( ) const [protected, virtual]

Clones this exception object.

Returns:
Returns a clone of this exception.

Reimplemented from zorba::ZorbaException.

Reimplemented in zorba::UserException.

Diagnostic const& zorba::ZorbaException::diagnostic ( ) const throw () [inline, inherited]

Gets the diagnostic carried by this exception.

Returns:
Returns said diagnostic.
Examples:
errors.cpp, external_functions.cpp, and simple.cpp.

Definition at line 71 of file zorba_exception.h.

bool zorba::XQueryException::has_source ( ) const throw () [inline]

Checks whether the XQuery source location has been set.

Returns:
Returns true only if the source location has been set.

Definition at line 82 of file xquery_exception.h.

XQueryException& zorba::XQueryException::operator= ( XQueryException const &  from)

Assigns this XQueryException from another.

Parameters:
fromThe XQueryException to assign from.
Returns:
Returns *this.
void zorba::XQueryException::polymorphic_throw ( ) const [virtual]

Throws itself polymorphically; see http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.16.

Reimplemented from zorba::ZorbaException.

Reimplemented in zorba::UserException.

std::ostream& zorba::XQueryException::print ( std::ostream &  o) const [protected, virtual]

Prints the exception to the given ostream.

Parameters:
oThe ostream to print to.
Returns:
Returns o.

Reimplemented from zorba::ZorbaException.

XQueryStackTrace& zorba::XQueryException::query_trace ( ) throw () [inline]

Gets the XQuery stack trace, if any.

Returns:
Returns said stack trace.

Definition at line 136 of file xquery_exception.h.

XQueryStackTrace const& zorba::XQueryException::query_trace ( ) const throw () [inline]

Gets the XQuery stack trace, if any.

Returns:
Returns said stack trace.

Definition at line 145 of file xquery_exception.h.

char const* zorba::ZorbaException::raise_file ( ) const throw () [inline, inherited]

Gets the C++ source-code file name whence this exception was raised.

Returns:
Returns said file name.

Definition at line 95 of file zorba_exception.h.

line_type zorba::ZorbaException::raise_line ( ) const throw () [inline, inherited]

Gets the C++ source-code line number whence this exception was raised.

Returns:
Returns said line number.

Definition at line 104 of file zorba_exception.h.

void zorba::ZorbaException::set_diagnostic ( Diagnostic const &  diagnostic) throw () [inline, inherited]

Sets the diagnostic.

Parameters:
diagnosticThe diagnostic.

Definition at line 86 of file zorba_exception.h.

void zorba::XQueryException::set_source ( char const *  uri,
line_type  line,
column_type  column = 0,
line_type  line_end = 0,
column_type  column_end = 0 
)

Sets the XQuery source-code URI name, line, and column numbers.

Parameters:
uriThe source-code URI name.
lineThe source-code URI line number.
columnThe source-code URI column number.
line_endThe source-code URI end line number.
column_endThe source-code URI end column number.
column_type zorba::XQueryException::source_column ( ) const throw () [inline]

Gets the XQuery source-code column number containing the error.

Returns:
Returns said column number or 0 if unset.

Definition at line 109 of file xquery_exception.h.

column_type zorba::XQueryException::source_column_end ( ) const throw () [inline]

Gets the XQuery source-code end column number containing the error.

Returns:
Returns said column number or 0 if unset.

Definition at line 127 of file xquery_exception.h.

line_type zorba::XQueryException::source_line ( ) const throw () [inline]

Gets the XQuery source-code line number containing the error.

Returns:
Returns said line number or 0 if unset.

Definition at line 100 of file xquery_exception.h.

line_type zorba::XQueryException::source_line_end ( ) const throw () [inline]

Gets the XQuery source-code end line number containing the error.

Returns:
Returns said line number or 0 if unset.

Definition at line 118 of file xquery_exception.h.

char const* zorba::XQueryException::source_uri ( ) const throw () [inline]

Gets the XQuery source URI containing the error.

Returns:
Returns said URI or the empty string if unset.

Definition at line 91 of file xquery_exception.h.

char const* zorba::ZorbaException::what ( ) const throw () [inherited]
Examples:
simple.cpp.

Friends And Related Function Documentation

XQueryException make_xquery_exception ( char const *  ,
ZorbaException::line_type  ,
Diagnostic const &  ,
internal::diagnostic::parameters const &  ,
internal::diagnostic::location const &   
) [friend]
XQueryException* new_xquery_exception ( char const *  ,
ZorbaException::line_type  ,
Diagnostic const &  ,
internal::diagnostic::parameters const &  ,
internal::diagnostic::location const &   
) [friend]
std::ostream& operator<< ( std::ostream &  o,
ZorbaException const &  e 
) [friend, inherited]

Emits the given ZorbaException to the given ostream.

Parameters:
oThe ostream to emit to.
eThe ZorbaException to emit.
Returns:
Returns o.

Definition at line 174 of file zorba_exception.h.

void serialization::operator& ( serialization::Archiver &  ,
ZorbaException *&   
) [friend]

Reimplemented from zorba::ZorbaException.

Reimplemented in zorba::UserException.

void set_source ( ZorbaException ,
char const *  ,
line_type  ,
column_type  ,
line_type  ,
column_type  ,
bool   
) [friend]
friend class UserException [friend]

Definition at line 189 of file xquery_exception.h.


The documentation for this class was generated from the following file:
blog comments powered by Disqus