libpkgmanifest::common
-
class NoSuchRepositoryIdError : public std::runtime_error
- #include <repositories.hpp>
Exception thrown when a repository with a given ID does not exist.
-
class ParserError : public std::runtime_error
- #include <exception.hpp>
Exception thrown when there is an issue parsing the manifest file.
-
class Repositories
- #include <repositories.hpp>
A container for all repositories listed in the manifest.
Public Functions
-
bool contains(const std::string &id) const
Checks if a given repository exists.
- Parameters:
id – The repository ID.
- Returns:
True if the given repository exists; otherwise, false.
-
std::size_t size() const
Gets the number of repositories in the container.
- Returns:
The size of the repositories container.
-
Repository get(const std::string &id) const
Retrieves a repository by its ID.
- Parameters:
id – The repository ID.
- Returns:
A repository with the given ID.
-
void add(Repository &repository)
Adds a repository to the container.
- Parameters:
repository – The repository to add.
-
RepositoriesIterator begin()
Returns an iterator to the beginning of the container.
-
RepositoriesIterator end()
Returns an iterator to the end of the container.
-
bool contains(const std::string &id) const
-
class RepositoriesIterator
-
class Repository
- #include <repository.hpp>
Represents a single repository within the manifest.
Public Functions
-
std::string get_id() const
Retrieves the repository ID.
- Returns:
The repository ID.
-
std::string get_baseurl() const
Retrieves the base URL of the repository.
- Returns:
The base URL.
-
std::string get_metalink() const
Retrieves the metalink URL of the repository.
- Returns:
The metalink URL.
-
std::string get_mirrorlist() const
Retrieves the mirrorlist URL of the repository.
- Returns:
The mirrorlist URL.
-
void set_id(const std::string &id)
Sets the repository ID.
- Parameters:
id – The repository ID to set.
-
void set_baseurl(const std::string &baseurl)
Sets the base URL of the repository.
- Parameters:
baseurl – The base URL to set.
-
void set_metalink(const std::string &metalink)
Sets the metalink URL of the repository.
- Parameters:
metalink – The metalink URL to set.
-
void set_mirrorlist(const std::string &mirrorlist)
Sets the mirrorlist URL of the repository.
- Parameters:
mirrorlist – The mirrorlist URL to set.
-
std::string get_id() const
-
class SerializerError : public std::runtime_error
- #include <exception.hpp>
Exception thrown when serializing manifest objects to a file fails.
-
class Version
- #include <version.hpp>
Structure representing a version, supporting up to three components.
Public Functions
-
unsigned get_major() const
Retrieves the major version component.
- Returns:
The major version number.
-
unsigned get_minor() const
Retrieves the minor version component.
- Returns:
The minor version number.
-
unsigned get_patch() const
Retrieves the patch version component.
- Returns:
The patch version number.
-
void set_major(unsigned major)
Sets the major version component.
- Parameters:
major – The value of the major version component.
-
void set_minor(unsigned minor)
Sets the minor version component.
- Parameters:
minor – The value for the minor version component.
-
void set_patch(unsigned patch)
Sets the patch version component.
- Parameters:
patch – The value for the patch version component.
-
unsigned get_major() const