1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\r
5 #ifndef _ERRORMESSAGE_H
\r
6 # define _ERRORMESSAGE_H
\r
8 # include "stringtool.h"
\r
15 tstringstream m_ost; ///
\r
21 ErrorMessage(const ErrorMessage &i_em) { m_ost << i_em.getMessage(); }
\r
23 /// get error message
\r
24 tstring getMessage() const
\r
30 template<class T> ErrorMessage &operator<<(const T &i_value)
\r
36 /// ios manipulator
\r
37 ErrorMessage &operator<<(
\r
38 std::ios_base &(*i_manip)(std::ios_base&))
\r
46 template<> ErrorMessage &operator<<(const std::string &i_value)
\r
48 m_ost << to_wstring(i_value);
\r
53 typedef const char *const_char_ptr;
\r
54 template<> ErrorMessage &operator<<(const const_char_ptr &i_value)
\r
56 m_ost << to_wstring(i_value);
\r
62 friend tostream &operator<<(tostream &i_ost, const ErrorMessage &i_em);
\r
67 inline tostream &operator<<(tostream &i_ost, const ErrorMessage &i_em)
\r
69 return i_ost << i_em.getMessage();
\r
74 class WarningMessage : public ErrorMessage
\r
78 template<class T> WarningMessage &operator<<(const T &i_value)
\r
80 ErrorMessage::operator<<(i_value);
\r
86 #endif // !_ERRORMESSAGE_H
\r