CppUnit project page FAQ CppUnit home page

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Message.h

Go to the documentation of this file.
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 <cppunit/portability/CppUnitDeque.h>
00012 #include <string>
00013 
00014 
00015 CPPUNIT_NS_BEGIN
00016 
00017 
00018 #if CPPUNIT_NEED_DLL_DECL
00019 //  template class CPPUNIT_API std::deque<std::string>;
00020 #endif
00021 
00038 class CPPUNIT_API Message
00039 {
00040 public:
00041   Message();
00042 
00043   // Ensure thread-safe copy by detaching the string.
00044   Message( const Message &other );
00045 
00046   explicit Message( const std::string &shortDescription );
00047 
00048   Message( const std::string &shortDescription,
00049            const std::string &detail1 );
00050 
00051   Message( const std::string &shortDescription,
00052            const std::string &detail1,
00053            const std::string &detail2 );
00054 
00055   Message( const std::string &shortDescription,
00056            const std::string &detail1,
00057            const std::string &detail2,
00058            const std::string &detail3 );
00059 
00060   Message &operator =( const Message &other );
00061 
00065   const std::string &shortDescription() const;
00066 
00070   int detailCount() const;
00071 
00077   std::string detailAt( int index ) const;
00078 
00092   std::string details() const;
00093 
00096   void clearDetails();
00097 
00101   void addDetail( const std::string &detail );
00102 
00107   void addDetail( const std::string &detail1,
00108                   const std::string &detail2 );
00109 
00115   void addDetail( const std::string &detail1,
00116                   const std::string &detail2,
00117                   const std::string &detail3 );
00118 
00122   void addDetail( const Message &message );
00123 
00127   void setShortDescription( const std::string &shortDescription );
00128 
00133   bool operator ==( const Message &other ) const;
00134 
00139   bool operator !=( const Message &other ) const;
00140 
00141 private:
00142   std::string m_shortDescription;
00143 
00144   typedef CppUnitDeque<std::string> Details;
00145   Details m_details;
00146 };
00147 
00148 
00149 CPPUNIT_NS_END
00150 
00151 #if CPPUNIT_NEED_DLL_DECL
00152 #pragma warning( pop )
00153 #endif
00154 
00155 
00156 #endif  // CPPUNIT_MESSAGE_H

SourceForge Logo hosts this site. Send comments to:
CppUnit Developers