DescriptionFile

## DescriptionFile DescriptionFile — Represents a device description document and offers methods for easy manipulation of those. |

## Synopsis

    #define             TYPE_DESCRIPTION_FILE
    void                description_file_set_device_type    (DescriptionFile *self,
                                                             const gchar *device_type);
    void                description_file_set_model_name     (DescriptionFile *self,
                                                             const gchar *model_name);
    void                description_file_set_model_number   (DescriptionFile *self,
                                                             const gchar *model_number);
    void                description_file_set_friendly_name  (DescriptionFile *self,
                                                             const gchar *friendly_name);
    gchar *             description_file_get_friendly_name  (DescriptionFile *self);
    void                description_file_modify_service_type
                                                            (DescriptionFile *self,
                                                             const gchar *old_type,
                                                             const gchar *new_type);
    void                description_file_save               (DescriptionFile *self,
                                                             const gchar *path,
                                                             GError **error);
    DescriptionFile *   description_file_new                (const gchar *template,
                                                             GError **error);
    DescriptionFile *   description_file_new_from_xml_document
                                                            (GUPnPXMLDoc *doc);
    struct              DescriptionFile;

## Object Hierarchy

      GObject
       +----DescriptionFile

## Description

## Details

### TYPE_DESCRIPTION_FILE

    #define TYPE_DESCRIPTION_FILE (description_file_get_type ())

The type for DescriptionFile.

### description_file_set_device_type ()

    void                description_file_set_device_type    (DescriptionFile *self,
                                                             const gchar *device_type);

Change the type of a service.

Usually used to modify the device version, e.g. default device type is "MediaServer:2" and device_type = "MediaServer:1".

`self` : | the DescriptionFile instance
`device_type` : | is the current content of serviceType. [in]

### description_file_set_model_name ()

    void                description_file_set_model_name     (DescriptionFile *self,
                                                             const gchar *model_name);

Modify the model name.

Usually the name of the software implementing this device.

`self` : | the DescriptionFile instance
`model_name` : | is the new model name. [in]

### description_file_set_model_number ()

    void                description_file_set_model_number   (DescriptionFile *self,
                                                             const gchar *model_number);

Modify the model number.

Usually the version of the software implementing this device.

`self` : | the DescriptionFile instance
`model_number` : | is the new model number. [in]

### description_file_set_friendly_name ()

    void                description_file_set_friendly_name  (DescriptionFile *self,
                                                             const gchar *friendly_name);

Set the friendly name of the device.

The friendly name is the one usually presented to the user in control points or DMPs

`self` : | the DescriptionFile instance
`friendly_name` : | is the new friendly name of the device. [in]

### description_file_get_friendly_name ()

    gchar *             description_file_get_friendly_name  (DescriptionFile *self);

Get the current friendly name of the device.

`self` : | the DescriptionFile instance
Returns : | The currenly set friendly name.

### description_file_modify_service_type ()

    void                description_file_modify_service_type
                                                            (DescriptionFile *self,
                                                             const gchar *old_type,
                                                             const gchar *new_type);

Change the type of a service.

Usually used to modify the service version, e.g. old_type = "ContentDirectory:2" and new_type = "ContentDirectory:1".

`self` : | the DescriptionFile instance
`old_type` : | is the current content of serviceType. [in]
`new_type` : | is the content serviceType will be set to. [in]

### description_file_save ()

    void                description_file_save               (DescriptionFile *self,
                                                             const gchar *path,
                                                             GError **error);

Writes the current document to a file.

It makes sure that the resulting file has the correct UTF-8 encoding and does not have any kind of newlines. This is necessary as some devices with broken XML parsers can't cope with UNIX newlines. If a file with the same name exists it will be overwritten.

`self` : | the DescriptionFile instance
`path` : | is a path to a file. [in]
`error` : | location to store the error occuring, or `NULL` to ignore

### description_file_new ()

    DescriptionFile *   description_file_new                (const gchar *template,
                                                             GError **error);

Constructor to load a description file from disk

`template` : | the path to the description file. [in]
`error` : | location to store the error occuring, or `NULL` to ignore

### description_file_new_from_xml_document ()

    DescriptionFile *   description_file_new_from_xml_document
                                                            (GUPnPXMLDoc *doc);

Constructor which wraps an existing GUPnP.XMLDoc as a description file.

`doc` : | is the GUPnP.XMLDoc to wrap. [in]

### struct DescriptionFile

    struct DescriptionFile;

Represents a device description document and offers methods for easy manipulation of those.