![]() | cpp_redis 4.0.0 cpp_redis is a C++11 Asynchronous Multi-Platform Lightweight Redis Client, with support for synchronous operations and pipelining. |
#include <reply.hpp>
Public Types | |
enum | type { error = __CPP_REDIS_REPLY_ERR,bulk_string = __CPP_REDIS_REPLY_BULK,simple_string = __CPP_REDIS_REPLY_SIMPLE,null = __CPP_REDIS_REPLY_NULL, integer = __CPP_REDIS_REPLY_INT,array = __CPP_REDIS_REPLY_ARRAY } |
enum | string_type {error = __CPP_REDIS_REPLY_ERR,bulk_string = __CPP_REDIS_REPLY_BULK,simple_string = __CPP_REDIS_REPLY_SIMPLE } |
Public Member Functions | |
reply (void) | |
reply (const std::string &value,string_type reply_type) | |
reply (int64_t value) | |
reply (const std::vector<reply > &rows) | |
~reply (void)=default | |
dtor | |
reply (constreply &)=default | |
copy ctor | |
reply & | operator= (constreply &)=default |
assignment operator | |
bool | is_array (void) const |
bool | is_string (void) const |
bool | is_simple_string (void) const |
bool | is_bulk_string (void) const |
bool | is_error (void) const |
bool | is_integer (void) const |
bool | is_null (void) const |
bool | ok (void) const |
bool | ko (void) const |
operator bool (void) const | |
const std::string & | error (void) const |
const std::vector<reply > & | as_array (void) const |
const std::string & | as_string (void) const |
int64_t | as_integer (void) const |
void | set (void) |
void | set (const std::string &value,string_type reply_type) |
void | set (int64_t value) |
void | set (const std::vector<reply > &rows) |
reply & | operator<< (constreply &reply) |
type | get_type (void) const |
cpp_redis::reply is the class that wraps Redis server replies. That is,cpp_redis::reply objects are passed as parameters of commands callbacks and contain the server's response.
| strong |
specific type of replies for string-based replies
| strong |
type of reply, baed on redis server standard replies
cpp_redis::reply::reply | ( | void | ) |
default ctor (set a null reply)
cpp_redis::reply::reply | ( | const std::string & | value, |
string_type | reply_type | ||
) |
ctor for string values
value | string value |
reply_type | of string reply |
cpp_redis::reply::reply | ( | int64_t | value | ) |
ctor for int values
value | integer value |
cpp_redis::reply::reply | ( | const std::vector<reply > & | rows | ) |
ctor for array values
rows | array reply |
const std::vector<reply>& cpp_redis::reply::as_array | ( | void | ) | const |
int64_t cpp_redis::reply::as_integer | ( | void | ) | const |
const std::string& cpp_redis::reply::as_string | ( | void | ) | const |
const std::string& cpp_redis::reply::error | ( | void | ) | const |
type cpp_redis::reply::get_type | ( | void | ) | const |
bool cpp_redis::reply::is_array | ( | void | ) | const |
bool cpp_redis::reply::is_bulk_string | ( | void | ) | const |
bool cpp_redis::reply::is_error | ( | void | ) | const |
bool cpp_redis::reply::is_integer | ( | void | ) | const |
bool cpp_redis::reply::is_null | ( | void | ) | const |
bool cpp_redis::reply::is_simple_string | ( | void | ) | const |
bool cpp_redis::reply::is_string | ( | void | ) | const |
bool cpp_redis::reply::ko | ( | void | ) | const |
bool cpp_redis::reply::ok | ( | void | ) | const |
cpp_redis::reply::operator bool | ( | void | ) | const |
convenience implicit conversion, same as !is_null() /ok()
for array replies, add a new row to the reply
reply | new row to be appended |
void cpp_redis::reply::set | ( | void | ) |
set reply as null
void cpp_redis::reply::set | ( | const std::string & | value, |
string_type | reply_type | ||
) |
set a string reply
value | string value |
reply_type | of string reply |
void cpp_redis::reply::set | ( | int64_t | value | ) |
set an integer reply
value | integer value |
void cpp_redis::reply::set | ( | const std::vector<reply > & | rows | ) |
set an array reply
rows | array reply |