1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-07-17 16:34:10 +00:00

Move *scan function from Command to IncRedis.

Pass down IncRedis as required to fix the build.
This commit is contained in:
King_DuckZ 2016-07-12 10:55:45 +01:00
parent d0242e2721
commit 64b87c52bb
11 changed files with 82 additions and 82 deletions

View file

@ -19,14 +19,26 @@
#define id7D338900114548A890B1EECE0C4D3C4C
#include "command.hpp"
#include "scan_iterator.hpp"
#include <boost/optional.hpp>
#include <string>
#include <boost/utility/string_ref.hpp>
#include <vector>
#include <boost/range/iterator_range_core.hpp>
#include <boost/range/empty.hpp>
namespace redis {
class IncRedis {
public:
typedef ScanIterator<ScanSingleValues<std::string>> scan_iterator;
typedef boost::iterator_range<scan_iterator> scan_range;
typedef ScanIterator<ScanPairs<std::pair<std::string, std::string>, ScanCommands::HSCAN>> hscan_iterator;
typedef boost::iterator_range<hscan_iterator> hscan_range;
typedef ScanIterator<ScanSingleValuesInKey<std::string>> sscan_iterator;
typedef boost::iterator_range<sscan_iterator> sscan_range;
typedef ScanIterator<ScanPairs<std::pair<std::string, std::string>, ScanCommands::ZSCAN>> zscan_iterator;
typedef boost::iterator_range<zscan_iterator> zscan_range;
typedef boost::optional<std::string> opt_string;
typedef boost::optional<std::vector<opt_string>> opt_string_list;
@ -43,6 +55,12 @@ namespace redis {
Command& command ( void ) { return m_command; }
const Command& command ( void ) const { return m_command; }
//Scan
scan_range scan ( boost::string_ref parPattern=boost::string_ref() );
hscan_range hscan ( boost::string_ref parKey, boost::string_ref parPattern=boost::string_ref() );
sscan_range sscan ( boost::string_ref parKey, boost::string_ref parPattern=boost::string_ref() );
zscan_range zscan ( boost::string_ref parKey, boost::string_ref parPattern=boost::string_ref() );
//Hash
opt_string hget ( boost::string_ref parKey, boost::string_ref parField );
int hincrby ( boost::string_ref parKey, boost::string_ref parField, int parInc );