6 #include <QSharedPointer> 7 #include <hiredis/read.h> 17 enum Type { Status, Error, Integer, Bulk, MultiBulk, Unknown };
26 QByteArray source()
const;
27 QString toRawString()
const;
30 bool isErrorMessage()
const;
31 bool isErrorStateMessage()
const;
32 bool isDisabledCommandErrorMessage()
const;
33 bool isOkMessage()
const;
35 bool isMessage()
const;
37 bool hasUnusedBuffer()
const;
40 QByteArray getChannel()
const;
43 bool isAskRedirect()
const;
44 bool isMovedRedirect()
const;
45 QByteArray getRedirectionHost()
const;
46 uint getRedirectionPort()
const;
49 void setSource(
const QByteArray&);
50 void appendToSource(
const QByteArray&);
51 QByteArray getUnusedBuffer();
54 static QString valueToHumanReadString(
const QVariant&,
int indentLevel=0);
57 Type getResponseType(
const QByteArray&)
const;
58 Type getResponseType(
const char)
const;
61 void feed(
const QByteArray &buffer);
64 QByteArray m_responseSource;
65 QSharedPointer<redisReader> m_redisReader;
66 QSharedPointer<QVariant> m_result;
72 static void *createStringObject(
const redisReadTask *task,
char *str,
size_t len);
73 static void *createArrayObject(
const redisReadTask *t,
int elements);
74 static void *createIntegerObject(
const redisReadTask *task,
long long value);
75 static void *createNilObject(
const redisReadTask *task);
76 static void freeObject(
void *obj);
78 static const redisReplyObjectFunctions defaultFunctions;
80 static redisReader *redisReaderCreate(
void)
82 return redisReaderCreateWithFunctions(const_cast<redisReplyObjectFunctions*>(&defaultFunctions));
87 Q_DECLARE_METATYPE(QVector<QVariant*>)
Definition: response.h:12