forked from RedisCppTeam/redis-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRedisClientConnection.cpp
62 lines (53 loc) · 1022 Bytes
/
RedisClientConnection.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* Copyright (c) 2015, 爱wifi(版权声明)
*
* @file RedisClientCommon.cpp
* @brief 此文件的简单描述。(必填字段)
*
* 此文件的详细功能描述。(可选字段)
*
* @author: cj
* @date: Aug 11, 2015
*
* 修订说明:初始版本
*/
#include"Command.h"
#include"CRedisClient.h"
bool CRedisClient::ping( string &value )
{
try
{
Command cmd("PING");
_getStatus(cmd, value);
return true;
}catch( ... )
{
return false;
}
}
void CRedisClient::quit( )
{
Command cmd("QUIT");
string value;
_getStatus(cmd, value);
}
void CRedisClient::echo( const string &message , string &value )
{
Command cmd("ECHO");
cmd << message;
_getString(cmd, value);
}
void CRedisClient::auth( const string &password )
{
Command cmd("AUTH");
cmd << password;
string value;
_getStatus(cmd, value);
}
void CRedisClient::select( uint64_t index )
{
Command cmd("SELECT");
cmd << index;
string value;
_getStatus(cmd, value);
}