small class holding a stringstream
More...
|
| | Message () |
| | construct an empty message
|
| |
| | Message (const char *file, const int line) |
| | Initiate message with the file and line it comes from.
|
| |
| | Message (std::string m) |
| | Construct message with string.
|
| |
| | ~Message () |
| |
| template<class T > |
| Message & | operator<< (const T &value) |
| | add values to the message stream
|
| |
| std::string | str () const |
| | return the message contained in the stream as a string
|
| |
small class holding a stringstream
catch(
Error& m) {std::cerr <<
m.what();}
class intended for the use in throw statements
Definition exceptions.h:83
Message()
construct an empty message
Definition exceptions.h:36
#define _ping_
Definition exceptions.h:12
◆ Message() [1/3]
construct an empty message
◆ Message() [2/3]
| dg::Message::Message |
( |
const char * | file, |
|
|
const int | line ) |
|
inline |
Initiate message with the file and line it comes from.
- Parameters
-
| file | The file in which the exception is thrown (contained in the predefined Macro __FILE__ ) |
| line | The line in which the exception is thrown (contained in the predefined Macro __LINE__ ) |
- Note
- The Macro
_ping_ expands to __FILE__, __LINE__ _
◆ Message() [3/3]
| dg::Message::Message |
( |
std::string | m | ) |
|
|
inline |
Construct message with string.
- Parameters
-
◆ ~Message()
| dg::Message::~Message |
( |
| ) |
|
|
inline |
◆ operator<<()
template<class T >
| Message & dg::Message::operator<< |
( |
const T & | value | ) |
|
|
inline |
add values to the message stream
- Note
- you can't use
std::endl or std::flush in here
◆ str()
| std::string dg::Message::str |
( |
| ) |
const |
|
inline |
return the message contained in the stream as a string
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
const Message & | m ) |
|
friend |
put the sringstream string into the ostream
- Note
- same as os<<m.str();
The documentation for this class was generated from the following file: