Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
zorba::UserException Class Reference

A UserException is-an XQueryException for errors raised via fn:error(). More...

#include <zorba/user_exception.h>

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

Public Types

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

Public Member Functions

column_type applied_column () const throw ()
 Gets the XQuery source-code "applied at" column number containing the error. More...
 
column_type applied_column_end () const throw ()
 Gets the XQuery source-code "applied at" end column number containing the error. More...
 
line_type applied_line () const throw ()
 Gets the XQuery source-code "applied at" line number containing the error. More...
 
line_type applied_line_end () const throw ()
 Gets the XQuery source-code "applied at" end line number containing the error. More...
 
char const * applied_uri () const throw ()
 Gets the XQuery source-code "applied at" URI containing the error. More...
 
Diagnostic const & diagnostic () const throw ()
 Gets the diagnostic carried by this exception. More...
 
error_object_type const & error_object () const throw ()
 Gets the error object associated with this exception. More...
 
bool has_applied () const throw ()
 Checks whether the XQuery "applied at" location has been set. More...
 
bool has_source () const throw ()
 Checks whether the XQuery source-code location has been set. More...
 
UserExceptionoperator= (UserException const &from)
 Assigns this UserException from another. More...
 
void polymorphic_throw () const
 Throws itself polymorphically; see http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.16. More...
 
XQueryStackTracequery_trace () throw ()
 Gets the XQuery stack trace, if any. More...
 
XQueryStackTrace const & query_trace () const throw ()
 Gets the XQuery stack trace, if any. More...
 
char const * raise_file () const throw ()
 Gets the C++ source-code file name whence this exception was raised. More...
 
line_type raise_line () const throw ()
 Gets the C++ source-code line number whence this exception was raised. More...
 
