GUPnPCDSLastChangeParser

## GUPnPCDSLastChangeParser GUPnPCDSLastChangeParser — LastChange parser for the format used in CDS:3 |

## Synopsis

    struct              GUPnPCDSLastChangeParser;
    enum                GUPnPCDSLastChangeEvent;
                        GUPnPCDSLastChangeEntry;
    GUPnPCDSLastChangeParser * gupnp_cds_last_change_parser_new
                                                            (void);
    GList *             gupnp_cds_last_change_parser_parse  (GUPnPCDSLastChangeParser *parser,
                                                             const char *last_change,
                                                             GError **error);
    GUPnPCDSLastChangeEntry * gupnp_cds_last_change_entry_ref
                                                            (GUPnPCDSLastChangeEntry *entry);
    void                gupnp_cds_last_change_entry_unref   (GUPnPCDSLastChangeEntry *entry);
    GUPnPCDSLastChangeEvent gupnp_cds_last_change_entry_get_event
                                                            (GUPnPCDSLastChangeEntry *entry);
    const char *        gupnp_cds_last_change_entry_get_object_id
                                                            (GUPnPCDSLastChangeEntry *entry);
    const char *        gupnp_cds_last_change_entry_get_parent_id
                                                            (GUPnPCDSLastChangeEntry *entry);
    const char *        gupnp_cds_last_change_entry_get_class
                                                            (GUPnPCDSLastChangeEntry *entry);
    gboolean            gupnp_cds_last_change_entry_is_subtree_update
                                                            (GUPnPCDSLastChangeEntry *entry);
    guint32             gupnp_cds_last_change_entry_get_update_id
                                                            (GUPnPCDSLastChangeEntry *entry);

## Object Hierarchy

      GObject
       +----GUPnPCDSLastChangeParser

      GBoxed
       +----GUPnPCDSLastChangeEntry

## Description

GUPnPCDSLastChangeParser parses XML strings from CDS's LastChange state variable.

## Details

### struct GUPnPCDSLastChangeParser

    struct GUPnPCDSLastChangeParser;

### enum GUPnPCDSLastChangeEvent

    typedef enum {
            GUPNP_CDS_LAST_CHANGE_EVENT_INVALID,
            GUPNP_CDS_LAST_CHANGE_EVENT_OBJECT_ADDED,
            GUPNP_CDS_LAST_CHANGE_EVENT_OBJECT_REMOVED,
            GUPNP_CDS_LAST_CHANGE_EVENT_OBJECT_MODIFIED,
            GUPNP_CDS_LAST_CHANGE_EVENT_ST_DONE
    } GUPnPCDSLastChangeEvent;

`GUPNP_CDS_LAST_CHANGE_EVENT_INVALID` | Invalid GUPnPCDSLastChangeEntry.
`GUPNP_CDS_LAST_CHANGE_EVENT_OBJECT_ADDED` | The GUPnPCDSLastChangeEntry is an object added event.
`GUPNP_CDS_LAST_CHANGE_EVENT_OBJECT_REMOVED` | The GUPnPCDSLastChangeEntry is an object removal event.
`GUPNP_CDS_LAST_CHANGE_EVENT_OBJECT_MODIFIED` | The GUPnPCDSLastChangeEntry is an object modification event.
`GUPNP_CDS_LAST_CHANGE_EVENT_ST_DONE` | The GUPnPCDSLastChangeEntry is a subtree update done event.

### GUPnPCDSLastChangeEntry

    typedef struct _GUPnPCDSLastChangeEntry GUPnPCDSLastChangeEntry;

Opaque struct which contains information about the event.

### gupnp_cds_last_change_parser_new ()

    GUPnPCDSLastChangeParser * gupnp_cds_last_change_parser_new
                                                            (void);

Create a new GUPnPCDSLastChangeParser.

This parser is able to parse LastChange as defined in the ContentDirectory:3 specification.

Returns : | A new instance of GUPnPCDSLastChangeParser. [transfer full]

