libyui  3.4.2
YUIIndexOutOfRangeException Class Reference

Exception class for "index out of range". More...

#include <YUIException.h>

Inheritance diagram for YUIIndexOutOfRangeException:
YUIException

Public Member Functions

 YUIIndexOutOfRangeException (int invalidIndex, int validMin, int validMax, const std::string &msg="")
 Constructor. More...
 
int invalidIndex () const
 Return the offending index value.
 
int validMin () const
 Return the valid minimum index.
 
int validMax () const
 Return the valid maximum index.
 
- Public Member Functions inherited from YUIException
 YUIException ()
 Default constructor. More...
 
 YUIException (const std::string &msg_r)
 Constructor taking a message. More...
 
virtual ~YUIException () throw ()
 Destructor.
 
const YCodeLocationwhere () const
 Return YCodeLocation.
 
void relocate (const YCodeLocation &newLocation) const
 Exchange location on rethrow.
 
const std::string & msg () const
 Return the message string provided to the constructor. More...
 
void setMsg (const std::string &msg)
 Set a new message string.
 
std::string asString () const
 Error message provided by dumpOn as string.
 
virtual const char * what () const throw ()
 Return message string. More...
 

Protected Member Functions

virtual std::ostream & dumpOn (std::ostream &str) const
 Write proper error message with all relevant data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from YUIException
static std::string strErrno (int errno_r)
 Make a string from errno_r.
 
static std::string strErrno (int errno_r, const std::string &msg)
 Make a string from errno_r and msg_r.
 
static void log (const YUIException &exception, const YCodeLocation &location, const char *const prefix)
 Drop a log line on throw, catch or rethrow. More...
 

Detailed Description

Exception class for "index out of range".

Definition at line 807 of file YUIException.h.

Constructor & Destructor Documentation

◆ YUIIndexOutOfRangeException()

YUIIndexOutOfRangeException::YUIIndexOutOfRangeException ( int  invalidIndex,
int  validMin,
int  validMax,
const std::string &  msg = "" 
)
inline

Constructor.

'invalidIndex' is the offending index value. It should be between 'validMin' and 'validMax':

 validMin <= index <= validMax

Definition at line 818 of file YUIException.h.

Member Function Documentation

◆ dumpOn()

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

Write proper error message with all relevant data.

Reimplemented from YUIException.

Reimplemented from YUIException.

Definition at line 852 of file YUIException.h.


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