repoindex/lib/alpm/group.h

68 lines
1.1 KiB
C++

#ifndef ALPM_GROUP_H
#define ALPM_GROUP_H
#include "./list.h"
#include "./package.h"
#include <alpm.h>
#include <QStringList>
QT_FORWARD_DECLARE_CLASS(QJsonArray)
namespace RepoIndex {
class AlpmGroup
{
public:
AlpmGroup(alpm_group_t *ptr = nullptr);
// group properties
const char *name() const;
PackageList packages() const;
private:
const alpm_group_t *m_ptr;
};
/*!
* \brief Constructs a new ALPM group.
*/
inline AlpmGroup::AlpmGroup(alpm_group_t *ptr) :
m_ptr(ptr)
{}
/*!
* \brief Returns the name of the group.
*/
inline const char *AlpmGroup::name() const
{
return m_ptr->name;
}
/*!
* \brief Returns the packages of the group.
*/
inline PackageList AlpmGroup::packages() const
{
return m_ptr->packages;
}
class GroupInfo
{
public:
GroupInfo(const QString &name, const QStringList &packages = QStringList());
GroupInfo(const AlpmGroup &group);
QString name;
QStringList packages;
};
inline GroupInfo::GroupInfo(const QString &name, const QStringList &packages) :
name(name),
packages(packages)
{}
}
#endif // ALPM_GROUP_H