libdnf5::comps

enum class libdnf5::comps::PackageType : int

Values:

enumerator CONDITIONAL
enumerator DEFAULT
enumerator MANDATORY
enumerator OPTIONAL
inline PackageType libdnf5::comps::operator|(PackageType a, PackageType b)
inline PackageType libdnf5::comps::operator|=(PackageType &a, PackageType b)
inline constexpr PackageType libdnf5::comps::operator&(PackageType a, PackageType b)
inline constexpr bool libdnf5::comps::any(PackageType flags)
LIBDNF_API PackageType libdnf5::comps::package_type_from_string (const std::string &type)
LIBDNF_API PackageType libdnf5::comps::package_type_from_string (const std::vector< std::string > types)
LIBDNF_API std::string libdnf5::comps::package_type_to_string (const PackageType type)
LIBDNF_API std::vector< std::string > libdnf5::comps::package_types_to_strings (const PackageType types)
class Environment

Public Functions

~Environment()
Environment(const Environment &src)
Environment &operator=(const Environment &src)
Environment(Environment &&src) noexcept
Environment &operator=(Environment &&src) noexcept
libdnf5::BaseWeakPtr get_base()

Since

5.2.6

Returns:

The Base object to which this object belongs.

std::string get_environmentid() const

Since

5.0

Returns:

The Environment id.

std::string get_name() const

Since

5.0

Returns:

The Environment name.

std::string get_description() const

Since

5.0

Returns:

The Environment description.

std::string get_translated_name(const char *lang) const

Since

5.0

Returns:

The translated name of the Environment based on current locales. If no translation is found, return untranslated name.

std::string get_translated_name() const
std::string get_translated_description(const char *lang) const

Since

5.0

Returns:

The translated description of the Environment based on current locales. If no translation is found, return untranslated description.

std::string get_translated_description() const
std::string get_order() const

Since

5.0

Returns:

The Environment display order.

std::vector<std::string> get_groups()

Since

5.0

Returns:

std::vector of Group ids belonging to the Environment.

std::vector<std::string> get_optional_groups()

Since

5.0

Returns:

std::vector of optional Group ids belonging to the Environment.

std::set<std::string> get_repos() const

Since

5.0

Returns:

std::set of names of repositories that contain the Environment.

bool get_installed() const

Since

5.0

Returns:

true if the Environment is installed (belongs to the @System repo).

libdnf5::transaction::TransactionItemReason get_reason() const

Since

5.0

Returns:

Resolved reason why the Environment was installed. Environments can be installed due to multiple reasons, only the most significant is returned.

Environment &operator+=(const Environment &rhs)

Merge the Environment with another one.

Since

5.0

bool operator==(const Environment &rhs) const noexcept
bool operator!=(const Environment &rhs) const noexcept
bool operator<(const Environment &rhs) const
void serialize(const std::string &path)

Serialize the Environment into an xml file

Since

5.0

Parameters:

path – Path of the output xml file.

Throws:

utils::xml::XMLSaveError – When saving of the file fails.

struct EnvironmentId

Public Functions

EnvironmentId() = default
inline explicit EnvironmentId(int id)
inline bool operator==(const EnvironmentId &other) const noexcept
inline bool operator!=(const EnvironmentId &other) const noexcept

Public Members

int id = {0}
class EnvironmentQuery : public libdnf5::sack::Query<Environment>

Public Functions

explicit EnvironmentQuery(const libdnf5::BaseWeakPtr &base, bool empty = false)
explicit EnvironmentQuery(libdnf5::Base &base, bool empty = false)
~EnvironmentQuery()
EnvironmentQuery(const EnvironmentQuery &src)
EnvironmentQuery &operator=(const EnvironmentQuery &src)
EnvironmentQuery(EnvironmentQuery &&src) noexcept
EnvironmentQuery &operator=(EnvironmentQuery &&src) noexcept
libdnf5::BaseWeakPtr get_base()

Since

5.2.6

Returns:

The Base object to which this object belongs.

