1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-02-26 13:23:55 +00:00

Add typedefs to SetListingView<B>

This commit is contained in:
King_DuckZ 2016-02-17 08:54:38 +01:00
parent e718a21e49
commit bb1148863d
2 changed files with 6 additions and 3 deletions

View file

@ -105,6 +105,9 @@ namespace mchlib {
std::size_t m_level_offset; std::size_t m_level_offset;
}; };
using MutableSetListingView = SetListingView<false>;
using ConstSetListingView = SetListingView<true>;
class SetListing { class SetListing {
public: public:
typedef std::vector<FileRecordData> ListType; typedef std::vector<FileRecordData> ListType;

View file

@ -70,7 +70,7 @@ namespace mchlib {
} }
#if !defined(USE_LEGACY_HASH_DIR) #if !defined(USE_LEGACY_HASH_DIR)
void hash_dir (FileRecordData& parEntry, SetListingView<false>& parList, const PathName& parCurrDir, MimeType& parMime, bool parIgnoreErrors) { void hash_dir (FileRecordData& parEntry, MutableSetListingView& parList, const PathName& parCurrDir, MimeType& parMime, bool parIgnoreErrors) {
assert(parEntry.is_directory); assert(parEntry.is_directory);
parEntry.mime_full = parMime.analyze(parEntry.abs_path); parEntry.mime_full = parMime.analyze(parEntry.abs_path);
@ -87,7 +87,7 @@ namespace mchlib {
PathName curr_subdir(it->abs_path); PathName curr_subdir(it->abs_path);
const std::string relpath = make_relative_path(parCurrDir, curr_subdir).path(); const std::string relpath = make_relative_path(parCurrDir, curr_subdir).path();
if (it->is_directory) { if (it->is_directory) {
auto cd_list = SetListingView<false>(it); auto cd_list = MutableSetListingView(it);
assert(cd_list.begin()->abs_path != it->abs_path); assert(cd_list.begin()->abs_path != it->abs_path);
hash_dir(*it, cd_list, curr_subdir, parMime, parIgnoreErrors); hash_dir(*it, cd_list, curr_subdir, parMime, parIgnoreErrors);
append_to_vec(dir_blob, it->hash, relpath); append_to_vec(dir_blob, it->hash, relpath);
@ -382,7 +382,7 @@ namespace mchlib {
#endif #endif
#if !defined(USE_LEGACY_HASH_DIR) #if !defined(USE_LEGACY_HASH_DIR)
SetListingView<false> recordlist(m_local_data->paths.begin(), m_local_data->paths.end(), base_path.atom_count()); MutableSetListingView recordlist(m_local_data->paths.begin(), m_local_data->paths.end(), base_path.atom_count());
#endif #endif
#if defined(WITH_PROGRESS_FEEDBACK) #if defined(WITH_PROGRESS_FEEDBACK)
m_local_data->done_count = 0; m_local_data->done_count = 0;