Ceylan::Exception Class Reference

This Exception class should be the mother of all exceptions raised by the Ceylan library. More...

#include <CeylanException.h>

Inheritance diagram for Ceylan::Exception:

Inheritance graph
[legend]
Collaboration diagram for Ceylan::Exception:

Collaboration graph
[legend]

List of all members.

Public Types

enum  TextOutputFormat { rawText, html }
 Defines what text output formats for TextDisplayable instances are available. More...

Public Member Functions

 Exception (const std::string &reason)
 Basic constructor.
virtual ~Exception () throw ()
 Basic virtual destructor.
virtual const std::string toString (VerbosityLevels level=high) const
 Returns a user-friendly description of the state of this object.
virtual const char * what () const throw ()
 Returns a user-friendly description of the exception.

Static Public Member Functions

static const std::string ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high)
 Returns a user-friendly description of this list of pointers to text displayable instances.
static TextOutputFormat GetOutputFormat ()
 Returns the current overall text format to be used by TextDisplayable instances.
static void SetOutputFormat (TextOutputFormat newOutputFormat)
 Sets the current overall text format to be used by TextDisplayable instances.

Protected Attributes

std::string _reason
 Contains the message giving more accurate feedback once the exception is raised.

Static Protected Attributes

static TextOutputFormat _OutputFormat = rawText
 The text format to be used currently by TextDisplayable instances.

Private Member Functions

Exceptionoperator= (const Exception &source)
 Assignment operator made private to ensure that it will never be called.


Detailed Description

This Exception class should be the mother of all exceptions raised by the Ceylan library.

Exception subclasses standard exception, and should be the root of the whole Ceylan inheritance tree for exceptions.

Todo:
Redefine set_unexpected to avoid unclear messages when unexpected exceptions occur.

Definition at line 56 of file CeylanException.h.


Member Enumeration Documentation

Defines what text output formats for TextDisplayable instances are available.

Enumerator:
rawText 
html 

Definition at line 124 of file CeylanTextDisplayable.h.


Constructor & Destructor Documentation

Exception::Exception ( const std::string &  reason  )  [explicit]

Basic constructor.

Parameters:
reason an explanation for this exception being raised.

Definition at line 35 of file CeylanException.cc.

Exception::~Exception (  )  throw () [virtual]

Basic virtual destructor.

Definition at line 43 of file CeylanException.cc.


Member Function Documentation

TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat (  )  [static, inherited]

Exception& Ceylan::Exception::operator= ( const Exception source  )  [private]

Assignment operator made private to ensure that it will never be called.

The compiler should complain whenever this undefined operator is called, implicitly or not.

void TextDisplayable::SetOutputFormat ( TextOutputFormat  newOutputFormat  )  [static, inherited]

Sets the current overall text format to be used by TextDisplayable instances.

Parameters:
newOutputFormat the new output format.

Definition at line 72 of file CeylanTextDisplayable.cc.

References Ceylan::TextDisplayable::_OutputFormat.

Referenced by Ceylan::Log::LogHolder::LogHolder().

const std::string TextDisplayable::ToString ( std::list< TextDisplayable * >  displayables,
Ceylan::VerbosityLevels  level = Ceylan::high 
) [static, inherited]

Returns a user-friendly description of this list of pointers to text displayable instances.

Parameters:
displayables a list of pointers to TextDisplayable instances/
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
toString, Ceylan::VerbosityLevels

Definition at line 45 of file CeylanTextDisplayable.cc.

References Ceylan::formatStringList().

const string Exception::toString ( VerbosityLevels  level = high  )  const [virtual]

Returns a user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
TextDisplayable

Implements Ceylan::TextDisplayable.

Definition at line 50 of file CeylanException.cc.

References _reason.

