diff options
Diffstat (limited to 'src/package.h')
| -rw-r--r-- | src/package.h | 27 |
1 files changed, 27 insertions, 0 deletions
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 <string> +#include <optional> +#include <unordered_map> + +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<package> parse(const std::string& full_name) noexcept; + }; + + std::unordered_map<std::string, package> read_package_database(); +} |
