#pragma once #include #include #include #include namespace DB { class StaticDirectoryIterator final : public IDirectoryIterator { public: explicit StaticDirectoryIterator(std::vector && dir_file_paths_) : dir_file_paths(std::move(dir_file_paths_)) , iter(dir_file_paths.begin()) {} void next() override { ++iter; } bool isValid() const override { return iter != dir_file_paths.end(); } std::string path() const override { return iter->string(); } std::string name() const override { if (iter->filename().empty()) return iter->parent_path().filename(); return iter->filename(); } private: std::vector dir_file_paths; std::vector::iterator iter; }; }