void set_applied (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 "applied at" URI name, line, and column numbers. More...
 
void set_diagnostic (Diagnostic const &diagnostic) throw ()
 Sets the diagnostic. More...
 
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. More...
 
column_type source_column () const throw ()
 Gets the XQuery source-code column number containing the error. More...
 
column_type source_column_end () const throw ()
 Gets the XQuery source-code end column number containing the error. More...
 
line_type source_line () const throw ()
 Gets the XQuery source-code line number containing the error. More...
 
line_type source_line_end () const throw ()
 Gets the XQuery source-code end line number containing the error. More...
 
char const * source_uri () const throw ()
 Gets the XQuery source-code URI containing the error. More...
 
 UserException (UserException const &from)
 Copy-constructs a UserException. More...
 
char const * what () const throw ()
 
 ~UserException () throw ()
 Destroys this UserException. More...
 

Protected Member Functions

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

Friends

UserException internal::make_user_exception (char const *, line_type, char const *, char const *, char const *, char const *, internal::diagnostic::location const &, error_object_type *)
 
UserException internal::make_user_exception (char const *, line_type, Error const &, char const *, internal::diagnostic::location const &, error_object_type *)
 
void serialization::operator& (serialization::Archiver &, ZorbaException *&)
 

Detailed Description

A UserException is-an XQueryException for errors raised via fn:error().

Examples:
errors.cpp.

Definition at line 96 of file user_exception.h.

Member Typedef Documentation

Definition at line 39 of file xquery_exception.h.

Definition at line 98 of file user_exception.h.

Definition at line 44 of file zorba_exception.h.

Constructor & Destructor Documentation

zorba::UserException::UserException ( UserException const &  from)

Copy-constructs a UserException.

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

Destroys this UserException.

Member Function Documentation

column_type zorba::XQueryException::applied_column ( ) const throw ()
inlineinherited

Gets the XQuery source-code "applied at" column number containing the error.

Returns
Returns said column number or 0 if unset.

Definition at line 184 of file xquery_exception.h.

column_type zorba::XQueryException::applied_column_end ( ) const throw ()
inlineinherited

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

Returns
Returns said column number or 0 if unset.

Definition at line 204 of file xquery_exception.h.

line_type zorba::XQueryException::applied_line ( ) const throw ()
inlineinherited

Gets the XQuery source-code "applied at" line number containing the error.

Returns
Returns said line number or 0 if unset.

Definition at line 174 of file xquery_exception.h.

line_type zorba::XQueryException::applied_line_end ( ) const throw ()
inlineinherited

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

Returns
Returns said line number or 0 if unset.

Definition at line 194 of file xquery_exception.h.

char const* zorba::XQueryException::applied_uri ( ) const throw ()
inlineinherited

Gets the XQuery source-code "applied at" URI containing the error.

Returns
Returns said URI or the empty string if unset.

Definition at line 165 of file xquery_exception.h.

std::unique_ptr<ZorbaException> zorba::UserException::clone ( ) const
protectedvirtual

Clones this exception object.

Returns
Returns a clone of this exception.

Reimplemented from zorba::ZorbaException.

Diagnostic const& zorba::ZorbaException::diagnostic ( ) const throw ()
inlineinherited

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.

error_object_type const& zorba::UserException::error_object ( ) const throw ()
inline

Gets the error object associated with this exception.

Returns
Returns said error object.
Examples:
errors.cpp.

Definition at line 125 of file user_exception.h.

bool zorba::XQueryException::has_applied ( ) const throw ()
inlineinherited

Checks whether the XQuery "applied at" location has been set.

Returns
Returns true only if the "applied at" location has been set.

Definition at line 139 of file xquery_exception.h.

bool zorba::XQueryException::has_source ( ) const throw ()
inlineinherited

Checks whether the XQuery source-code location has been set.

Returns
Returns true only if said has been set.

Definition at line 68 of file xquery_exception.h.

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

Assigns this UserException from another.

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

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

Reimplemented from zorba::ZorbaException.

std::ostream& zorba::XQueryException::print ( std::ostream &  o) const
protectedvirtualinherited

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 ()
inlineinherited

Gets the XQuery stack trace, if any.

Returns
Returns said stack trace.

Definition at line 215 of file xquery_exception.h.

XQueryStackTrace const& zorba::XQueryException::query_trace ( ) const throw ()
inlineinherited

Gets the XQuery stack trace, if any.

Returns
Returns said stack trace.

Definition at line 224 of file xquery_exception.h.

char const* zorba::ZorbaException::raise_file ( ) const throw ()
inlineinherited

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 ()
inlineinherited

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::XQueryException::set_applied ( char const *  uri,
line_type  line,
column_type  column = 0,
line_type  line_end = 0,
column_type  column_end = 0 
)
inherited

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

Parameters
uriThe source-code "applied at" URI name. If either the null pointer or the empty string, source_uri() is used.
lineThe source-code "applied at" URI line number.
columnThe source-code "applied at" URI column number.
line_endThe source-code "applied at" URI end line number.
column_endThe source-code "applied at" URI end column number.
void zorba::ZorbaException::set_diagnostic ( Diagnostic const &  diagnostic) throw ()
inlineinherited

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 
)
inherited

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 ()
inlineinherited

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

Returns
Returns said column number or 0 if unset.

Definition at line 110 of file xquery_exception.h.

column_type zorba::XQueryException::source_column_end ( ) const throw ()
inlineinherited

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

Returns
Returns said column number or 0 if unset.

Definition at line 128 of file xquery_exception.h.

line_type zorba::XQueryException::source_line ( ) const throw ()
inlineinherited

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

Returns
Returns said line number or 0 if unset.

Definition at line 101 of file xquery_exception.h.

line_type zorba::XQueryException::source_line_end ( ) const throw ()
inlineinherited

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

Returns
Returns said line number or 0 if unset.

Definition at line 119 of file xquery_exception.h.

char const* zorba::XQueryException::source_uri ( ) const throw ()
inlineinherited

Gets the XQuery source-code URI containing the error.

Returns
Returns said URI or the empty string if unset.

Definition at line 92 of file xquery_exception.h.

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

Friends And Related Function Documentation

UserException internal::make_user_exception ( char const *  ,
line_type  ,
char const *  ,
char const *  ,
char const *  ,
char const *  ,
internal::diagnostic::location const &  ,
error_object_type  
)
friend
UserException internal::make_user_exception ( char const *  ,
line_type  ,
Error const &  ,
char const *  ,
internal::diagnostic::location const &  ,
error_object_type  
)
friend
void serialization::operator& ( serialization::Archiver &  ,
ZorbaException *&   
)
friend

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