aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/archive/models_archive_reader.cpp
blob: abbb91d628793c01cb7e8ca3a7cfde524b7994db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "models_archive_reader.h"

#include <util/generic/hash_set.h>

THashSet<TStringBuf> IModelsArchiveReader::FilterByPrefix(TStringBuf prefix, TStringBuf suffix) const {
    THashSet<TStringBuf> result;
    const size_t count = Count();
    for (size_t ind = 0; ind < count; ++ind) {
        TString path = KeyByIndex(ind);
        if (path.StartsWith(prefix) && path.EndsWith(suffix)) {
            result.insert(std::move(path));
        }
    }
    return result;
}