libpkgmanifest::input

class Input
#include <input.hpp>

Stores all information related to the items defined in the input file.

Note

The file serves as input data for clients generating the manifest.

Public Functions

std::string get_document() const

Retrieves the YAML document identifier.

Note

This is expected to be the value “rpm-package-input”.

Returns:

The document identifier.

Version &get_version()

Retrieves the version of the YAML document.

Note

This version changes if the structure or format of the document’s properties has been updated.

Returns:

The document version.

Repositories &get_repositories()

Retrieves a structure containing all repositories defined in the input file.

Returns:

A structure with the repositories listed in the input.

Packages &get_packages()

Retrieves a structure containing all packages and their associated actions from the input file.

Returns:

A structure with the packages listed in the input.

Modules &get_modules()

Retrieves a structure containing all the modules and their associated actions from the input file.

Returns:

A structure with the modules listed in the input.

std::vector<std::string> &get_archs()

Retrieves a list of architectures from the input file.

Returns:

A list of architectures.

Options &get_options()

Retrieves a structure containing options to override the default package manager behavior.

Returns:

A structure with the options listed in the input.

void set_document(const std::string &document)

Sets the YAML document identifier.

Parameters:

document – The YAML identifier to set.

void set_version(Version &version)

Sets the version of the YAML document.

Parameters:

version – The version to set for the document.

void set_repositories(Repositories &repositories)

Sets the repositories to be included in the input file.

Parameters:

repositories – A structure containing the repositories to set.

void set_packages(Packages &packages)

Sets the packages to be included in the input file.

Parameters:

packages – A structure containing the packages to set.

void set_modules(Modules &modules)

Sets the modules to be included in the input file.

Parameters:

modules – A structure containing the modules to set.

void set_options(Options &options)

Sets the options to be included in the input file.

Parameters:

options – A structure containing the options to set.

class Modules
#include <modules.hpp>

A container with modular packages and their associated actions.

Public Functions

std::vector<std::string> &get_enables()

Retrieves a list of modules to be enabled for resolving manifest content.

Returns:

A vector containing modules to be enabled.

std::vector<std::string> &get_disables()

Retrieves a list of modules to be disabled for resolving manifest content.

Returns:

A vector containing modules to be disabled.

class Options
#include <options.hpp>

A class containing options to override the default package manager behavior when resolving manifest content.

Public Functions

bool get_allow_erasing() const

Checks if the package manager is allowed to remove installed packages to resolve dependency issues.

Returns:

True if the package manager is allowed to remove packages, otherwise false.

void set_allow_erasing(bool value)

Sets whether the package manager is allowed to remove installed packages to resolve dependency issues.

Parameters:

value – True to allow the package manager to remove packages, otherwise false.

class Packages
#include <packages.hpp>

A container with input packages and their associated actions.

Public Functions

std::vector<std::string> &get_installs()

Retrieves a list of packages designated for installation when resolving manifest content.

Returns:

A vector containing installation packages.

std::vector<std::string> &get_reinstalls()

Retrieves a list of packages designated for reinstallation when resolving manifest content.

Returns:

A vector containing reinstallation packages.

class Parser
#include <parser.hpp>

A class responsible for parsing the YAML files into objects.

Public Functions

Input parse(const std::string &path) const

Parses the input file from a specified file path.

Parameters:

path – The location of the input file.

Throws:

ParserError – if an error occurs during file parsing.

Returns:

An input object containing data parsed from the file.

Input parse_prototype(const std::string &path) const

Parses the input file in prototype format from a specified file path.

Note

This ensures compatibility with clients that have already deployed the existing prototype format.

Parameters:

path – The location of the input file.

Throws:

ParserError – if an error occurs during file parsing.

Returns:

An input object containing data parsed from the file.