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

Implement find_all_sets.

This commit is contained in:
King_DuckZ 2016-07-11 18:02:50 +01:00
parent bfdf849711
commit 645cf5858b
4 changed files with 70 additions and 1 deletions

View file

@ -18,6 +18,7 @@ add_library(${PROJECT_NAME} SHARED
async_connection.cpp
tag.cpp
delete.cpp
find.cpp
)
target_include_directories(${PROJECT_NAME} SYSTEM

View file

@ -24,6 +24,7 @@
#include "helpers/stringize.h"
#include "tag.hpp"
#include "delete.hpp"
#include "find.hpp"
#include "record_data_adapt.hpp"
#include <utility>
#include <yaml-cpp/yaml.h>
@ -254,7 +255,7 @@ namespace dindb {
}
std::vector<GroupIDType> BackendRedis::find_all_sets() {
return std::vector<GroupIDType>();
return dindb::find_all_sets(m_redis);
}
std::vector<dinhelp::MaxSizedArray<std::string, 4>> BackendRedis::find_set_details (const std::vector<GroupIDType>& parSets) {

View file

@ -0,0 +1,35 @@
/* Copyright 2015, 2016, Michele Santullo
* This file is part of "dindexer".
*
* "dindexer" is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* "dindexer" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with "dindexer". If not, see <http://www.gnu.org/licenses/>.
*/
#include "find.hpp"
#include "command.hpp"
#include "helpers/lexical_cast.hpp"
#include "dindexerConfig.h"
#include "dindexer-core/split_tags.hpp"
namespace dindb {
std::vector<GroupIDType> find_all_sets (redis::Command& parRedis) {
using dincore::split_and_trim;
using dinhelp::lexical_cast;
std::vector<GroupIDType> retval;
for (const auto& itm : parRedis.scan(PROGRAM_NAME ":set:*")) {
retval.push_back(lexical_cast<GroupIDType>(split_and_trim(itm, ':').back()));
}
return retval;
}
} //namespace dindb

View file

@ -0,0 +1,32 @@
/* Copyright 2015, 2016, Michele Santullo
* This file is part of "dindexer".
*
* "dindexer" is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* "dindexer" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with "dindexer". If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef idB4972996B4494E66A03B6AE205B1FA36
#define idB4972996B4494E66A03B6AE205B1FA36
#include "backends/db_backend.hpp"
#include <vector>
namespace redis {
class Command;
} //namespace redis
namespace dindb {
std::vector<GroupIDType> find_all_sets ( redis::Command& parRedis );
} //namespace dindb
#endif