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

Method GetConfig

RedisStudio/Redis/RedisClient.cpp:261–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261bool RedisClient::GetConfig(TDicConfig& dicConfig)
262{
263 dicConfig.clear();
264 redisReply* reply = Command("CONFIG GET *");
265 if (!reply) return false;
266 if (reply->type != REDIS_REPLY_ARRAY)
267 {
268 freeReplyObject(reply);
269 return false;
270 }
271 std::size_t i = 0;
272 std::string configKey , configValue;
273 redisReply* tmpReply ;
274 while (i < reply->elements)
275 {
276 tmpReply = reply->element[i++];
277 configKey.assign(tmpReply->str, tmpReply->len);
278 tmpReply = reply->element[i++];
279 configValue.assign(tmpReply->str, tmpReply->len);
280 dicConfig.insert(std::make_pair(configKey, configValue));
281 }
282 freeReplyObject(reply);
283 return true;
284}
285
286bool RedisClient::SetConfig(const TDicConfig& dicConfig)
287{

Callers

nothing calls this directly

Calls 2

freeReplyObjectFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected