40 lines
950 B
C++
40 lines
950 B
C++
#ifndef NUT_FIELDPHRASE_QSTRING_H
|
|
#define NUT_FIELDPHRASE_QSTRING_H
|
|
|
|
#include <QtNut/defines.h>
|
|
#include <QtNut/abstractfieldphrase.h>
|
|
#include <QtNut/fieldphrase.h>
|
|
|
|
NUT_BEGIN_NAMESPACE
|
|
|
|
template<>
|
|
class FieldPhrase<QString> : public AbstractFieldPhrase
|
|
{
|
|
public:
|
|
FieldPhrase(const char *className, const char *s)
|
|
: AbstractFieldPhrase(className, s)
|
|
{}
|
|
|
|
ConditionalPhrase like(const QString &term)
|
|
{
|
|
return ConditionalPhrase(this, PhraseData::Like, term);
|
|
}
|
|
|
|
ConditionalPhrase contains(const QString &term)
|
|
{
|
|
return ConditionalPhrase(this,
|
|
PhraseData::Like,
|
|
QVariant(QStringLiteral("%") + term
|
|
+ QStringLiteral("%")));
|
|
}
|
|
|
|
AssignmentPhrase operator=(const QVariant &v)
|
|
{
|
|
return AssignmentPhrase(this, v);
|
|
}
|
|
};
|
|
|
|
NUT_END_NAMESPACE
|
|
|
|
#endif // NUT_FIELDPHRASE_QSTRING_H
|