39 lines
852 B
C
39 lines
852 B
C
|
|
#ifndef NUT_FIELDPHRASE_BOOL_H
|
||
|
|
#define NUT_FIELDPHRASE_BOOL_H
|
||
|
|
|
||
|
|
#include <QtNut/defines.h>
|
||
|
|
#include <QtNut/fieldphrase.h>
|
||
|
|
#include <QtNut/fieldphrase.h>
|
||
|
|
|
||
|
|
NUT_BEGIN_NAMESPACE
|
||
|
|
|
||
|
|
template<>
|
||
|
|
class FieldPhrase<bool> : public AbstractFieldPhrase
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
FieldPhrase(const char *className, const char *s) :
|
||
|
|
AbstractFieldPhrase(className, s)
|
||
|
|
{}
|
||
|
|
|
||
|
|
AssignmentPhrase operator =(const bool &other) {
|
||
|
|
return AssignmentPhrase(this, other);
|
||
|
|
}
|
||
|
|
|
||
|
|
FieldPhrase<bool> operator !()
|
||
|
|
{
|
||
|
|
FieldPhrase<bool> f(data->className, data->fieldName);
|
||
|
|
// f.data = new PhraseData(data);
|
||
|
|
f.data->isNot = !data->isNot;
|
||
|
|
return f;
|
||
|
|
}
|
||
|
|
|
||
|
|
operator ConditionalPhrase()
|
||
|
|
{
|
||
|
|
return ConditionalPhrase(this, PhraseData::Equal, !data->isNot);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
NUT_END_NAMESPACE
|
||
|
|
|
||
|
|
#endif // NUT_FIELDPHRASE_BOOL_H
|