Add scard

This commit is contained in:
fbraem
2015-11-14 20:41:12 +01:00
parent 36108e2378
commit d4a791d79c
4 changed files with 197 additions and 0 deletions

View File

@@ -245,6 +245,46 @@ Command Command::mset(const std::map<std::string, std::string>& keyvalues, bool
return cmd;
}
Command Command::sadd(const std::string& key, const std::string& value)
{
Command cmd("SADD");
cmd << key << value;
return cmd;
}
Command Command::sadd(const std::string& key, const std::vector<std::string>& values)
{
Command cmd("SADD");
cmd << key;
for(std::vector<std::string>::const_iterator it = values.begin(); it != values.end(); ++it)
{
cmd << *it;
}
return cmd;
}
Command Command::scard(const std::string& key)
{
Command cmd("SCARD");
cmd << key;
return cmd;
}
Command Command::smembers(const std::string& key)
{
Command cmd("SMEMBERS");
cmd << key;
return cmd;
}
Command Command::set(const std::string& key, const std::string& value, bool overwrite, const Poco::Timespan& expireTime, bool create)
{
Command cmd("SET");