2015-01-20 00:10:17 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
#include "acl_cpp/acl_cpp_define.hpp"
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "acl_cpp/stdlib/string.hpp"
|
|
|
|
|
#include "acl_cpp/redis/redis_command.hpp"
|
|
|
|
|
|
|
|
|
|
namespace acl
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
class redis_client;
|
|
|
|
|
|
|
|
|
|
class ACL_CPP_API redis_set : public redis_command
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
redis_set(redis_client* conn = NULL);
|
|
|
|
|
~redis_set();
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> member Ԫ<EFBFBD>ؼ<EFBFBD><EFBFBD>뵽<EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><EFBFBD>ϵ<EFBFBD> member Ԫ<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
|
|
|
|
* 1) <EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> member Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* 2) <EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
* @param first_member {const char*} <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> NULL <EFBFBD>ij<EFBFBD>Ա
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>Ԫ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2015-01-20 00:10:17 +08:00
|
|
|
|
int sadd(const char* key, const char* first_member, ...);
|
|
|
|
|
int sadd(const char* key, const std::vector<const char*>& memsbers);
|
|
|
|
|
int sadd(const char* key, const std::vector<string>& members);
|
|
|
|
|
int sadd(const char* key, const char* argv[], size_t argc);
|
|
|
|
|
int sadd(const char* key, const char* argv[], const size_t lens[],
|
|
|
|
|
size_t argc);
|
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>Ӽ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա
|
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
* @param buf {string&} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD><EFBFBD>ij<EFBFBD>Ա
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD> key <EFBFBD>ǿռ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> false
|
|
|
|
|
*/
|
2015-01-20 00:10:17 +08:00
|
|
|
|
bool spop(const char* key, string& buf);
|
2015-01-29 00:38:29 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>г<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD>ظü<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>г<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
|
|
|
|
* -1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* 0<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ջ<EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* >0<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
*/
|
2015-01-20 00:10:17 +08:00
|
|
|
|
int scard(const char* key);
|
2015-01-29 00:38:29 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD> key <EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>г<EFBFBD>Ա
|
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ֵ
|
|
|
|
|
* @param members {std::vector<string>&} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1 <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> key <EFBFBD>Ǽ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2015-01-20 00:10:17 +08:00
|
|
|
|
int smembers(const char* key, std::vector<string>& members);
|
2015-01-29 00:38:29 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD> member Ԫ<EFBFBD>ش<EFBFBD> src <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><EFBFBD><EFBFBD> dst <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param src {const char*} Դ<EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ֵ
|
|
|
|
|
* @param dst {const char*} Ŀ<EFBFBD>꼯<EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ֵ
|
|
|
|
|
* @param member {const char*} Դ<EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD>Ա
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
|
|
|
|
* -1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ/Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* 0<EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* 1<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>н<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>ƶ<EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2015-01-20 00:10:17 +08:00
|
|
|
|
int smove(const char* src, const char* dst, const char* member);
|
|
|
|
|
int smove(const char* src, const char* dst, const string& member);
|
|
|
|
|
int smove(const char* src, const char* dst,
|
|
|
|
|
const char* member, size_t len);
|
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><EFBFBD><EFBFBD>IJ
|
|
|
|
|
* @param members {std::vector<string>&} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param first_key {const char*} <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ǿյļ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD> key
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1 <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> key <EFBFBD>Ǽ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2015-01-21 23:39:02 +08:00
|
|
|
|
int sdiff(std::vector<string>& members, const char* first_key, ...);
|
|
|
|
|
int sdiff(const std::vector<const char*>& keys,
|
|
|
|
|
std::vector<string>& members);
|
|
|
|
|
int sdiff(const std::vector<string>& keys,
|
|
|
|
|
std::vector<string>& members);
|
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵĽ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param members {std::vector<string>&} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param first_key {const char*} <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD> key<EFBFBD><EFBFBD><EFBFBD><EFBFBD>NULL<EFBFBD><EFBFBD>
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1 <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> key <EFBFBD>Ǽ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2015-01-20 00:10:17 +08:00
|
|
|
|
int sinter(std::vector<string>& members, const char* first_key, ...);
|
|
|
|
|
int sinter(const std::vector<const char*>& keys,
|
|
|
|
|
std::vector<string>& members);
|
|
|
|
|
int sinter(const std::vector<string>& keys,
|
|
|
|
|
std::vector<string>& members);
|
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵIJ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param members {std::vector<string>&} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param first_key {const char*} <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD> key<EFBFBD><EFBFBD><EFBFBD><EFBFBD>NULL<EFBFBD><EFBFBD>
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1 <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> key <EFBFBD>Ǽ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2015-01-21 23:39:02 +08:00
|
|
|
|
int sunion(std::vector<string>& members, const char* first_key, ...);
|
|
|
|
|
int sunion(const std::vector<const char*>& keys,
|
2015-01-20 00:10:17 +08:00
|
|
|
|
std::vector<string>& members);
|
2015-01-21 23:39:02 +08:00
|
|
|
|
int sunion(const std::vector<string>& keys,
|
2015-01-20 00:10:17 +08:00
|
|
|
|
std::vector<string>& members);
|
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD> SDIFF <EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>浽 dst <EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽط<EFBFBD><EFBFBD>ؽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param dst {const char*} Ŀ<EFBFBD>꼯<EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @param first_key {const char*} <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ǿյļ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еij<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2015-01-20 00:10:17 +08:00
|
|
|
|
int sdiffstore(const char* dst, const char* first_key, ...);
|
|
|
|
|
int sdiffstore(const char* dst, const std::vector<const char*>& keys);
|
|
|
|
|
int sdiffstore(const char* dst, const std::vector<string>& keys);
|
2015-01-21 23:39:02 +08:00
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SINTER <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>浽 dst <EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽط<EFBFBD><EFBFBD>ؽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param dst {const char*} Ŀ<EFBFBD>꼯<EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @param first_key {const char*} <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ǿյļ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еij<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2015-01-21 23:39:02 +08:00
|
|
|
|
int sinterstore(const char* dst, const char* first_key, ...);
|
|
|
|
|
int sinterstore(const char* dst, const std::vector<const char*>& keys);
|
|
|
|
|
int sinterstore(const char* dst, const std::vector<string>& keys);
|
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SUNION <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>浽 dst <EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽط<EFBFBD><EFBFBD>ؽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param dst {const char*} Ŀ<EFBFBD>꼯<EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @param first_key {const char*} <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ǿյļ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еij<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2015-01-21 23:39:02 +08:00
|
|
|
|
int sunionstore(const char* dst, const char* first_key, ...);
|
|
|
|
|
int sunionstore(const char* dst, const std::vector<const char*>& keys);
|
|
|
|
|
int sunionstore(const char* dst, const std::vector<string>& keys);
|
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>ж<EFBFBD> member Ԫ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD> key <EFBFBD>ij<EFBFBD>Ա
|
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ֵ
|
|
|
|
|
* @param member {const char*} <EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԱԪ<EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> true <EFBFBD><EFBFBD>ʾ<EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD>Ǽ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2015-01-21 23:39:02 +08:00
|
|
|
|
bool sismember(const char* key, const char* member);
|
|
|
|
|
bool sismember(const char* key, const char* member, size_t len);
|
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ֻ<EFBFBD>ṩ<EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD>أ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱָ<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᷵<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ø<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƵĽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ֵ
|
|
|
|
|
* @param out <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ -1 <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0 <EFBFBD><EFBFBD>ʾû<EFBFBD>г<EFBFBD>Ա
|
|
|
|
|
*/
|
2015-01-21 23:39:02 +08:00
|
|
|
|
int srandmember(const char* key, string& out);
|
|
|
|
|
int srandmember(const char* key, size_t n, std::vector<string>& out);
|
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>Ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD>е<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> member Ԫ<EFBFBD>أ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD> member Ԫ<EFBFBD>ػᱻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ֵ
|
|
|
|
|
* @param first_member {const char*} <EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD><EFBFBD>ij<EFBFBD>Ա<EFBFBD>б<EFBFBD><EFBFBD>ĵ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> NULL<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD>ڱ<EFBFBD><EFBFBD>ε<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д NULL
|
|
|
|
|
* @retur {int} <EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD><EFBFBD>ij<EFBFBD>ԱԪ<EFBFBD>صĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><EFBFBD>϶<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1<EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0
|
|
|
|
|
*/
|
2015-01-21 23:39:02 +08:00
|
|
|
|
int srem(const char* key, const char* first_member, ...);
|
|
|
|
|
int srem(const char* key, const std::vector<string>& members);
|
|
|
|
|
int srem(const char* key, const std::vector<const char*>& members);
|
|
|
|
|
int srem(const char* key, const char* members[],
|
|
|
|
|
size_t lens[], size_t argc);
|
2015-01-23 17:23:04 +08:00
|
|
|
|
|
2015-01-29 00:38:29 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @param cursor {int} <EFBFBD>α<EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ֵд 0
|
|
|
|
|
* @param out {std::vector<string>&} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param pattern {const char*} ƥ<EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD>glob <EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>ʱ<EFBFBD><EFBFBD>Ч
|
|
|
|
|
* @param count {const size_t*} <EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>ָ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>Ч
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>α<EFBFBD>λ<EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
|
|
|
|
* 0<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* -1: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* >0: <EFBFBD>α<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2015-01-23 17:23:04 +08:00
|
|
|
|
int sscan(const char* key, int cursor, std::vector<string>& out,
|
|
|
|
|
const char* pattern = NULL, const size_t* count = NULL);
|
2015-01-20 00:10:17 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace acl
|