MCPcopy Create free account
hub / github.com/cinience/RedisStudio / GetData

Method GetData

RedisStudio/Redis/RedisSetModel.cpp:9–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7}
8
9bool RedisSetModel::GetData( const std::string& key, RedisResult& results )
10{
11 bool retVal = false;
12 redisReply* reply = GetClient()->Command("SMEMBERS %s", key.c_str());
13 if (!reply) return retVal;
14 results.NewColumn("Value");
15 if (reply->type == REDIS_REPLY_ARRAY)
16 {
17 std::size_t i = 0;
18 redisReply* tmpReply ;
19 while (i < reply->elements)
20 {
21 tmpReply = reply->element[i];
22 results.NewRow();
23 string& myvalue = results.Value(results.RowSize()-1, 0);
24 myvalue.assign(tmpReply->str, tmpReply->len);
25 i++;
26 }
27 retVal = true;
28
29 }
30 freeReplyObject(reply);
31 return retVal;
32}
33
34bool RedisSetModel::UpdateData( const std::string& key,
35 const std::string& oldValue,

Callers

nothing calls this directly

Calls 6

freeReplyObjectFunction · 0.85
CommandMethod · 0.80
NewColumnMethod · 0.80
NewRowMethod · 0.80
ValueMethod · 0.80
RowSizeMethod · 0.80

Tested by

no test coverage detected