#pragma once #include #include #include #include #include class Collection { public: class UnknownSource; class DuplicateSource; class DuplicatePath; Collection(); unsigned int sourcesTotal() const; unsigned int sourcesPending() const; unsigned int sourcesError() const; unsigned int sourcesSuccess() const; bool hasSource(const std::string& source) const; void addSource(const std::string& source); void sourceError(const std::string& source); void sourceSuccess(const std::string& source, const std::filesystem::path& path); private: std::set errorSources; std::set pendingSources; std::map successSources; //would be nice to have a bimap here }; class Collection::UnknownSource : public std::exception { public: UnknownSource(const std::string& source); const char* what() const noexcept( true ) override; private: std::string source; }; class Collection::DuplicateSource : public std::exception { public: DuplicateSource(const std::string& source); const char* what() const noexcept( true ) override; private: std::string source; }; class Collection::DuplicatePath : public std::exception { public: DuplicatePath(const std::string& source, const std::filesystem::path& path); const char* what() const noexcept( true ) override; private: std::string source; std::filesystem::path path; };