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) {
\r
22 m_ost << i_em.getMessage();
\r
25 /// get error message
\r
26 tstring getMessage() const {
\r
31 template<class T> ErrorMessage &operator<<(const T &i_value) {
\r
37 ErrorMessage &operator<<(
\r
38 std::ios_base &(*i_manip)(std::ios_base&)) {
\r
45 template<> ErrorMessage &operator<<(const std::string &i_value) {
\r
46 m_ost << to_wstring(i_value);
\r
51 typedef const char *const_char_ptr;
\r
52 template<> ErrorMessage &operator<<(const const_char_ptr &i_value) {
\r
53 m_ost << to_wstring(i_value);
\r
59 friend tostream &operator<<(tostream &i_ost, const ErrorMessage &i_em);
\r
64 inline tostream &operator<<(tostream &i_ost, const ErrorMessage &i_em)
\r
66 return i_ost << i_em.getMessage();
\r
71 class WarningMessage : public ErrorMessage
\r
75 template<class T> WarningMessage &operator<<(const T &i_value) {
\r
76 ErrorMessage::operator<<(i_value);
\r
82 #endif // !_ERRORMESSAGE_H
\r