diff --git a/src/backends/redis/backend_redis.cpp b/src/backends/redis/backend_redis.cpp index 720cce6..bd91a19 100644 --- a/src/backends/redis/backend_redis.cpp +++ b/src/backends/redis/backend_redis.cpp @@ -183,7 +183,8 @@ namespace dindb { "base_file_id", lexical_cast(base_file_id), "item_count", lexical_cast(parData.size()), "dir_count", lexical_cast(std::count_if(parData.begin(), parData.end(), [](const mchlib::FileRecordData& r){return r.is_directory;})), - "creation", lexical_cast(std::time(nullptr)) + "creation", lexical_cast(std::time(nullptr)), + "app_name", parSignature ); #if !defined(NDEBUG) @@ -282,7 +283,7 @@ namespace dindb { } std::vector BackendRedis::find_paths_starting_by (GroupIDType parGroupID, uint16_t parLevel, boost::string_ref parPath) { - return std::vector(); + return dindb::find_paths_starting_by(m_redis, parGroupID, parLevel, parPath); } } //namespace dindb diff --git a/src/backends/redis/find.cpp b/src/backends/redis/find.cpp index 16f1405..746ab95 100644 --- a/src/backends/redis/find.cpp +++ b/src/backends/redis/find.cpp @@ -317,4 +317,15 @@ namespace dindb { } return retval; }; + + std::vector find_paths_starting_by (redis::IncRedis& parRedis, GroupIDType parGroupID, uint16_t parLevel, boost::string_ref parPath) { + using boost::adaptors::transformed; + using dinhelp::MaxSizedArray; + + auto file_details = find_file_details(parRedis, parGroupID, parLevel, parPath); + return boost::copy_range>( + file_details | + transformed([](MaxSizedArray& a){return std::move(a.front());}) + ); + } } //namespace dindb diff --git a/src/backends/redis/find.hpp b/src/backends/redis/find.hpp index d06395d..0f8bc86 100644 --- a/src/backends/redis/find.hpp +++ b/src/backends/redis/find.hpp @@ -21,6 +21,9 @@ #include "backends/db_backend.hpp" #include "helpers/MaxSizedArray.hpp" #include +#include +#include +#include namespace redis { class IncRedis; @@ -34,6 +37,7 @@ namespace dindb { std::vector locate_sets_in_db ( redis::IncRedis& parRedis, const std::string& parSubstr, const std::vector& parSets, bool parCaseInsensitive ); std::vector> find_set_details ( redis::IncRedis& parRedis, const std::vector& parSets ); std::vector> find_file_details ( redis::IncRedis& parRedis, GroupIDType parSetID, uint16_t parLevel, boost::string_ref parDir ); + std::vector find_paths_starting_by ( redis::IncRedis& parRedis, GroupIDType parGroupID, uint16_t parLevel, boost::string_ref parPath ); } //namespace dindb #endif