From f46a16b4a0d50b6512df2b312f7f800a9a963ca2 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 1 Apr 2023 14:16:44 +0200 Subject: Add an utility to list all installed packages --- src/package.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/package.h (limited to 'src/package.h') diff --git a/src/package.h b/src/package.h new file mode 100644 index 0000000..5ffd060 --- /dev/null +++ b/src/package.h @@ -0,0 +1,27 @@ +#include +#include +#include + +namespace katja +{ + class package + { + std::string m_name; + std::string m_version; + std::string m_architecture; + std::string m_tag; + + public: + explicit package(const std::string& name, const std::string& version, + const std::string& architecture, const std::string& tag); + + const std::string& name() const noexcept; + const std::string& version() const noexcept; + const std::string& architecture() const noexcept; + const std::string& tag() const noexcept; + + static std::optional parse(const std::string& full_name) noexcept; + }; + + std::unordered_map read_package_database(); +} -- cgit v1.2.3