1
#include <cppunit/Message.h>
13
Message::Message( const std::string &shortDescription )
14
: m_shortDescription( shortDescription )
19
Message::Message( const std::string &shortDescription,
20
const std::string &detail1 )
21
: m_shortDescription( shortDescription )
27
Message::Message( const std::string &shortDescription,
28
const std::string &detail1,
29
const std::string &detail2 )
30
: m_shortDescription( shortDescription )
32
addDetail( detail1, detail2 );
36
Message::Message( const std::string &shortDescription,
37
const std::string &detail1,
38
const std::string &detail2,
39
const std::string &detail3 )
40
: m_shortDescription( shortDescription )
42
addDetail( detail1, detail2, detail3 );
47
Message::shortDescription() const
49
return m_shortDescription;
54
Message::detailCount() const
56
return m_details.size();
61
Message::detailAt( int index ) const
63
if ( index < 0 || index >= detailCount() )
64
throw std::invalid_argument( "Message::detailAt() : invalid index" );
66
return m_details[ index ];
71
Message::details() const
74
for ( Details::const_iterator it = m_details.begin(); it != m_details.end(); ++it )
85
Message::clearDetails()
92
Message::addDetail( const std::string &detail )
94
m_details.push_back( detail );
99
Message::addDetail( const std::string &detail1,
100
const std::string &detail2 )
102
addDetail( detail1 );
103
addDetail( detail2 );
108
Message::addDetail( const std::string &detail1,
109
const std::string &detail2,
110
const std::string &detail3 )
112
addDetail( detail1, detail2 );
113
addDetail( detail3 );
118
Message::addDetail( const Message &message )
120
m_details.insert( m_details.end(),
121
message.m_details.begin(),
122
message.m_details.end() );
127
Message::setShortDescription( const std::string &shortDescription )
129
m_shortDescription = shortDescription;
134
Message::operator ==( const Message &other ) const
136
return m_shortDescription == other.m_shortDescription &&
137
m_details == other.m_details;
142
Message::operator !=( const Message &other ) const
144
return !( *this == other );