GUPnPDIDLLiteWriter

GUPnPDIDLLiteWriter — DIDL-Lite fragment writer

Synopsis

                    GUPnPDIDLLiteWriter;
GUPnPDIDLLiteWriter* gupnp_didl_lite_writer_new         (void);
void                gupnp_didl_lite_writer_start_didl_lite
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *lang,
                                                         SoupURI *url_base,
                                                         gboolean need_escape);
void                gupnp_didl_lite_writer_end_didl_lite
                                                        (GUPnPDIDLLiteWriter *writer);
void                gupnp_didl_lite_writer_start_container
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *id,
                                                         const char *parent_id,
                                                         int child_count,
                                                         gboolean restricted,
                                                         gboolean searchable);
void                gupnp_didl_lite_writer_end_container
                                                        (GUPnPDIDLLiteWriter *writer);
void                gupnp_didl_lite_writer_start_item   (GUPnPDIDLLiteWriter *writer,
                                                         const char *id,
                                                         const char *parent_id,
                                                         const char *ref_id,
                                                         gboolean restricted);
void                gupnp_didl_lite_writer_end_item     (GUPnPDIDLLiteWriter *writer);
void                gupnp_didl_lite_writer_add_res      (GUPnPDIDLLiteWriter *writer,
                                                         GUPnPDIDLLiteResource *res);
void                gupnp_didl_lite_writer_add_desc     (GUPnPDIDLLiteWriter *writer,
                                                         const char *desc,
                                                         const char *id,
                                                         const char *type,
                                                         const char *ns_uri);
void                gupnp_didl_lite_writer_add_string   (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value);
void                gupnp_didl_lite_writer_add_string_with_attrs
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value,
                                                         ...);
void                gupnp_didl_lite_writer_add_string_with_attrs_valist
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value,
                                                         va_list var_args);
void                gupnp_didl_lite_writer_add_boolean  (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         gboolean value);
void                gupnp_didl_lite_writer_add_int      (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         int value);
void                gupnp_didl_lite_writer_add_uint     (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         guint value);
void                gupnp_didl_lite_writer_add_long     (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         long value );
const char*         gupnp_didl_lite_writer_get_string   (GUPnPDIDLLiteWriter *writer);
void                gupnp_didl_lite_writer_reset        (GUPnPDIDLLiteWriter *writer);

Description

GUPnPDIDLLiteWriter is a helper class for writing DIDL-Lite fragments.

Details

GUPnPDIDLLiteWriter

typedef struct {
        GObject parent;

        GUPnPDIDLLiteWriterPrivate *priv;
} GUPnPDIDLLiteWriter;


gupnp_didl_lite_writer_new ()

GUPnPDIDLLiteWriter* gupnp_didl_lite_writer_new         (void);

Returns : A new GUPnPDIDLLiteWriter object.

gupnp_didl_lite_writer_start_didl_lite ()

void                gupnp_didl_lite_writer_start_didl_lite
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *lang,
                                                         SoupURI *url_base,
                                                         gboolean need_escape);

Starts the DIDL-Lite element.

writer : A GUPnPDIDLLiteWriter
lang : The language the DIDL-Lite fragment is in, or NULL
url_base : A SoupURI specifying the URI relative to which incoming URI are resolved, or NULL
need_escape : TRUE to force writer to escape incoming string data

gupnp_didl_lite_writer_end_didl_lite ()

void                gupnp_didl_lite_writer_end_didl_lite
                                                        (GUPnPDIDLLiteWriter *writer);

Closes the DIDL-Lite element.

writer : A GUPnPDIDLLiteWriter

gupnp_didl_lite_writer_start_container ()

void                gupnp_didl_lite_writer_start_container
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *id,
                                                         const char *parent_id,
                                                         int child_count,
                                                         gboolean restricted,
                                                         gboolean searchable);

Starts a new container element.

writer : A GUPnPDIDLLiteWriter
id : The object ID
parent_id : The parent object ID
child_count : The number of children or -1
restricted : TRUE if this container is restricted
searchable : TRUE if this container is searchable

