forked from stanleyhsl/CRedisClient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRedisClientConnection.cpp
More file actions
55 lines (46 loc) · 944 Bytes
/
RedisClientConnection.cpp
File metadata and controls
55 lines (46 loc) · 944 Bytes
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
/**
* 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 )
{
Command cmd("PING");
return _getStatus(cmd, value);
}
bool CRedisClient::quit( )
{
Command cmd("QUIT");
string value;
return _getStatus(cmd, value);
}
bool CRedisClient::echo( const string &message , string &value )
{
Command cmd("ECHO");
cmd << message;
return _getString(cmd, value);
}
bool CRedisClient::auth( const string &password )
{
Command cmd("AUTH");
cmd << password;
string value;
return _getStatus(cmd, value);
}
bool CRedisClient::select( uint64_t index )
{
Command cmd("SELECT");
cmd << index;
string value;
return _getStatus(cmd, value);
}