diff options
Diffstat (limited to 'src/cppunit/Message.cpp')
-rw-r--r-- | src/cppunit/Message.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/cppunit/Message.cpp b/src/cppunit/Message.cpp index 85f235e..9d6a0e9 100644 --- a/src/cppunit/Message.cpp +++ b/src/cppunit/Message.cpp @@ -9,6 +9,11 @@ Message::Message() { } +Message::Message( const Message &other ) +{ + *this = other; +} + Message::Message( const std::string &shortDescription ) : m_shortDescription( shortDescription ) @@ -42,6 +47,22 @@ Message::Message( const std::string &shortDescription, addDetail( detail1, detail2, detail3 ); } +Message & +Message::operator =( const Message &other ) +{ + if ( this != &other ) + { + m_shortDescription = other.m_shortDescription.c_str(); + m_details.clear(); + Details::const_iterator it = other.m_details.begin(); + Details::const_iterator itEnd = other.m_details.end(); + while ( it != itEnd ) + m_details.push_back( (*it++).c_str() ); + } + + return *this; +} + const std::string & Message::shortDescription() const |