gupnp_didl_lite_writer_end_container ()

void                gupnp_didl_lite_writer_end_container
                                                        (GUPnPDIDLLiteWriter *writer);

Closes the current container element.

writer : A GUPnPDIDLLiteWriter

gupnp_didl_lite_writer_start_item ()

void                gupnp_didl_lite_writer_start_item   (GUPnPDIDLLiteWriter *writer,
                                                         const char *id,
                                                         const char *parent_id,
                                                         const char *ref_id,
                                                         gboolean restricted);

Starts a new item element.

writer : A GUPnPDIDLLiteWriter
id : The object ID
parent_id : The parent object ID
ref_id : The RefID, or NULL
restricted : TRUE if this item is restricted

gupnp_didl_lite_writer_end_item ()

void                gupnp_didl_lite_writer_end_item     (GUPnPDIDLLiteWriter *writer);

Closes the current item element.

writer : A GUPnPDIDLLiteWriter

gupnp_didl_lite_writer_add_res ()

void                gupnp_didl_lite_writer_add_res      (GUPnPDIDLLiteWriter *writer,
                                                         GUPnPDIDLLiteResource *res);

Adds a new res (resource) element with the parameters specified in res. Note that in order to ignore a numerical field it has to be set to -1.

writer : A GUPnPDIDLLiteWriter
res : A pointer to a GUPnPDIDLLiteResource structure

gupnp_didl_lite_writer_add_desc ()

void                gupnp_didl_lite_writer_add_desc     (GUPnPDIDLLiteWriter *writer,
                                                         const char *desc,
                                                         const char *id,
                                                         const char *type,
                                                         const char *ns_uri);

Adds a new desc (description) element.

writer : A GUPnPDIDLLiteWriter
desc : The description text
id : The object ID
type : The description type, or NULL
ns_uri : The namespace of (possible) child elements, or NULL

gupnp_didl_lite_writer_add_string ()

void                gupnp_didl_lite_writer_add_string   (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value);

Adds a new string property.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value

gupnp_didl_lite_writer_add_string_with_attrs ()

void                gupnp_didl_lite_writer_add_string_with_attrs
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value,
                                                         ...);

Adds a new string property with attributes.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value
... : A NULL terminated list of attribute name-attribute value string pairs.

gupnp_didl_lite_writer_add_string_with_attrs_valist ()

void                gupnp_didl_lite_writer_add_string_with_attrs_valist
                                                        (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         const char *value,
                                                         va_list var_args);

Adds a new string property with attributes.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value
var_args : A va_list with attribute name-attribute value string pairs

gupnp_didl_lite_writer_add_boolean ()

void                gupnp_didl_lite_writer_add_boolean  (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         gboolean value);

Adds a new boolean property.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value

gupnp_didl_lite_writer_add_int ()

void                gupnp_didl_lite_writer_add_int      (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         int value);

Adds a new integer property.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value

gupnp_didl_lite_writer_add_uint ()

void                gupnp_didl_lite_writer_add_uint     (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         guint value);

Adds a new unsigned integer property.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
value : The property value

gupnp_didl_lite_writer_add_long ()

void                gupnp_didl_lite_writer_add_long     (GUPnPDIDLLiteWriter *writer,
                                                         const char *property,
                                                         const char *prefix,
                                                         const char *ns_uri,
                                                         long value );

Adds a new long integer property.

writer : A GUPnPDIDLLiteWriter
property : The property name
prefix : The property namespace prefix, or NULL
ns_uri : The namespace URI to be used, or NULL
Param5 :

gupnp_didl_lite_writer_get_string ()

const char*         gupnp_didl_lite_writer_get_string   (GUPnPDIDLLiteWriter *writer);

Returns a pointer the generated DIDL-Lite string.

writer : A GUPnPDIDLLiteWriter
Returns : The generated DIDL-Lite string.

gupnp_didl_lite_writer_reset ()

void                gupnp_didl_lite_writer_reset        (GUPnPDIDLLiteWriter *writer);

Resets writer.

writer : A GUPnPDIDLLiteWriter