# PackagePair

<a id="packagepair"></a>

# PackagePair

```cpp
#include <icy/pacm/package.h>

struct PackagePair
```

[Defined in src/pacm/include/icy/pacm/package.h:328](https://github.com/auscaster/icey/blob/main/src/pacm/include/icy/pacm/package.h#L328)

Pairing of the installed and remote metadata for the same package ID.

## Public Attributes

| Return | Name | Description |
|--------|------|-------------|
| [`LocalPackage`](https://auscaster.com/icey/docs/api-reference/icy-pacm-LocalPackage.md#localpackage) * | [`local`](#local-1)  | Returns true if there are no possible updates for this package, false otherwise. |
| [`RemotePackage`](https://auscaster.com/icey/docs/api-reference/icy-pacm-RemotePackage.md#remotepackage) * | [`remote`](#remote-1)  |  |

---

<a id="local-1"></a>

### local

```cpp
LocalPackage * local
```

Type: [`LocalPackage`](https://auscaster.com/icey/docs/api-reference/icy-pacm-LocalPackage.md#localpackage) *

[Defined in src/pacm/include/icy/pacm/package.h:357](https://github.com/auscaster/icey/blob/main/src/pacm/include/icy/pacm/package.h#L357)

Returns true if there are no possible updates for this package, false otherwise.

---

<a id="remote-1"></a>

### remote

```cpp
RemotePackage * remote
```

Type: [`RemotePackage`](https://auscaster.com/icey/docs/api-reference/icy-pacm-RemotePackage.md#remotepackage) *

[Defined in src/pacm/include/icy/pacm/package.h:358](https://github.com/auscaster/icey/blob/main/src/pacm/include/icy/pacm/package.h#L358)

## Public Methods

| Return | Name | Description |
|--------|------|-------------|
|  | [`PackagePair`](#packagepair-1)  |  |
|  | [`~PackagePair`](#packagepair-2) `virtual` | Defaulted destructor. |
| `bool` | [`valid`](#valid-7) `virtual` `const` | Returns true if at least one of local/remote is set and that pointer is itself [valid()](#valid-7). |
| `std::string` | [`id`](#id-8) `const` | Returns the package ID, preferring the local package if available. |
| `std::string` | [`name`](#name-11) `const` | Returns the package display name, preferring the local package if available. |
| `std::string` | [`type`](#type-15) `const` | Returns the package type, preferring the local package if available. |
| `std::string` | [`author`](#author-1) `const` | Returns the package author, preferring the local package if available. |
| `bool` | [`hasExtension`](#hasextension-1) `const` | Returns true when either side carries extension metadata. |

---

<a id="packagepair-1"></a>

### PackagePair

```cpp
PackagePair(LocalPackage * local = nullptr, RemotePackage * remote = nullptr)
```

[Defined in src/pacm/include/icy/pacm/package.h:332](https://github.com/auscaster/icey/blob/main/src/pacm/include/icy/pacm/package.h#L332)

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `local` | [`LocalPackage`](https://auscaster.com/icey/docs/api-reference/icy-pacm-LocalPackage.md#localpackage) * | Pointer to the locally installed package, or nullptr if not installed. |
| `remote` | [`RemotePackage`](https://auscaster.com/icey/docs/api-reference/icy-pacm-RemotePackage.md#remotepackage) * | Pointer to the remote package record, or nullptr if not known. |

---

<a id="packagepair-2"></a>

### ~PackagePair

`virtual`

```cpp
virtual ~PackagePair() = default
```

[Defined in src/pacm/include/icy/pacm/package.h:333](https://github.com/auscaster/icey/blob/main/src/pacm/include/icy/pacm/package.h#L333)

Defaulted destructor.

---

<a id="valid-7"></a>

### valid

`virtual` `const`

```cpp
virtual bool valid() const
```

[Defined in src/pacm/include/icy/pacm/package.h:336](https://github.com/auscaster/icey/blob/main/src/pacm/include/icy/pacm/package.h#L336)

Returns true if at least one of local/remote is set and that pointer is itself [valid()](#valid-7).

---

<a id="id-8"></a>

### id

`const`

```cpp
std::string id() const
```

[Defined in src/pacm/include/icy/pacm/package.h:339](https://github.com/auscaster/icey/blob/main/src/pacm/include/icy/pacm/package.h#L339)

Returns the package ID, preferring the local package if available.

---

<a id="name-11"></a>

### name

`const`

```cpp
std::string name() const
```

[Defined in src/pacm/include/icy/pacm/package.h:342](https://github.com/auscaster/icey/blob/main/src/pacm/include/icy/pacm/package.h#L342)

Returns the package display name, preferring the local package if available.

---

<a id="type-15"></a>

### type

`const`

```cpp
std::string type() const
```

[Defined in src/pacm/include/icy/pacm/package.h:345](https://github.com/auscaster/icey/blob/main/src/pacm/include/icy/pacm/package.h#L345)

Returns the package type, preferring the local package if available.

---

<a id="author-1"></a>

### author

`const`

```cpp
std::string author() const
```

[Defined in src/pacm/include/icy/pacm/package.h:348](https://github.com/auscaster/icey/blob/main/src/pacm/include/icy/pacm/package.h#L348)

Returns the package author, preferring the local package if available.

---

<a id="hasextension-1"></a>

### hasExtension

`const`

```cpp
bool hasExtension() const
```

[Defined in src/pacm/include/icy/pacm/package.h:351](https://github.com/auscaster/icey/blob/main/src/pacm/include/icy/pacm/package.h#L351)

Returns true when either side carries extension metadata.
