Hamcrest-Qt  0.0.1
Hamcrest matchers for C++/Qt
 All Classes Namespaces Functions
stringdescription.h
1 #ifndef HAMCRESTQT_STRINGDESCRIPTION_H
2 #define HAMCRESTQT_STRINGDESCRIPTION_H
3 
4 #include "basedescription.h"
5 
6 namespace HamcrestQt {
7 
8 class SelfDescribing;
9 
14 {
15 public:
17 
21  virtual QString toString() const;
22 
31  static QString toString(const SelfDescribing &selfDescribing);
32 
36  static QString asString(const SelfDescribing &selfDescribing);
37 
38 protected:
39  virtual void appendString(const QString &str);
40  virtual void append(const QChar &c);
41 
42 private:
43  QString out;
44 };
45 
46 } // namespace HamcrestQt
47 
48 #endif // HAMCRESTQT_STRINGDESCRIPTION_H
static QString asString(const SelfDescribing &selfDescribing)
Alias for toString(SelfDescribing).
Definition: stringdescription.cpp:22
virtual QString toString() const
Returns the description as a string.
Definition: stringdescription.cpp:11
virtual void appendString(const QString &str)
Append the String str to the description.
Definition: stringdescription.cpp:27
A Description that is stored as a string.
Definition: stringdescription.h:13
A Description that is stored as a string.
Definition: basedescription.h:12
The ability of an object to describe itself.
Definition: selfdescribing.h:11