Tells the fs which functions to use for file download or file deletion.
Typically, a camera driver would call this function on initialization.
A function can be NULL indicating that this functionality is not supported.
For example, if a camera does not support file deletion, you would supply
NULL for del_file_func.
Tells the filesystem which functions to call when file information
about a file should be retrieved or set. Typically, this function will
get called by the camera driver on initialization.
Tells the filesystem which functions to call for file upload, deletion
of all files in a given folder, creation or removal of a folder.
Typically, a camera driver would call this function on initialization.
If one functionality is not supported, NULL can be supplied.
If you don't call this function, the fs will assume that neither
of these features is supported.
The fs will try to compensate missing delete_all_func
functionality with the delete_file_func if such a function has been
supplied.
Tells the fs which functions to use to retrieve listings of folders
and/or files. Typically, a camera driver would call this function
on initialization. Each function can be NULL indicating that this
functionality is not supported. For example, many cameras don't support
folders. In this case, you would supply NULL for folder_list_func. Then,
the fs assumes that there is only a root folder.
Generates a list of subfolders of the supplied folder either using
cached values (if there are any) or the folder_list_func if it has been
supplied previously. If not, it is assumed that only a root folder
exists (which is the case for many cameras).
Downloads the file called filename from the folder using the
get_file_func if such a function has been previously supplied. If the
file has been previously downloaded, the file is retrieved from cache.
Uploads a file to the camera if a put_file_func has been previously
supplied to the fs. If the upload is successful, the file will get
cached in the fs.
If a delete_file_func has been supplied to the fs, this function will
be called and, if this function returns without error, the file will be
removed from the fs.
int gp_filesystem_delete_all (CameraFilesystem *fs,
const char *folder,
GPContext *context);
Deletes all files in the given folder from the fs. If the fs has not
been supplied with a delete_all_func, it tries to delete the files
one by one using the delete_file_func. If that function has not been
supplied neither, an error is returned.
Searches a file called filename in the fs and returns the first
occurrency. This functionality is needed for camera drivers that cannot
figure out where a file gets created after capturing an image although the
name of the image is known. Usually, those drivers will call
gp_filesystem_reset in order to tell the fs that something has
changed and then gp_filesystem_get_folder in order to find the file.
Tells the fs that there is a file called filename in folder
called folder. Usually, camera drivers will call this function after
capturing an image in order to tell the fs about the new file.
A front-end should not use this function.
Tells the fs about a file. Typically, camera drivers will call this
function in case they get information about a file (i.e. preview) "for free"
on gp_camera_capture or gp_camera_folder_list_files.