models_archive_reader.cpp 475 B

123456789101112131415
  1. #include "models_archive_reader.h"
  2. #include <util/generic/hash_set.h>
  3. THashSet<TStringBuf> IModelsArchiveReader::FilterByPrefix(TStringBuf prefix, TStringBuf suffix) const {
  4. THashSet<TStringBuf> result;
  5. const size_t count = Count();
  6. for (size_t ind = 0; ind < count; ++ind) {
  7. TString path = KeyByIndex(ind);
  8. if (path.StartsWith(prefix) && path.EndsWith(suffix)) {
  9. result.insert(std::move(path));
  10. }
  11. }
  12. return result;
  13. }