57 lines
843 B
C++
57 lines
843 B
C++
#ifndef ALPM_GROUP_H
|
|
#define ALPM_GROUP_H
|
|
|
|
#include "list.h"
|
|
|
|
#include <alpm.h>
|
|
|
|
#include <QtGlobal>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
class QJsonArray;
|
|
QT_END_NAMESPACE
|
|
|
|
namespace PackageManagement {
|
|
|
|
class AlpmGroup
|
|
{
|
|
public:
|
|
AlpmGroup(alpm_group_t *ptr = nullptr);
|
|
|
|
// group properties
|
|
const char *name() const;
|
|
PackageList packages() const;
|
|
QJsonArray packageNames() 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;
|
|
}
|
|
|
|
} // namespace Alpm
|
|
|
|
#endif // ALPM_GROUP_H
|