zorba::ZorbaException

#include <zorba/zorba_exception.h>

A ZorbaException is the base class for all Zorba exceptions.

Public Types

internal::diagnostic::location::line_type

line_type

print_format

The format to print exceptions as to an ostream.

Private Attributes

Diagnostic const *

diagnostic_

std::string

message_

std::string

raise_file_

line_type

raise_line_

Public Functions

Diagnostic const &

diagnostic() const

Gets the diagnostic carried by this exception.

ZorbaException &

operator=(ZorbaException const &from)

Assigns this ZorbaException from another.

void

polymorphic_throw() const

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

char const *

raise_file() const

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

line_type

raise_line() const

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

void

set_diagnostic(Diagnostic const &diagnostic)

Sets the diagnostic.

char const *

what() const

ZorbaException(ZorbaException const &from)

Copy-constructs a ZorbaException.

~ZorbaException()

Destroys this ZorbaException.

Public Static Functions

print_format

get_print_format(std::ostream &o)

Gets the current print_format associated with the given ostream.

void

set_print_format(std::ostream &o, print_format f)

Sets the print_format of the given ostream.

Protected Functions

std::unique_ptr< ZorbaException >

clone() const

Clones this exception object.

std::ostream &

print(std::ostream &) const

Prints the exception to the given ostream.

std::ostream &

print_impl(std::ostream &o) const

ZorbaException(Diagnostic const &diagnostic, char const *raise_file, line_type raise_line, char const *message)

Constructs a ZorbaException.

ZorbaException(serialization::Archiver &)

Private Static Functions

int

get_ios_format_index()

Friend Classes

friend std::unique_ptr< ZorbaException >

clone(ZorbaException const &)

friend ZorbaException

make_zorba_exception(char const *, line_type, Diagnostic const &, internal::diagnostic::parameters const &)

friend ZorbaException *

new_zorba_exception(char const *, line_type, Diagnostic const &, internal::diagnostic::parameters const &)

friend std::ostream &

operator<<(std::ostream &, ZorbaException const &)

Emits the given ZorbaException to the given ostream.

friend void

serialization::operator&(serialization::Archiver &, ZorbaException *&)

Public Types

print_format

 print_format

The format to print exceptions as to an ostream.

Private Attributes

diagnostic_

Diagnostic const * diagnostic_

message_

std::string message_

raise_file_

std::string raise_file_

raise_line_

line_type raise_line_

Public Functions

diagnostic

Diagnostic const & diagnostic() const

Gets the diagnostic carried by this exception.

Returns

Returns said diagnostic.

operator=

ZorbaException & operator=(ZorbaException const &from)

Assigns this ZorbaException from another.

Parameters

from The ZorbaException to assign from.

Returns

Returns *this.

polymorphic_throw

void polymorphic_throw() const

raise_file

char const * raise_file() const

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

Returns

Returns said file name.

raise_line

line_type raise_line() const

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

Returns

Returns said line number.

set_diagnostic

void set_diagnostic(Diagnostic const &diagnostic)

Sets the diagnostic.

Parameters

diagnostic The diagnostic.

what

char const * what() const

ZorbaException

 ZorbaException(ZorbaException const &from)

Copy-constructs a ZorbaException.

Parameters

from The ZorbaException to copy from.

~ZorbaException

 ~ZorbaException()

Destroys this ZorbaException.

Public Static Functions

get_print_format

print_format get_print_format(std::ostream &o)

Gets the current print_format associated with the given ostream.

Parameters

o The ostream to get the print_format of.

Returns

Returns said print_format.

set_print_format

void set_print_format(std::ostream &o, print_format f)

Sets the print_format of the given ostream.

Parameters

o The ostream to set the print_format of.
f The print_format value.

Protected Functions

clone

std::unique_ptr< ZorbaException > clone() const

Clones this exception object.

Returns

Returns a clone of this exception.

print

std::ostream & print(std::ostream &) const

Prints the exception to the given ostream.

Parameters

o The ostream to print to.

Returns

Returns o.

print_impl

std::ostream & print_impl(std::ostream &o) const

ZorbaException

 ZorbaException(Diagnostic const &diagnostic, char const *raise_file, line_type raise_line, char const *message)

Constructs a ZorbaException.

Parameters

diagnostic The diagnostic.
raise_file The C++ source-code file name whence the exception was raised.
raise_line The C++ source-code line number whence the exception was raised.
message The diagnostic message.

ZorbaException

 ZorbaException(serialization::Archiver &)

Private Static Functions

get_ios_format_index

int get_ios_format_index()

Friend Classes

clone

friend std::unique_ptr< ZorbaException > clone(ZorbaException const &)

make_zorba_exception

friend ZorbaException make_zorba_exception(char const *, line_type, Diagnostic const &, internal::diagnostic::parameters const &)

new_zorba_exception

friend ZorbaException * new_zorba_exception(char const *, line_type, Diagnostic const &, internal::diagnostic::parameters const &)

operator<<

friend std::ostream & operator<<(std::ostream &, ZorbaException const &)

Emits the given ZorbaException to the given ostream.

Parameters

o The ostream to emit to.
e The ZorbaException to emit.

Returns

Returns o.

serialization::operator&

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