MCPcopy Create free account
hub / github.com/cc20110101/RedisView / packRespCmd

Method packRespCmd

src/RedisView/RedisLib/RedisRespParser.cpp:18–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18bool RedisRespParser::packRespCmd(const QList<QString> &vInCmd, QByteArray &sOutRespCmd) {
19 if(vInCmd.isEmpty())
20 return false;
21
22 sOutRespCmd.clear();
23 sOutRespCmd.append("*");
24 sOutRespCmd.append(QByteArray::number(vInCmd.size()));
25 sOutRespCmd.append("\r\n");
26 for (int i = 0; i < vInCmd.size(); ++i)
27 {
28 sOutRespCmd.append("$");
29 sOutRespCmd.append(QByteArray::number(vInCmd[i].toLocal8Bit().length()));
30 sOutRespCmd.append("\r\n");
31 sOutRespCmd.append(vInCmd[i].toLocal8Bit());
32 sOutRespCmd.append("\r\n");
33 }
34 return true;
35}
36
37bool RedisRespParser::packRespCmd(const QString &sInCmd, QByteArray &sOutRespCmd)
38{

Callers

nothing calls this directly

Calls 2

appendMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected