2019-02-26 17:47:08 +08:00
|
|
|
#ifndef ABSTRACTFIELDPHRASE_H
|
|
|
|
|
#define ABSTRACTFIELDPHRASE_H
|
|
|
|
|
|
|
|
|
|
#include "../defines.h"
|
|
|
|
|
|
|
|
|
|
#include "assignmentphrase.h"
|
|
|
|
|
#include "conditionalphrase.h"
|
|
|
|
|
#include "phraselist.h"
|
|
|
|
|
|
|
|
|
|
NUT_BEGIN_NAMESPACE
|
|
|
|
|
|
|
|
|
|
class PhraseData;
|
2019-02-27 00:07:14 +08:00
|
|
|
class NUT_EXPORT AbstractFieldPhrase
|
2019-02-26 17:47:08 +08:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
PhraseData *data;
|
|
|
|
|
explicit AbstractFieldPhrase(PhraseData *d);
|
|
|
|
|
AbstractFieldPhrase(const char *className, const char *fieldName);
|
|
|
|
|
AbstractFieldPhrase(const AbstractFieldPhrase &other);
|
|
|
|
|
AbstractFieldPhrase(AbstractFieldPhrase &&other);
|
|
|
|
|
|
|
|
|
|
virtual ~AbstractFieldPhrase();
|
|
|
|
|
|
|
|
|
|
PhraseList operator |(const AbstractFieldPhrase &other);
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
|
ConditionalPhrase in(QList<T> list)
|
|
|
|
|
{
|
|
|
|
|
QVariantList vlist;
|
|
|
|
|
foreach (T t, list)
|
|
|
|
|
vlist.append(QVariant::fromValue(t));
|
|
|
|
|
|
|
|
|
|
return ConditionalPhrase(this, PhraseData::In, vlist);
|
|
|
|
|
}
|
|
|
|
|
#ifdef Q_COMPILER_INITIALIZER_LISTS
|
|
|
|
|
ConditionalPhrase in(std::initializer_list<int> list) {
|
|
|
|
|
QVariantList vlist;
|
|
|
|
|
std::initializer_list<int>::iterator it;
|
|
|
|
|
for (it = list.begin(); it != list.end(); ++it)
|
|
|
|
|
vlist.append(*it);
|
|
|
|
|
return ConditionalPhrase(this, PhraseData::In, vlist);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
ConditionalPhrase isNull();
|
|
|
|
|
|
|
|
|
|
ConditionalPhrase operator ==(const QVariant &other);
|
|
|
|
|
ConditionalPhrase operator ==(const ConditionalPhrase &other);
|
|
|
|
|
//why?
|
|
|
|
|
ConditionalPhrase operator !=(const QVariant &other);
|
|
|
|
|
|
|
|
|
|
ConditionalPhrase operator ==(const AbstractFieldPhrase &other);
|
|
|
|
|
ConditionalPhrase operator !=(const AbstractFieldPhrase &other);
|
|
|
|
|
ConditionalPhrase operator <(const AbstractFieldPhrase &other);
|
|
|
|
|
ConditionalPhrase operator >(const AbstractFieldPhrase &other);
|
|
|
|
|
ConditionalPhrase operator <=(const AbstractFieldPhrase &other);
|
|
|
|
|
ConditionalPhrase operator >=(const AbstractFieldPhrase &other);
|
|
|
|
|
|
2019-02-27 04:08:31 +08:00
|
|
|
AbstractFieldPhrase operator ~();
|
2019-02-26 17:47:08 +08:00
|
|
|
AssignmentPhrase operator =(const QVariant &other);
|
|
|
|
|
AssignmentPhrase operator =(const ConditionalPhrase &other);
|
|
|
|
|
AssignmentPhrase operator <<(const QVariant &other);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
NUT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
#endif // ABSTRACTFIELDPHRASE_H
|