| 7 | } |
| 8 | |
| 9 | bool RedisStringModel::GetData( const std::string& key, RedisResult& results ) |
| 10 | { |
| 11 | bool retVal = false; |
| 12 | redisReply* reply = GetClient()->Command("GET %s", key.c_str()); |
| 13 | if (!reply) return retVal; |
| 14 | results.NewColumn("Value"); |
| 15 | if (reply->type == REDIS_REPLY_STRING) |
| 16 | { |
| 17 | results.NewRow(); |
| 18 | string& myvalue = results.Value(results.RowSize()-1, 0); |
| 19 | myvalue.assign(reply->str, reply->len); |
| 20 | retVal = true; |
| 21 | } |
| 22 | freeReplyObject(reply); |
| 23 | return retVal; |
| 24 | } |
| 25 | |
| 26 | bool RedisStringModel::UpdateData( const std::string& key, |
| 27 | const std::string& oldValue, |