From 34b10f41aa285e423cccb161342b68ae7275da4b Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 15 Apr 2023 08:43:30 +0200 Subject: Retrieve updatable packages --- src/package.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/package.h') 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 #include #include +#include +#include namespace katja { @@ -23,5 +27,24 @@ namespace katja static std::optional parse(const std::string& full_name) noexcept; }; + class repository + { + public: + virtual std::unordered_map list(const std::set& package_names) = 0; + virtual void refresh() = 0; + virtual std::forward_list check_dependencies(const std::string& package_name) = 0; + }; + std::unordered_map 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; + }; } -- cgit v1.2.3