remove some RedisValue constructors

This commit is contained in:
XieHan
2021-04-16 01:11:13 +08:00
parent e792473b80
commit 8aab9c50a6
2 changed files with 0 additions and 78 deletions

View File

@@ -31,66 +31,6 @@ typedef int64_t Rint;
typedef std::string Rstr;
typedef std::vector<RedisValue> Rarr;
RedisValue::RedisValue(int64_t intv):
type_(REDIS_REPLY_TYPE_INTEGER),
data_(new Rint(intv))
{
}
RedisValue::RedisValue(const char *str):
type_(REDIS_REPLY_TYPE_STRING),
data_(new Rstr(str))
{
}
RedisValue::RedisValue(const char *str, size_t len):
type_(REDIS_REPLY_TYPE_STRING),
data_(new Rstr(str, len))
{
}
RedisValue::RedisValue(const std::string& strv):
type_(REDIS_REPLY_TYPE_STRING),
data_(new Rstr(strv))
{
}
RedisValue::RedisValue(const char *str, StatusTag status_tag):
type_(REDIS_REPLY_TYPE_STATUS),
data_(new Rstr(str))
{
}
RedisValue::RedisValue(const char *str, size_t len, StatusTag status_tag):
type_(REDIS_REPLY_TYPE_STATUS),
data_(new Rstr(str, len))
{
}
RedisValue::RedisValue(const std::string& strv, StatusTag status_tag):
type_(REDIS_REPLY_TYPE_STATUS),
data_(new Rstr(strv))
{
}
RedisValue::RedisValue(const char *str, ErrorTag error_tag):
type_(REDIS_REPLY_TYPE_ERROR),
data_(new Rstr(str))
{
}
RedisValue::RedisValue(const char *str, size_t len, ErrorTag error_tag):
type_(REDIS_REPLY_TYPE_ERROR),
data_(new Rstr(str, len))
{
}
RedisValue::RedisValue(const std::string& strv, ErrorTag error_tag):
type_(REDIS_REPLY_TYPE_ERROR),
data_(new Rstr(strv))
{
}
RedisValue& RedisValue::operator= (const RedisValue& copy)
{
if (this != &copy)

View File

@@ -107,24 +107,6 @@ public:
// format data to text
std::string debug_string() const;
public:
struct StatusTag {};
struct ErrorTag {};
// integer
RedisValue(int64_t intv);
// string
RedisValue(const char *str);
RedisValue(const char *str, size_t len);
RedisValue(const std::string& strv);
// status
RedisValue(const char *str, StatusTag status_tag);
RedisValue(const char *str, size_t len, StatusTag status_tag);
RedisValue(const std::string& strv, StatusTag status_tag);
// error
RedisValue(const char *str, ErrorTag error_tag);
RedisValue(const char *str, size_t len, ErrorTag error_tag);
RedisValue(const std::string& strv, ErrorTag error_tag);
private:
void free_data();
void only_set_string_data(const std::string& strv);