Hamcrest-Qt  0.0.1
Hamcrest matchers for C++/Qt
 All Classes Namespaces Functions
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
HamcrestQt::StringDescription Class Reference

A Description that is stored as a string. More...

#include <stringdescription.h>

Inheritance diagram for HamcrestQt::StringDescription:
HamcrestQt::BaseDescription HamcrestQt::Description

Public Member Functions

virtual QString toString () const
 Returns the description as a string.
 
- Public Member Functions inherited from HamcrestQt::BaseDescription
virtual DescriptionappendText (const QString &text)
 Appends some plain text to the description.
 
virtual DescriptionappendDescriptionOf (const SelfDescribing &value)
 Appends the description of a SelfDescribing value to this description.
 
- Public Member Functions inherited from HamcrestQt::Description
template<typename T >
DescriptionappendValue (const T &value)
 Appends an arbitrary value to the description.
 
DescriptionappendValue (short value)
 
DescriptionappendValue (long value)
 
DescriptionappendValue (float value)
 
DescriptionappendValue (double value)
 
DescriptionappendValue (const char *value)
 
DescriptionappendValue (const QString &value)
 
DescriptionappendValue (char value)
 
DescriptionappendValue (const QChar &value)
 
template<typename Iterator >
DescriptionappendList (const QString &start, const QString &separator, const QString &end, Iterator startIterator, Iterator endIterator)
 Appends a list of SelfDescribing objects to the description.
 

Static Public Member Functions

static QString toString (const SelfDescribing &selfDescribing)
 Return the description of a SelfDescribing object as a QString. More...
 
static QString asString (const SelfDescribing &selfDescribing)
 Alias for toString(SelfDescribing).
 
- Static Public Member Functions inherited from HamcrestQt::Description
static DescriptionNONE ()
 

Protected Member Functions

virtual void appendString (const QString &str)
 Append the String str to the description. More...
 
virtual void append (const QChar &c)
 
- Protected Member Functions inherited from HamcrestQt::Description
virtual void toCppSyntaxString (const QString &unformatted)
 
virtual void toCppSyntax (const QChar &ch)
 

Detailed Description

A Description that is stored as a string.

Member Function Documentation

void HamcrestQt::StringDescription::appendString ( const QString &  str)
protectedvirtual

Append the String str to the description.

The default implementation passes every character to append(QChar). Override in subclasses to provide an efficient implementation.

Reimplemented from HamcrestQt::BaseDescription.

QString HamcrestQt::StringDescription::toString ( const SelfDescribing selfDescribing)
static

Return the description of a SelfDescribing object as a QString.

Parameters
selfDescribingThe object to be described.
Returns
The description of the object.

The documentation for this class was generated from the following files: