1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-02-17 11:45:50 +00:00

Allow passing a pattern to *scan commands.

This commit is contained in:
King_DuckZ 2016-07-10 13:57:16 +01:00
parent 01d587b7da
commit 7b77913b49
2 changed files with 12 additions and 12 deletions

View file

@ -77,20 +77,20 @@ namespace redis {
return m_local_data->async_connection.connection_error();
}
auto Command::scan() -> scan_range {
return scan_range(scan_iterator(this, false), scan_iterator(this, true));
auto Command::scan (boost::string_ref parPattern) -> scan_range {
return scan_range(scan_iterator(this, false, parPattern), scan_iterator(this, true));
}
auto Command::hscan (boost::string_ref parKey) -> hscan_range {
return hscan_range(hscan_iterator(this, parKey, false), hscan_iterator(this, parKey, true));
auto Command::hscan (boost::string_ref parKey, boost::string_ref parPattern) -> hscan_range {
return hscan_range(hscan_iterator(this, parKey, false, parPattern), hscan_iterator(this, parKey, true));
}
auto Command::sscan (boost::string_ref parKey) -> sscan_range {
return sscan_range(sscan_iterator(this, parKey, false), sscan_iterator(this, parKey, true));
auto Command::sscan (boost::string_ref parKey, boost::string_ref parPattern) -> sscan_range {
return sscan_range(sscan_iterator(this, parKey, false, parPattern), sscan_iterator(this, parKey, true));
}
auto Command::zscan (boost::string_ref parKey) -> zscan_range {
return zscan_range(zscan_iterator(this, parKey, false), zscan_iterator(this, parKey, true));
auto Command::zscan (boost::string_ref parKey, boost::string_ref parPattern) -> zscan_range {
return zscan_range(zscan_iterator(this, parKey, false, parPattern), zscan_iterator(this, parKey, true));
}
Batch Command::make_batch() {

View file

@ -67,10 +67,10 @@ namespace redis {
Reply run ( const char* parCommand, Args&&... parArgs );
//Single Redis command wrappers
scan_range scan ( void );
hscan_range hscan ( boost::string_ref parKey );
sscan_range sscan ( boost::string_ref parKey );
zscan_range zscan ( boost::string_ref parKey );
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() );
private:
struct LocalData;