| 549 | } |
| 550 | |
| 551 | int redis_command::get_status(std::vector<bool>& out) |
| 552 | { |
| 553 | out.clear(); |
| 554 | |
| 555 | const redis_result* result = run(); |
| 556 | if (result == NULL || result->get_type() != REDIS_RESULT_ARRAY) { |
| 557 | logger_result(result); |
| 558 | return -1; |
| 559 | } |
| 560 | |
| 561 | size_t size; |
| 562 | const redis_result** children = result->get_children(&size); |
| 563 | if (children == NULL || size == 0) { |
| 564 | return 0; |
| 565 | } |
| 566 | |
| 567 | out.reserve(size); |
| 568 | |
| 569 | const redis_result* rr; |
| 570 | for (size_t i = 0; i < size; i++) { |
| 571 | rr = children[i]; |
| 572 | out.push_back(rr->get_integer() > 0 ? true : false); |
| 573 | } |
| 574 | |
| 575 | return (int) size; |
| 576 | } |
| 577 | |
| 578 | const char* redis_command::get_status() |
| 579 | { |
no test coverage detected