bool xRedisClient::set(const RedisDBIdx& dbi, const string& key, const char *value, int len, int second) { SETDEFAULTIOTYPE(MASTER); if (0==second) { return command_bool(dbi, "set %s %b", key.c_str(), value, len); } else { return command_bool(dbi, "set %s %b EX %d", key.c_str(), value, len, second); } }
bool xRedisClient::smove(const RedisDBIdx& dbi, const KEY& srckey, const KEY& deskey, const VALUE& member) { if (0 == srckey.length()) { return false; } SETDEFAULTIOTYPE(MASTER); return command_bool(dbi, "SMOVE %s", srckey.c_str(), deskey.c_str(), member.c_str()); }
bool xRedisClient::smove(const RedisDBIdx& dbi, const KEY& srckey, const KEY& deskey, const VALUE& member) { return command_bool(dbi, "SMOVE %s", srckey.c_str(), deskey.c_str(), member.c_str()); }
bool xRedisClient::sismember(const RedisDBIdx& dbi, const KEY& key, const VALUE& member) { return command_bool(dbi, "SISMEMBER %s %s", key.c_str(), member.c_str()); }
bool CRedisClient::auth(const CString &pass, bool &bRetVal) { return command_bool(bRetVal, "AUTH %s", (LPCSTR)pass); }
bool CRedisClient::sismember(const CString &key, const CString &member, bool &bRetVal) { return command_bool(bRetVal, "SISMEMBER %s %s", (LPCSTR)key, (LPCSTR)member); }
bool CRedisClient::hexists(const CString &key, const CString &field, bool &bRetVal) { return command_bool(bRetVal, "HEXISTS %s %s", (LPCSTR)key, (LPCSTR)field); }
bool CRedisClient::exists(const CString &key, bool &bRetVal) { return command_bool(bRetVal, "EXISTS %s", (LPCSTR)key); }
bool xRedisClient::hexist(const RedisDBIdx& dbi, const string& key, const string& field){ SETDEFAULTIOTYPE(SLAVE); return command_bool(dbi,"HEXISTS %s %s", key.c_str(), field.c_str()); }
bool xRedisClient::hsetnx(const RedisDBIdx& dbi, const string& key, const string& field, const string& value){ SETDEFAULTIOTYPE(MASTER); return command_bool(dbi, "HSETNX %s %s %s", key.c_str(), field.c_str(), value.c_str()); }
bool xRedisClient::auth(const RedisDBIdx& dbi, const string& pass){ return command_bool(dbi, "AUTH %s", pass.c_str()); }
bool xRedisClient::psetex(const RedisDBIdx& dbi, const string& key, int milliseconds, const string& value) { SETDEFAULTIOTYPE(MASTER); return command_bool(dbi, "PSETEX %s %d %s", key.c_str(), milliseconds, value.c_str()); }