### gupnp_cds_last_change_parser_parse ()

    GList *             gupnp_cds_last_change_parser_parse  (GUPnPCDSLastChangeParser *parser,
                                                             const char *last_change,
                                                             GError **error);

Parse a LastChange XML document in the flavor defined by the ContentDirectory:3 specification.

`parser` : | GUPnPCDSLastChangeParser
`last_change` : | XML string to parse
`error` : | Return value for parser error or `NULL` to ingore
Returns : | List of GUPnPCDSLastChangeEntrys. [element-type GUPnPCDSLastChangeEntry][transfer full]

### gupnp_cds_last_change_entry_ref ()

    GUPnPCDSLastChangeEntry * gupnp_cds_last_change_entry_ref
                                                            (GUPnPCDSLastChangeEntry *entry);

Increase reference count of a GUPnPCDSLastChangeEntry.

`entry` : | A GUPnPCDSLastChangeEntry
Returns : | The object passed in `entry`. [transfer full]

### gupnp_cds_last_change_entry_unref ()

    void                gupnp_cds_last_change_entry_unref   (GUPnPCDSLastChangeEntry *entry);

Decrease reference count of a GUPnPCDSLastChangeEntry. If the reference count drops to 0, `entry` is freed.

`entry` : | A GUPnPCDSLastChangeEntry

### gupnp_cds_last_change_entry_get_event ()

    GUPnPCDSLastChangeEvent gupnp_cds_last_change_entry_get_event
                                                            (GUPnPCDSLastChangeEntry *entry);

Get the type of the last change entry as defined in GUPnPCDSLastChangeEvent.

`entry` : | A GUPnPCDSLastChangeEntry
Returns : | An event from the GUPnPCDSLastChangeEvent or `GUPNP_CDS_LAST_CHANGE_EVENT_INVALID` if the entry is not valid.

### gupnp_cds_last_change_entry_get_object_id ()

    const char *        gupnp_cds_last_change_entry_get_object_id
                                                            (GUPnPCDSLastChangeEntry *entry);

Get the ID of the object in this change entry.

`entry` : | A GUPnPCDSLastChangeEntry
Returns : | The id of the object of this entry. [transfer none]

### gupnp_cds_last_change_entry_get_parent_id ()

    const char *        gupnp_cds_last_change_entry_get_parent_id
                                                            (GUPnPCDSLastChangeEntry *entry);

Get the parent object id of the object in this change entry. This is only valid if `gupnp_cds_last_change_entry_get_event()` returns `GUPNP_CDS_LAST_CHANGE_EVENT_OBJECT_ADDED`.

`entry` : | A GUPnPCDSLastChangeEntry
Returns : | The id of the object's parent of this entry. [transfer none]

### gupnp_cds_last_change_entry_get_class ()

    const char *        gupnp_cds_last_change_entry_get_class
                                                            (GUPnPCDSLastChangeEntry *entry);

Get the class of the object in this change entry. This is only valid if `gupnp_cds_last_change_entry_get_event()` returns `GUPNP_CDS_LAST_CHANGE_EVENT_OBJECT_ADDED`.

`entry` : | A GUPnPCDSLastChangeEntry
Returns : | The upnp class of the object of this entry. [transfer none]

### gupnp_cds_last_change_entry_is_subtree_update ()

    gboolean            gupnp_cds_last_change_entry_is_subtree_update
                                                            (GUPnPCDSLastChangeEntry *entry);

Returns whether this entry is part of a subtree update.

`entry` : | A GUPnPCDSLastChangeEntry
Returns : | `TRUE`, if the entry is part of a subtree update, `FALSE` otherwise.

### gupnp_cds_last_change_entry_get_update_id ()

    guint32             gupnp_cds_last_change_entry_get_update_id
                                                            (GUPnPCDSLastChangeEntry *entry);

Get the update id of the last change entry.

`entry` : | A GUPnPCDSLastChangeEntry
Returns : | update id of the entry or 0 if the entry is not valid.