| 351 | } |
| 352 | |
| 353 | butil::Status RedisCommandByComponents(butil::IOBuf* output, |
| 354 | const butil::StringPiece* components, |
| 355 | size_t ncomponents) { |
| 356 | if (output == NULL) { |
| 357 | return butil::Status(EINVAL, "Param[output] is NULL"); |
| 358 | } |
| 359 | AppendHeader(*output, '*', ncomponents); |
| 360 | for (size_t i = 0; i < ncomponents; ++i) { |
| 361 | AppendHeader(*output, '$', components[i].size()); |
| 362 | output->append(components[i].data(), components[i].size()); |
| 363 | output->append("\r\n", 2); |
| 364 | } |
| 365 | return butil::Status::OK(); |
| 366 | } |
| 367 | |
| 368 | RedisCommandParser::RedisCommandParser() |
| 369 | : _parsing_array(false) |
no test coverage detected