libyui
 
Loading...
Searching...
No Matches
YUIException Class Reference

#include <YUIException.h>

Inheritance diagram for YUIException:
Collaboration diagram for YUIException:

Public Member Functions

 YUIException ()
 
 YUIException (const std::string &msg_r)
 
virtual ~YUIException () throw ()
 
const YCodeLocationwhere () const
 
void relocate (const YCodeLocation &newLocation) const
 
const std::string & msg () const
 
void setMsg (const std::string &msg)
 
std::string asString () const
 
virtual const char * what () const throw ()
 

Static Public Member Functions

static std::string strErrno (int errno_r)
 
static std::string strErrno (int errno_r, const std::string &msg)
 
static void log (const YUIException &exception, const YCodeLocation &location, const char *const prefix)
 

Protected Member Functions

virtual std::ostream & dumpOn (std::ostream &str) const
 

Friends

std::ostream & operator<< (std::ostream &str, const YUIException &obj)
 

Detailed Description

Base class for UI Exceptions.

Exception offers to store a message string passed to the constructor. Derived classes may provide additional information. Overload dumpOn to provide a proper error text.

Constructor & Destructor Documentation

◆ YUIException() [1/2]

YUIException::YUIException ( )

Default constructor. Use YUI_THROW to throw exceptions.

◆ YUIException() [2/2]

YUIException::YUIException ( const std::string & msg_r)

Constructor taking a message. Use YUI_THROW to throw exceptions.

◆ ~YUIException()

YUIException::~YUIException ( )
throw ( )
virtual

Destructor.

Member Function Documentation

◆ asString()

string YUIException::asString ( ) const

Error message provided by dumpOn as string.

◆ dumpOn()

ostream & YUIException::dumpOn ( std::ostream & str) const
protectedvirtual

◆ log()

void YUIException::log ( const YUIException & exception,
const YCodeLocation & location,
const char *const prefix )
static

Drop a log line on throw, catch or rethrow. Used by YUI_THROW macros.

◆ msg()

const std::string & YUIException::msg ( ) const
inline

Return the message string provided to the constructor. Note: This is not neccessarily the complete error message. The whole error message is provided by asString or dumpOn.

◆ relocate()

void YUIException::relocate ( const YCodeLocation & newLocation) const
inline

Exchange location on rethrow.

◆ setMsg()

void YUIException::setMsg ( const std::string & msg)
inline

Set a new message string.

◆ strErrno() [1/2]

string YUIException::strErrno ( int errno_r)
static

Make a string from errno_r.

◆ strErrno() [2/2]

static std::string YUIException::strErrno ( int errno_r,
const std::string & msg )
static

Make a string from errno_r and msg_r.

◆ what()

virtual const char * YUIException::what ( ) const
throw ( )
inlinevirtual

Return message string.

Reimplemented from std::exception.

◆ where()

const YCodeLocation & YUIException::where ( ) const
inline

Return YCodeLocation.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & str,
const YUIException & obj )
friend

YUIException stream output


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