diff options
Diffstat (limited to 'src/package.h')
| -rw-r--r-- | src/package.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/package.h b/src/package.h index 5ffd060..109f065 100644 --- a/src/package.h +++ b/src/package.h @@ -1,6 +1,10 @@ +#pragma once + #include <string> #include <optional> #include <unordered_map> +#include <set> +#include <forward_list> namespace katja { @@ -23,5 +27,24 @@ namespace katja static std::optional<package> parse(const std::string& full_name) noexcept; }; + class repository + { + public: + virtual std::unordered_map<std::string, package> list(const std::set<std::string>& package_names) = 0; + virtual void refresh() = 0; + virtual std::forward_list<std::string> check_dependencies(const std::string& package_name) = 0; + }; + std::unordered_map<std::string, package> read_package_database(); + + class package_exception : public std::exception + { + std::string m_message; + + public: + explicit package_exception(const std::string& package_name, const std::string& reason) noexcept; + + const std::string_view package_name() const noexcept; + const char *what() const noexcept override; + }; } |
