| 136 | } |
| 137 | |
| 138 | bool 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 | |
| 159 | bool RedisRespParser::parseRespBulkString(const QByteArray &data, QByteArray &sResult, int &iResult) { |
| 160 | if(data.isEmpty()) |
nothing calls this directly
no outgoing calls
no test coverage detected