EDoc::Throwable Class Reference

#include <include/EDoc/exceptions.h>

Inheritance diagram for EDoc::Throwable:

EDoc::BaseException EDoc::BugException EDoc::FileIOException EDoc::MergeException EDoc::PythonException EDoc::EOFException EDoc::UnknownFileTypeException EDocBFD::BFDException

Detailed Description

Base class from which all EDoc exception types will derive.

This provides some simple functionality for useful exception objects.

Definition at line 130 of file exceptions.h.

Public Member Functions

 Throwable (const char *type_name_in, const char *file_in, int line_in, std::string user_message_in="", std::string dev_message_in="")
 Expected to be created in a throw statement.
virtual ~Throwable () throw ()
 Destructor.
virtual const char * what () const throw ()
 Return a string of information so that this can be used as a std::exception instance.
std::string GetType () const
 Returns the name of the type of exception that was thrown.
std::string GetFile () const
 Returns the name of the source file from where the exception was thrown.
int GetLine () const
 Returns the line number of the source file from where the exception was thrown.
std::string GetUserMessage () const
 Returns the succinct message describing the error for the user.
std::string GetDevMessage () const
 Returns the more detailed message describing the error for a developer.

Private Attributes

std::string type_name
 See GetType().
std::string file
 See GetFile().
int line
 See GetLine().
std::string user_message
 See GetUserMessage().
std::string dev_message
 See GetDevMessage().
std::string detailed_message
 A string that contains all the information for this exception in a single string.


Constructor & Destructor Documentation

EDoc::Throwable::Throwable ( const char *  type_name_in,
const char *  file_in,
int  line_in,
std::string  user_message_in = "",
std::string  dev_message_in = "" 
)

Expected to be created in a throw statement.

This provides a good representation of an error that provides enough information that can be used to help debug problems and also to provide succint useful information to a user when an error occurs.

Parameters:
type_name_in This is the name of the exception type being thrown.
file_in The name of the source file from where the exception is being thrown.
line_in The line of the source file from where the exception is being thrown.
user_message_in A string that should be displayed to a user describing succintly the error that occured.
dev_message_in A more detailed message describing a bit of the state information that may have caused the error to occur.

Definition at line 26 of file exceptions.cpp.

References detailed_message, dev_message, file, line, and user_message.

EDoc::Throwable::~Throwable (  )  throw () [inline, virtual]

Destructor.

Note:
EDoc++ data included.

Definition at line 165 of file exceptions.h.


Member Function Documentation

EDoc::Throwable::what (  )  const throw () [virtual]

Return a string of information so that this can be used as a std::exception instance.

Note:
EDoc++ data included.

Definition at line 46 of file exceptions.cpp.

References detailed_message.

Referenced by EDoc::Persistence::ReadOpen().

EDoc::Throwable::GetType (  )  const

Returns the name of the type of exception that was thrown.

Note:
EDoc++ data included.

Definition at line 51 of file exceptions.cpp.

References type_name.

EDoc::Throwable::GetFile (  )  const

Returns the name of the source file from where the exception was thrown.

Note:
EDoc++ data included.

Definition at line 56 of file exceptions.cpp.

References file.

EDoc::Throwable::GetLine (  )  const

Returns the line number of the source file from where the exception was thrown.

Note:
EDoc++ data included.

Definition at line 61 of file exceptions.cpp.

References line.

EDoc::Throwable::GetUserMessage (  )  const

Returns the succinct message describing the error for the user.

Note:
EDoc++ data included.

Definition at line 66 of file exceptions.cpp.

References user_message.

EDoc::Throwable::GetDevMessage (  )  const

Returns the more detailed message describing the error for a developer.

Note:
EDoc++ data included.

Definition at line 71 of file exceptions.cpp.

References dev_message.


Field Documentation

std::string EDoc::Throwable::type_name [private]

See GetType().

Definition at line 208 of file exceptions.h.

Referenced by GetType().

std::string EDoc::Throwable::file [private]

See GetFile().

Definition at line 213 of file exceptions.h.

Referenced by GetFile(), and Throwable().

int EDoc::Throwable::line [private]

See GetLine().

Definition at line 218 of file exceptions.h.

Referenced by GetLine(), and Throwable().

std::string EDoc::Throwable::user_message [private]

See GetUserMessage().

Definition at line 223 of file exceptions.h.

Referenced by GetUserMessage(), and Throwable().

std::string EDoc::Throwable::dev_message [private]

See GetDevMessage().

Definition at line 228 of file exceptions.h.

Referenced by GetDevMessage(), and Throwable().

std::string EDoc::Throwable::detailed_message [private]

A string that contains all the information for this exception in a single string.

This is used by the what() function.

NOTE: It is not a good format to display to the user.

Definition at line 236 of file exceptions.h.

Referenced by Throwable(), and what().


The documentation for this class was generated from the following files:
Generated on Tue Jan 20 18:26:08 2009 for EDoc-0.2.1 by  doxygen 1.5.1