Deepsolver
Public Member Functions
Deepsolver::ExceptionMessagesEn Class Reference

The error messages generator for English language. More...

Inheritance diagram for Deepsolver::ExceptionMessagesEn:
Deepsolver::ExceptionVisitor

List of all members.

Public Member Functions

 ExceptionMessagesEn ()
 The default constructor.
std::string getMsg () const
 Returns the constructed message.
std::string getText () const
 Returns generated text.
void visit (const CliParserException &e)
 The action for command line parsing errors.
void visit (const SystemException &e)
 The action for system call errors.
void visit (const ConfigFileException &e)
 The action for configuration file syntax errors.
void visit (const ConfigException &e)
 The action for configuration errors.
void visit (const CurlException &e)
 The action for downloading errors.
void visit (const PkgBackEndException &e)
 The action for package back-end errors.
void visit (const OperationCoreException &e)
 The action for operation core errors.
void visit (const TaskException &e)
 The action for user task processing errors.
virtual ~ExceptionMessagesEn ()
 The destructor.

Detailed Description

This class generates complete exception messages, which are really appropriate to be shown to user, but only in case when you are sure that English language suits. Although every exception instance can provide single-line description through its getMessage() method, these values are purposed only for logging. They are not user-friendly and do not support any localization technique.

Respecting the idea that errors messages should be constructing in various languages, there are set of classes taking care of that. This generator does this work for English language and everybody is encouraged to suggest flexible approaches for others.

This class is designed as a visitor. You should visit some exception instances with it and call getText() method to obtain generated text. You can do multiple visits, it is safe but such operation is meaningless.


Member Function Documentation

std::string Deepsolver::ExceptionMessagesEn::getMsg ( ) const [inline]
Returns:
The constructed message >
std::string Deepsolver::ExceptionMessagesEn::getText ( ) const [inline]

You should use this method only after visiting some exception instances, otherwise it returns an empty string.

Returns:
Generated text
DEEPSOLVER_BEGIN_NAMESPACE void ExceptionMessagesEn::visit ( const CliParserException e) [virtual]
Parameters:
[in]eThe reference to the exception object

Reimplemented from Deepsolver::ExceptionVisitor.

void ExceptionMessagesEn::visit ( const SystemException e) [virtual]
Parameters:
[in]eThe reference to the exception object

Reimplemented from Deepsolver::ExceptionVisitor.

void ExceptionMessagesEn::visit ( const ConfigFileException e) [virtual]
Parameters:
[in]eThe reference to the exception object

Reimplemented from Deepsolver::ExceptionVisitor.

void ExceptionMessagesEn::visit ( const ConfigException e) [virtual]
Parameters:
[in]eThe reference to the exception object

Reimplemented from Deepsolver::ExceptionVisitor.

void ExceptionMessagesEn::visit ( const CurlException e) [virtual]
Parameters:
[in]eThe reference to the exception object

Reimplemented from Deepsolver::ExceptionVisitor.

void ExceptionMessagesEn::visit ( const PkgBackEndException e) [virtual]
Parameters:
[in]eThe reference to the exception object

Reimplemented from Deepsolver::ExceptionVisitor.

void ExceptionMessagesEn::visit ( const OperationCoreException e) [virtual]
Parameters:
[in]eThe reference to the exception object

Reimplemented from Deepsolver::ExceptionVisitor.

void ExceptionMessagesEn::visit ( const TaskException e) [virtual]
Parameters:
[in]eThe reference to the exception object

Reimplemented from Deepsolver::ExceptionVisitor.