00001 #ifndef CPPUNIT_MESSAGE_H
00002 #define CPPUNIT_MESSAGE_H
00003
00004 #include <cppunit/Portability.h>
00005
00006 #if CPPUNIT_NEED_DLL_DECL
00007 #pragma warning( push )
00008 #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
00009 #endif
00010
00011 #include <deque>
00012 #include <string>
00013
00014
00015 CPPUNIT_NS_BEGIN
00016
00017
00034 class CPPUNIT_API Message
00035 {
00036 public:
00037 Message() {};
00038
00039
00040 Message( const Message &other );
00041
00042 explicit Message( const std::string &shortDescription );
00043
00044 Message( const std::string &shortDescription,
00045 const std::string &detail1 );
00046
00047 Message( const std::string &shortDescription,
00048 const std::string &detail1,
00049 const std::string &detail2 );
00050
00051 Message( const std::string &shortDescription,
00052 const std::string &detail1,
00053 const std::string &detail2,
00054 const std::string &detail3 );
00055
00056 virtual ~Message();
00057
00058 Message &operator =( const Message &other );
00059
00063 const std::string &shortDescription() const;
00064
00068 int detailCount() const;
00069
00075 std::string detailAt( int index ) const;
00076
00090 std::string details() const;
00091
00094 void clearDetails();
00095
00099 void addDetail( const std::string &detail );
00100
00105 void addDetail( const std::string &detail1,
00106 const std::string &detail2 );
00107
00113 void addDetail( const std::string &detail1,
00114 const std::string &detail2,
00115 const std::string &detail3 );
00116
00120 void addDetail( const Message &message );
00121
00125 void setShortDescription( const std::string &shortDescription );
00126
00131 bool operator ==( const Message &other ) const;
00132
00137 bool operator !=( const Message &other ) const;
00138
00139 private:
00140 std::string m_shortDescription;
00141
00142 typedef std::deque<std::string> Details;
00143 Details m_details;
00144 };
00145
00146
00147 CPPUNIT_NS_END
00148
00149 #if CPPUNIT_NEED_DLL_DECL
00150 #pragma warning( pop )
00151 #endif
00152
00153
00154 #endif // CPPUNIT_MESSAGE_H