Hamcrest-Qt  0.0.1
Hamcrest matchers for C++/Qt
 All Classes Namespaces Functions
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
HamcrestQt::SubstringMatcher Class Referenceabstract
Inheritance diagram for HamcrestQt::SubstringMatcher:
HamcrestQt::BaseMatcher< QString > HamcrestQt::Matcher< QString > HamcrestQt::SelfDescribing HamcrestQt::StringContains HamcrestQt::StringEndsWith HamcrestQt::StringStartsWith

Public Member Functions

virtual bool matches (const QString &item) const
 Evaluates the matcher for argument item. More...
 
virtual void describeTo (Description &description) const
 Generates a description of the object. More...
 
virtual void describeMismatch (const QString &item, Description &description) const
 Generate a description of why the matcher has not accepted the item. More...
 
- Public Member Functions inherited from HamcrestQt::BaseMatcher< QString >
virtual QString toString () const
 

Protected Member Functions

 SubstringMatcher (const QString &str)
 
virtual bool evalSubstringOf (const QString &str) const =0
 
virtual QString relationship () const =0
 

Protected Attributes

QString substring
 

Member Function Documentation

virtual void HamcrestQt::SubstringMatcher::describeMismatch ( const QString &  item,
Description mismatchDescription 
) const
inlinevirtual

Generate a description of why the matcher has not accepted the item.

The description will be part of a larger description of why a matching failed, so it should be concise. This method assumes that matches(item) is false, but will not check this.

Parameters
itemThe item that the Matcher has rejected.
mismatchDescriptionThe description to be built or appended to.

Reimplemented from HamcrestQt::BaseMatcher< QString >.

virtual void HamcrestQt::SubstringMatcher::describeTo ( Description description) const
inlinevirtual

Generates a description of the object.

The description may be part of a description of a larger object of which this is just a component, so it should be worded appropriately.

Parameters
descriptionThe description to be built or appended to.

Implements HamcrestQt::SelfDescribing.

virtual bool HamcrestQt::SubstringMatcher::matches ( const QString &  item) const
inlinevirtual

Evaluates the matcher for argument item.

Parameters
itemthe object against which the matcher is evaluated.
Returns
true if item matches, otherwise false.
See Also
BaseMatcher

Implements HamcrestQt::Matcher< QString >.


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