Referenced by Ceylan::Network::SequentialServerStreamSocket::accept(), Ceylan::Network::MultiplexedServerStreamSocket::accept(), Ceylan::Network::MultiplexedProtocolBasedStreamServer::accept(), Ceylan::Log::LogAggregatorHTML::aggregate(), Ceylan::Network::ClientStreamSocket::connect(), Ceylan::System::StandardFile::ConvertToStreamOpenFlag(), Ceylan::System::StandardFileSystemManager::copyFile(), Ceylan::System::LibfatFileSystemManager::copyFile(), Ceylan::Log::LogAggregator::createLoggableChannelFrom(), Ceylan::Network::StreamSocket::createSocket(), Ceylan::Locatable::detachFromFather(), Ceylan::System::FileSystemManager::diff(), Ceylan::Network::ClientStreamSocket::disconnect(), Ceylan::Object::forgeIdentifier(), Ceylan::System::StandardFile::FromFDtoFD(), Ceylan::System::LibfatFile::FromFDtoFD(), Ceylan::Log::ObjectIdentifier::generateFromChannelName(), Ceylan::Maths::Random::WhiteNoiseGenerator::generateSeedFromCurrentTime(), Ceylan::System::StandardFile::getCorrespondingFileSystemManager(), Ceylan::System::StandardDirectory::getCorrespondingFileSystemManager(), Ceylan::System::LibfatFile::getCorrespondingFileSystemManager(), Ceylan::System::LibfatDirectory::getCorrespondingFileSystemManager(), Ceylan::System::File::GetCorrespondingFileSystemManager(), Ceylan::System::Directory::GetCorrespondingFileSystemManager(), Ceylan::Network::Socket::getInputStreamID(), Ceylan::Network::getMostPreciseLocalHostName(), Ceylan::Maths::Random::RandomGeneratorFromPDF::getNewValue(), Ceylan::Network::Socket::getOutputStreamID(), Ceylan::System::StandardDirectory::getSortedEntries(), Ceylan::Log::LogPlug::GetSpeakerNameFrom(), Ceylan::GetVersion(), Ceylan::System::Directory::goDown(), Ceylan::Network::MultiplexedProtocolBasedStreamServer::handleConnection(), Ceylan::Network::Socket::hasAvailableData(), Ceylan::System::StandardDirectory::hasDirectory(), Ceylan::System::LibfatDirectory::hasDirectory(), Ceylan::System::StandardDirectory::hasEntry(), Ceylan::System::LibfatDirectory::hasEntry(), Ceylan::System::StandardDirectory::hasFile(), Ceylan::System::LibfatDirectory::hasFile(), Ceylan::XML::XMLParser::loadFromFile(), Ceylan::Locatable::Locatable(), Ceylan::Log::LogAggregatorHTML::LogAggregatorHTML(), Ceylan::Log::LogAggregatorRaw::LogAggregatorRaw(), Ceylan::Log::LogHolder::LogHolder(), Ceylan::Log::LogMessage::LogMessage(), Ceylan::System::StandardFileSystemManager::moveDirectory(), Ceylan::System::LibfatFileSystemManager::moveDirectory(), Ceylan::System::StandardFileSystemManager::moveFile(), Ceylan::Log::ObjectChannel::ObjectChannel(), Ceylan::Log::ObjectIdentifier::ObjectIdentifier(), operator<<(), Ceylan::System::Pipe::Pipe(), Ceylan::System::StandardFile::read(), Ceylan::System::LibfatFile::read(), Ceylan::System::File::readExactLength(), Ceylan::System::Process::RedirectStderr(), Ceylan::System::Process::RedirectStdin(), Ceylan::System::Process::RedirectStdout(), Ceylan::System::File::remove(), Ceylan::Middleware::Marshaller::retrieveData(), Ceylan::Plugin::retrieveMetadata(), Ceylan::Network::MultiplexedServerStreamSocket::run(), Ceylan::XML::XMLParser::saveToFile(), Ceylan::System::LibfatDirectory::secureCorrespondingFileSystemManager(), Ceylan::System::Console::setTextLayout(), Ceylan::System::Thread::Sleep(), Ceylan::Version::Version(), Ceylan::waitForKey(), what(), Ceylan::System::StandardFile::write(), Ceylan::Network::Socket::write(), Ceylan::Log::LogAggregatorRaw::write(), Ceylan::Log::LogAggregatorHTML::write(), Ceylan::System::LibfatFile::write(), Ceylan::Log::LogAggregatorHTML::WriteChannelFooter(), Ceylan::Log::LogAggregatorHTML::WriteChannelHeader(), Ceylan::System::LibfatFile::~LibfatFile(), Ceylan::Locatable::~Locatable(), Ceylan::Lockable::~Lockable(), Ceylan::Log::LogAggregatorConsole::~LogAggregatorConsole(), Ceylan::Log::LogAggregatorHTML::~LogAggregatorHTML(), Ceylan::Log::LogAggregatorRaw::~LogAggregatorRaw(), Ceylan::System::Pipe::~Pipe(), Ceylan::Network::SequentialServerStreamSocket::~SequentialServerStreamSocket(), Ceylan::Network::Socket::~Socket(), and Ceylan::System::StandardFile::~StandardFile().

const char * Exception::what (  )  const throw () [virtual]

Returns a user-friendly description of the exception.

Uses high level of detail for the exception description.

This methods is made for backward compability with std::exception.

See also:
toString the recommended way of having the exception description.

Definition at line 60 of file CeylanException.cc.

References Ceylan::high, and toString().


Member Data Documentation

TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited]

The text format to be used currently by TextDisplayable instances.

Note:
Defaults to raw text.

Definition at line 158 of file CeylanTextDisplayable.h.

Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().

std::string Ceylan::Exception::_reason [protected]

Contains the message giving more accurate feedback once the exception is raised.

Definition at line 115 of file CeylanException.h.

Referenced by toString().


The documentation for this class was generated from the following files:

Generated on Thu Jun 4 20:40:06 2009 for Ceylan by  doxygen 1.5.8