Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

vrj::test::Message Class Reference

#include <Message.h>

List of all members.

Public Methods

 Message ()
 Message (const std::string &shortDesc)
 Message (const std::string &shortDesc, const std::string &detail1)
 Message (const std::string &shortDesc, const std::string &detail1, const std::string &detail2)
 Message (const std::string &shortDesc, const std::string &detail1, const std::string &detail2, const std::string &detail3)
std::string shortDesc ()
 Returns the short description. More...

std::string details () const
 Returns a string that represents a list of the detail strings. More...

void clearDetails ()
 Removes all detail strings. More...

std::vector< std::string > getDetails ()
 Return a list of the details. More...

void addDetail (const std::string &detail)
 Add a detail. More...

void addDetail (const std::string &detail1, const std::string &detail2)
 Add two details. More...

void addDetail (const std::string &detail1, const std::string &detail2, const std::string &detail3)
 Add three details. More...

void setShortDesc (const std::string &shortDesc)
 Set the short descriptio. More...


Constructor & Destructor Documentation

vrj::test::Message::Message   [inline]
 

Definition at line 52 of file Message.h.

00053   {;}

vrj::test::Message::Message const std::string &    shortDesc [inline, explicit]
 

Definition at line 55 of file Message.h.

References shortDesc.

00056       : mShortDesc(shortDesc)
00057   {
00058      mShortDesc = shortDesc;
00059   }

vrj::test::Message::Message const std::string &    shortDesc,
const std::string &    detail1
[inline]
 

Definition at line 61 of file Message.h.

References addDetail, and shortDesc.

00063       : mShortDesc(shortDesc)
00064   { addDetail(detail1); }

vrj::test::Message::Message const std::string &    shortDesc,
const std::string &    detail1,
const std::string &    detail2
[inline]
 

Definition at line 66 of file Message.h.

References addDetail, and shortDesc.

00069       : mShortDesc(shortDesc)
00070   { addDetail(detail1, detail2); }

vrj::test::Message::Message const std::string &    shortDesc,
const std::string &    detail1,
const std::string &    detail2,
const std::string &    detail3
[inline]
 

Definition at line 72 of file Message.h.

References addDetail, and shortDesc.

00076   : mShortDesc(shortDesc)
00077   { addDetail(detail1, detail2, detail3); }


Member Function Documentation

std::string vrj::test::Message::shortDesc   [inline]
 

Returns the short description.

Returns:
Short description.

Definition at line 82 of file Message.h.

Referenced by vrj::test::TestFailure::getFullDescription, Message, and setShortDesc.

00083   { return mShortDesc; }

std::string vrj::test::Message::details   const [inline]
 

Returns a string that represents a list of the detail strings.

Example:

 Message message( "not equal", "Expected: 3", "Actual: 7" );
 std::string details = message.details();
 // details contains:
 // "- Expected: 3\n- Actual: 7\n"  

Returns:
A string that is a concatenation of all the detail strings. Each detail string is prefixed with '- ' and suffixed with '
' before being concatenated to the other.

Definition at line 98 of file Message.h.

Referenced by vrj::test::TestFailure::getFullDescription.

00099   {
00100      std::stringstream oss;
00101 
00102      for(unsigned i=0;i<mDetails.size();i++)
00103         oss << "- " << mDetails[i] << "\n";
00104 
00105      return oss.str();
00106   }

void vrj::test::Message::clearDetails   [inline]
 

Removes all detail strings.

Definition at line 110 of file Message.h.

00111   {  mDetails.clear(); }

std::vector<std::string> vrj::test::Message::getDetails   [inline]
 

Return a list of the details.

Definition at line 114 of file Message.h.

00115   { return mDetails;}

void vrj::test::Message::addDetail const std::string &    detail [inline]
 

Add a detail.

Definition at line 118 of file Message.h.

Referenced by addDetail, and Message.

00119   { mDetails.push_back(detail); }

void vrj::test::Message::addDetail const std::string &    detail1,
const std::string &    detail2
[inline]
 

Add two details.

Definition at line 122 of file Message.h.

References addDetail.

00124   { addDetail(detail1); addDetail(detail2); }

void vrj::test::Message::addDetail const std::string &    detail1,
const std::string &    detail2,
const std::string &    detail3
[inline]
 

Add three details.

Definition at line 127 of file Message.h.

References addDetail.

00130   { addDetail(detail1); addDetail(detail2); addDetail(detail3); }

void vrj::test::Message::setShortDesc const std::string &    shortDesc [inline]
 

Set the short descriptio.

Definition at line 133 of file Message.h.

References shortDesc.

00134   { mShortDesc = shortDesc; }


The documentation for this class was generated from the following file:
Generated on Sun May 2 15:11:16 2004 for VR Juggler by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002