void filter_environmentid(const std::string &pattern, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
void filter_environmentid(const std::vector<std::string> &patterns, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
void filter_name(const std::string &pattern, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
void filter_name(const std::vector<std::string> &patterns, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
void filter_installed(bool value)
class Group

Public Functions

~Group()
Group(const Group &src)
Group &operator=(const Group &src)
Group(Group &&src) noexcept
Group &operator=(Group &&src) noexcept
libdnf5::BaseWeakPtr get_base()

Since

5.2.6

Returns:

The Base object to which this object belongs.

std::string get_groupid() const

Since

5.0

Returns:

The Group id.

std::string get_name() const

Since

5.0

Returns:

The Group name.

std::string get_description() const

Since

5.0

Returns:

The Group description.

std::string get_translated_name(const char *lang) const

Since

5.0

Returns:

The translated name of the Group based on current locales. If no translation is found, return untranslated name.

std::string get_translated_name() const
std::string get_translated_description(const char *lang) const

Since

5.0

Returns:

The translated description of the Group based on current locales. If no translation is found, return untranslated ui_description.

std::string get_translated_description() const
std::string get_order() const

Since

5.0

Returns:

The Group display order.

std::string get_langonly() const

Since

5.0

Returns:

The Group langonly.

bool get_uservisible() const

Since

5.0

Returns:

true if the Group is visible to the users.

bool get_default() const

Since

5.0

Returns:

true if the Group is installed by default.

std::vector<Package> get_packages()

Since

5.0

Returns:

std::vector of Packages belonging to the Group.

std::vector<Package> get_packages_of_type(PackageType type)

Since

5.0

Parameters:

type – One of the PackageTypes.

Returns:

std::vector of Packages of given type belonging to the Group.

std::set<std::string> get_repos() const

Since

5.0

Returns:

std::set of names of repositories that contain the Group.

bool get_installed() const

Since

5.0

Returns:

true if the Group is installed (belongs to the @System repo).

libdnf5::transaction::TransactionItemReason get_reason() const

Since

5.0

Returns:

Resolved reason why the Group was installed. Groups can be installed due to multiple reasons, only the most significant is returned.

Group &operator+=(const Group &rhs)

Merge the Group with another one.

Since

5.0

bool operator==(const Group &rhs) const noexcept
bool operator!=(const Group &rhs) const noexcept
bool operator<(const Group &rhs) const
void serialize(const std::string &path)

Serialize the Group into an xml file.

Since

5.0

Parameters:

path – Path of the output xml file.

Throws:

utils::xml::XMLSaveError – When saving of the file fails.

struct GroupId

Public Functions

GroupId() = default
inline explicit GroupId(int id)
inline bool operator==(const GroupId &other) const noexcept
inline bool operator!=(const GroupId &other) const noexcept

Public Members

int id = {0}
class GroupQuery : public libdnf5::sack::Query<Group>

Public Functions

explicit GroupQuery(const libdnf5::BaseWeakPtr &base, bool empty = false)
explicit GroupQuery(libdnf5::Base &base, bool empty = false)
~GroupQuery()
GroupQuery(const GroupQuery &src)
GroupQuery &operator=(const GroupQuery &src)
GroupQuery(GroupQuery &&src) noexcept
GroupQuery &operator=(GroupQuery &&src) noexcept
libdnf5::BaseWeakPtr get_base()

Since

5.2.6

Returns:

The Base object to which this object belongs.

void filter_groupid(const std::string &pattern, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
void filter_groupid(const std::vector<std::string> &patterns, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
void filter_name(const std::string &pattern, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
void filter_package_name(const std::vector<std::string> &patterns, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)

Filter groups by packages they contain. Keep only groups that contain packages with given names.

Since

5.12

Parameters:
  • patterns – A vector of strings (package names) the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ.

void filter_name(const std::vector<std::string> &patterns, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
void filter_uservisible(bool value)
void filter_default(bool value)
void filter_installed(bool value)
class InvalidPackageType : public libdnf5::Error

Public Functions

InvalidPackageType(const std::string &type)
InvalidPackageType(const PackageType type)
inline virtual const char *get_domain_name() const noexcept override
Returns:

The domain name (namespace and enclosing class names) of the exception.

inline virtual const char *get_name() const noexcept override
Returns:

The exception class name.

class Package

Public Functions

Package(const std::string &name, PackageType type, const std::string &condition)
~Package()
Package(const Package &src)
Package &operator=(const Package &src)
Package(Package &&src) noexcept
Package &operator=(Package &&src) noexcept
bool operator==(const Package &other) const noexcept
bool operator!=(const Package &other) const noexcept
std::string get_name() const

Since

5.0

Returns:

The Package name.

void set_name(const std::string &value)
PackageType get_type() const

Since

5.0

Returns:

The PackageType.

void set_type(const PackageType &value)
std::string get_type_string() const

Since

5.0

Returns:

std::string that corresponds to the PackageType.

std::string get_condition() const

Since

5.0

Returns:

The condition (name of package) under which the package gets installed.

void set_condition(const std::string &value)