diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-01-06 11:12:50 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-01-06 11:12:50 +0100 |
| commit | dd97107aa81e1137c80602c044b3805bf4ffda56 (patch) | |
| tree | 5b7d3449bfc6963a0f33ee5cb6827faa8424e763 /include | |
| parent | 8f0a4b9f36046b41a66db599e4e925386c48d049 (diff) | |
| download | katja-dd97107aa81e1137c80602c044b3805bf4ffda56.tar.gz | |
Switch to using modules in the library
Diffstat (limited to 'include')
| -rw-r--r-- | include/katja/database.hpp | 39 | ||||
| -rw-r--r-- | include/katja/repository.hpp | 32 | ||||
| -rw-r--r-- | include/katja/sbo.hpp | 44 |
3 files changed, 0 insertions, 115 deletions
diff --git a/include/katja/database.hpp b/include/katja/database.hpp deleted file mode 100644 index ca85ab1..0000000 --- a/include/katja/database.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#pragma once - -#include <string> -#include <map> - -namespace katja -{ - constexpr const char *database = "/var/lib/pkgtools/packages"; - - class database_package - { - database_package(std::string&& name, std::string&& version, - std::string&& architecture, std::string&& build_tag); - - static database_package create_database_package(const std::string& fullname); - - public: - const std::string name; - const std::string version; - const std::string architecture; - const std::string build_tag; - - database_package(const std::string& fullname); - - bool operator<(const database_package& that) const; - bool operator>(const database_package& that) const; - - std::string to_string() const; - }; - - using package_database = std::multimap<std::string, database_package>; - - package_database read_installed_database(); -} diff --git a/include/katja/repository.hpp b/include/katja/repository.hpp deleted file mode 100644 index cde9ca0..0000000 --- a/include/katja/repository.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#pragma once - -#include <string> -#include <vector> - -#include "katja/database.hpp" - -namespace katja -{ - struct package_identifier - { - const std::string name; - const std::string version; - const std::string architecture; - const std::string data; - - std::string to_string() const; - }; - - class repository - { - public: - virtual std::vector<package_identifier> get_updates(const package_database& database) = 0; - virtual std::vector<package_identifier> search_names(const std::string& architecture, - const std::string& needle) = 0; - }; -} diff --git a/include/katja/sbo.hpp b/include/katja/sbo.hpp deleted file mode 100644 index ba46509..0000000 --- a/include/katja/sbo.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -#pragma once - -#include <string> -#include <vector> -#include <filesystem> -#include <optional> - -#include "katja/repository.hpp" - -namespace katja -{ - struct info_file - { - const std::string program_name; - const std::string version; - const std::string homepage; - const std::string email; - const std::string maintainer; - - info_file(const std::string& program_name, const std::string& version, - const std::string homepage, const std::string& email, const std::string& maintainer); - - package_identifier identifier_for(const std::string& architecture); - }; - - class sbo_repository final : public repository - { - std::map<std::string, std::filesystem::path> info_paths; - - public: - sbo_repository(const std::filesystem::path& repository_path); - - std::vector<package_identifier> get_updates(const package_database& database) override; - std::vector<package_identifier> search_names(const std::string& architecture, - const std::string& needle) override; - }; - - std::optional<info_file> read_slackbuild_info(const std::filesystem::path& info_filepath); -} |
