summaryrefslogtreecommitdiff
path: root/src/package.h
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2023-04-15 08:43:30 +0200
committerEugen Wissner <belka@caraus.de>2023-04-15 08:43:30 +0200
commit34b10f41aa285e423cccb161342b68ae7275da4b (patch)
treee021c107400ec467b59a019c45d6659110c677cf /src/package.h
parentdbf14caee2f3ffbcfb21d5ca4d1566e0f57a1aed (diff)
downloadslackbuilder-34b10f41aa285e423cccb161342b68ae7275da4b.tar.gz
Retrieve updatable packages
Diffstat (limited to 'src/package.h')
-rw-r--r--src/package.h23
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;
+ };
}