## EntangleCameraFile

EntangleCameraFile — a file downloaded from a camera

## Functions

EntangleCameraFile * | entangle_camera_file_new ()
const char * | entangle_camera_file_get_folder ()
const char * | entangle_camera_file_get_name ()
gboolean | entangle_camera_file_save_path ()
gboolean | entangle_camera_file_save_uri ()
GByteArray * | entangle_camera_file_get_data ()
void | entangle_camera_file_set_data ()
const gchar * | entangle_camera_file_get_mimetype ()
void | entangle_camera_file_set_mimetype ()

## Properties

GByteArray * | data | Read / Write
char * | folder | Read / Write / Construct Only
char * | mimetype | Read / Write
char * | name | Read / Write / Construct Only

## Types and Values

#define | ENTANGLE_TYPE_CAMERA_FILE
| EntangleCameraFile

## Object Hierarchy

        GObject
        ╰── EntangleCameraFile

## Description

The EntangleCameraFile object contains the metadata and payload of a file downloaded from the camera device.

## Functions

### entangle_camera_file_new ()

    EntangleCameraFile *
    entangle_camera_file_new (const char *folder,
                              const char *name);

### entangle_camera_file_get_folder ()

    const char *
    entangle_camera_file_get_folder (EntangleCameraFile *file);

Get the path of the folder on the camera which stores the file

#### Parameters

file | the camera file instance. | [transfer none]

#### Returns

the folder path.

[transfer none]

### entangle_camera_file_get_name ()

    const char *
    entangle_camera_file_get_name (EntangleCameraFile *file);

Gets the name of the camera file, without any folder component

#### Parameters

file | the camera file instance. | [transfer none]

#### Returns

the file name.

[transfer none]

### entangle_camera_file_save_path ()

    gboolean
    entangle_camera_file_save_path (EntangleCameraFile *file,
                                    const char *localpath,
                                    GError **err);

Saves the content of the camera file to the local filesystem path identified by `localpath`

#### Parameters

file | the camera file. | [transfer none]
localpath | path on the local filesystem. | [transfer none]
err | a GError, or NULL |

#### Returns

TRUE if the file was saved, FALSE on error

### entangle_camera_file_save_uri ()

    gboolean
    entangle_camera_file_save_uri (EntangleCameraFile *file,
                                   const char *uri,
                                   GError **err);

Saves the content of the camera file to the virtual filesystem location identified by `uri` . `uri` can be any scheme for which a GVFS handler is present.

#### Parameters

file | the camera file. | [transfer none]
uri | virtual filesystem URI. | [transfer none]
err | a GError, or NULL |

#### Returns

TRUE if the file was saved, FALSE on error

### entangle_camera_file_get_data ()

    GByteArray *
    entangle_camera_file_get_data (EntangleCameraFile *file);

Get the raw data associated with the camera file

#### Parameters

file | the camera file instance. | [transfer none]

#### Returns

the camera data.

[transfer none]

### entangle_camera_file_set_data ()

    void
    entangle_camera_file_set_data (EntangleCameraFile *file,
                                   GByteArray *data);

Set the raw data for the camera file. If there was pre-existing data set this will be released. Passing NULL for `data` will clear the data completely. The contents of `data` will not be copied, instead a reference will be acquired. Thus any further changes to `data` by the caller will affect this object

#### Parameters

file | the camera file instance. | [transfer none]
data | the new data. | [transfer none][allow-none]

### entangle_camera_file_get_mimetype ()

    const gchar *
    entangle_camera_file_get_mimetype (EntangleCameraFile *file);

Get the mimetype of the camera file, as a string

#### Parameters

file | the camera file instance. | [transfer none]

#### Returns

the mime type or NULL.

[transfer none]

### entangle_camera_file_set_mimetype ()

    void
    entangle_camera_file_set_mimetype (EntangleCameraFile *file,
                                       const gchar *mimetype);

Set the mimetype of the data associated with the file. This replaces any previously set mime type. Passing in NULL for `mimetype` will clear the mime type information.

#### Parameters

file | the camera file instance. | [transfer none]
mimetype | the new mime type. | [transfer none][allow-none]

## Types and Values

### ENTANGLE_TYPE_CAMERA_FILE

    #define ENTANGLE_TYPE_CAMERA_FILE (entangle_camera_file_get_type())

### EntangleCameraFile

    typedef struct _EntangleCameraFile EntangleCameraFile;

## Property Details

### The `“data”` property

      “data”                     GByteArray *

Raw data for the file.

Owner: EntangleCameraFile

Flags: Read / Write

### The `“folder”` property

      “folder”                   char *

Folder name on the camera.

Owner: EntangleCameraFile

Flags: Read / Write / Construct Only

Default value: NULL

### The `“mimetype”` property

      “mimetype”                 char *

File mimetype on the camera.

Owner: EntangleCameraFile

Flags: Read / Write

Default value: NULL

### The `“name”` property

      “name”                     char *

File name on the camera.

Owner: EntangleCameraFile

Flags: Read / Write / Construct Only

Default value: NULL