JcatItem: libjcat Reference Manual

## JcatItem JcatItem |

## Functions

JcatItem * | jcat_item_new ()
gchar * | jcat_item_to_string ()
GPtrArray * | jcat_item_get_blobs ()
GPtrArray * | jcat_item_get_blobs_by_kind ()
JcatBlob * | jcat_item_get_blob_by_kind ()
void | jcat_item_add_blob ()
const gchar * | jcat_item_get_id ()
void | jcat_item_add_alias_id ()
void | jcat_item_remove_alias_id ()
GPtrArray * | jcat_item_get_alias_ids ()
gboolean | jcat_item_has_target ()

## Types and Values

#define | JCAT_TYPE_ITEM
struct | JcatItemClass
| JcatItem

## Description

## Functions

### jcat_item_new ()

    JcatItem *
    jcat_item_new (const gchar *id);

Creates a new item.

#### Parameters

id | An item ID, typically a file basename |

#### Returns

a JcatItem

Since: 0.1.0

### jcat_item_to_string ()

    gchar *
    jcat_item_to_string (JcatItem *self);

Converts the JcatItem to a string.

#### Parameters

self | JcatItem |

#### Returns

string

Since: 0.1.0

### jcat_item_get_blobs ()

    GPtrArray *
    jcat_item_get_blobs (JcatItem *self);

Gets all the blobs for this item.

#### Parameters

self | JcatItem |

#### Returns

blobs.

[transfer container][element-type JcatBlob]

Since: 0.1.0

### jcat_item_get_blobs_by_kind ()

    GPtrArray *
    jcat_item_get_blobs_by_kind (JcatItem *self,
                                 JcatBlobKind kind);

Gets the item blobs by a specific kind.

#### Parameters

self | JcatItem |
kind | JcatBlobKind, e.g. `JCAT_BLOB_KIND_SHA256` |

#### Returns

blobs.

[transfer container][element-type JcatBlob]

Since: 0.1.0

### jcat_item_get_blob_by_kind ()

    JcatBlob *
    jcat_item_get_blob_by_kind (JcatItem *self,
                                JcatBlobKind kind,
                                GError **error);

Gets the item blobs by a specific kind.

#### Parameters

self | JcatItem |
kind | JcatBlobKind, e.g. `JCAT_BLOB_KIND_SHA256` |
error | GError, or `NULL` |

#### Returns

a blob, or `NULL`.

[transfer full]

Since: 0.2.0

### jcat_item_add_blob ()

    void
    jcat_item_add_blob (JcatItem *self,
                        JcatBlob *blob);

Adds a new blob to the item.

#### Parameters

self | JcatItem |
blob | JcatBlob |

Since: 0.1.0

### jcat_item_get_id ()

    const gchar *
    jcat_item_get_id (JcatItem *self);

Returns the item ID.

#### Parameters

self | JcatItem |

#### Returns

string.

[transfer none]

Since: 0.1.0

### jcat_item_add_alias_id ()

    void
    jcat_item_add_alias_id (JcatItem *self,
                            const gchar *id);

Adds an item alias ID. Alias IDs are matched when using functions such as `jcat_file_get_item_by_id()`.

#### Parameters

self | JcatItem |
id | An item ID alias, typically a file basename |

Since: 0.1.1

### jcat_item_remove_alias_id ()

    void
    jcat_item_remove_alias_id (JcatItem *self,
                               const gchar *id);

Removes an item alias ID.

#### Parameters

self | JcatItem |
id | An item ID alias, typically a file basename |

Since: 0.1.1

### jcat_item_get_alias_ids ()

    GPtrArray *
    jcat_item_get_alias_ids (JcatItem *self);

Gets the list of alias IDs.

#### Parameters

self | JcatItem |

#### Returns

array.

[transfer container][element-type utf8]

Since: 0.1.1

### jcat_item_has_target ()

    gboolean
    jcat_item_has_target (JcatItem *self);

Finds out if any of the blobs are targeting an internal checksum. If this returns with success then the caller might be able to use functions like `jcat_context_verify_target()` supplying some target checksums.

#### Parameters

self | JcatItem |

#### Returns

`TRUE` on success

Since: 0.2.0

## Types and Values

### JCAT_TYPE_ITEM

    #define JCAT_TYPE_ITEM (jcat_item_get_type())

### struct JcatItemClass

    struct JcatItemClass {
    	GObjectClass parent_class;
    	gpointer padding[15];
    };

### JcatItem

    typedef struct _JcatItem JcatItem;