MCPcopy Create free account
hub / github.com/cc20110101/RedisView / smembers

Method smembers

src/RedisView/RedisLib/RedisClient.cpp:3998–4028  ·  view source on GitHub ↗

* 返回集合key中的所有成员。不存在的key被视为空集合。 * @param[in] key 集合键 * @param[out] value 集合元素值 * @param[out] llRet 集合个数 * @return 成功true,失败false * @see * @note */

Source from the content-addressed store, hash-verified

3996 * @note
3997 */
3998bool RedisClient::smembers(const QString & key, QList<QByteArray> & value, int & iRet) {
3999 _sErrorInfo.clear();
4000 if(key.trimmed().isEmpty()) {
4001 _sErrorInfo = "key is empty";
4002 return false;
4003 }
4004
4005 _vCmdList.clear();
4006 _vCmdList.push_back("SMEMBERS");
4007 _vCmdList.push_back(key);
4008
4009 _cmdResult = command(_vCmdList);
4010 if(_cmdResult[0] == '-') {
4011 if(parseRespError(_cmdResult,_sValue))
4012 _sErrorInfo = _sValue;
4013 else
4014 _sErrorInfo = "parser resp error info failed";
4015 _bRet = false;
4016 } else if(_cmdResult[0] == '*') {
4017 if(parseRespSingelArray(_cmdResult,value, iRet)) {
4018 _bRet = true;
4019 } else {
4020 _sErrorInfo = "parser resp single array info failed";
4021 _bRet = false;
4022 }
4023 } else {
4024 _bRet = false;
4025 _sErrorInfo = QString("parser resp type failed:") + _cmdResult[0];
4026 }
4027 return _bRet;
4028}
4029
4030/**
4031 * 给定一个或多个脚本的SHA1校验和,返回一个包含0和1的列表,表示校验和所指定的脚本是否已经被保存在缓存当中

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected