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

Method parseRespBulkString

src/RedisView/RedisLib/RedisRespParser.cpp:138–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138bool RedisRespParser::parseRespBulkString(const QByteArray &data, QString &sResult, int &iResult) {
139 if(data.isEmpty())
140 return false;
141
142 if (data.at(0) == '$')
143 {
144 int index = data.indexOf("\r\n");
145 iResult = data.mid(1, index - 1).toInt();
146 if (iResult > 0) {
147 sResult = data.mid(index + 2, iResult);
148 } else if(iResult == 0) {
149 sResult = "";
150 } else if(iResult == -1) {
151 sResult = "nil";
152 }
153 } else
154 return false;
155
156 return true;
157}
158
159bool RedisRespParser::parseRespBulkString(const QByteArray &data, QByteArray &sResult, int &iResult) {
160 if(data.isEmpty())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected