Evo C++ Library v0.5.1
Public Types | Public Member Functions | Protected Types | Protected Member Functions | List of all members
ExceptionStream Class Reference

#include <evo/impl/sys.h>

Inheritance diagram for ExceptionStream:
Inheritance graph
[legend]

Detailed Description

Base stream exception for all stream errors, see Exception.

Public Types

typedef ListBase< char, StrSizeTStringBase
 Alias for evo::StringBase. More...
 

Public Member Functions

 ExceptionStream (const char *file, ulong line, const StringBase &msg, Error error=EUnknown)
 
 ExceptionStream (const ExceptionStream &e)
 
Error error () const
 Get error code. More...
 
template<class TOut >
TOut & errormsg_out (TOut &out)
 Write error message with errno to output stream/string. More...
 
const char * file () const
 Get exception file name. More...
 
ulong line () const
 Get exception line number. More...
 
const char * msg () const
 Get exception message. More...
 

Protected Types

typedef const char *(* ErrorMsgFunc) (Error)
 Pointer type to function returning error message from error code. More...
 

Protected Member Functions

 ExceptionStream (const char *file, ulong line, const char *type, const StringBase &msg, Error error, ErrorMsgFunc errormsg_func)
 

Member Typedef Documentation

◆ ErrorMsgFunc

typedef const char*(* ErrorMsgFunc) (Error)
protectedinherited

Pointer type to function returning error message from error code.

◆ StringBase

typedef ListBase<char,StrSizeT> StringBase

Alias for evo::StringBase.

Constructor & Destructor Documentation

◆ ExceptionStream() [1/3]

ExceptionStream ( const char *  file,
ulong  line,
const StringBase msg,
Error  error = EUnknown 
)
inline

◆ ExceptionStream() [2/3]

ExceptionStream ( const ExceptionStream e)
inline

◆ ExceptionStream() [3/3]

ExceptionStream ( const char *  file,
ulong  line,
const char *  type,
const StringBase msg,
Error  error,
ErrorMsgFunc  errormsg_func 
)
inlineprotected

Member Function Documentation

◆ error()

Error error ( ) const
inlineinherited

Get error code.

Returns
Error code, 0 if unknown

◆ errormsg_out()

TOut& errormsg_out ( TOut &  out)
inlineinherited

Write error message with errno to output stream/string.

  • Must call right after the error, otherwise errno may be overwritten
Template Parameters
TOutOutput stream or string type
Parameters
outStream or String to write output to
Returns
This

◆ file()

const char* file ( ) const
inlineinherited

Get exception file name.

Returns
File name

◆ line()

ulong line ( ) const
inlineinherited

Get exception line number.

Returns
Line number

◆ msg()

const char* msg ( ) const
inlineinherited

Get exception message.

Returns
Message

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