RepoQuery

class RepoQuery : public libdnf5::sack::Query<RepoWeakPtr>

Public Functions

explicit RepoQuery(const libdnf5::BaseWeakPtr &base)

Create a new RepoQuery instance.

Parameters:

base – A weak pointer to Base

explicit RepoQuery(libdnf5::Base &base)

Create a new RepoQuery instance.

Parameters:

base – Reference to Base

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

Since

5.0

Returns:

Weak pointer to the Base object.

void filter_enabled(bool enabled)

Filter repos by their enabled state.

Since

5.0

Parameters:

enabled – A boolean value the filter is matched against.

void filter_expired(bool expired)

Filter repos by their expired state.

Since

5.0

Parameters:

expired – A boolean value the filter is matched against.

void filter_id(const std::string &pattern, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)

Filter repos by their id.

Since

5.0

Parameters:
  • pattern – A string the filter is matched against.

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

void filter_id(const std::vector<std::string> &patterns, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)

Filter repos by their id.

Since

5.0

Parameters:
  • patterns – A vector of strings the filter is matched against.

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

void filter_local(bool local)

Filter repositories by whether they are local

Since

5.0

Parameters:

localtrue returns local repos, false remote repos.

void filter_name(const std::string &pattern, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)

Filter repos by their name.

Since

5.0

Parameters:
  • pattern – A string the filter is matched against.

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

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

Filter repos by their name.

Since

5.0

Parameters:
  • patterns – A vector of strings the filter is matched against.

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

void filter_type(Repo::Type type, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)

Filter repos by their type.

Since

5.0

Parameters:
  • type – A type the filter is matched against.

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