![]() |
![]() |
![]() |
GPS04 Reference Manual | ![]() |
---|---|---|---|---|
#include <PS04-project-folder.h> PS04ProjectFolder; PS04ProjectFolder* ps04_project_folder_new (void); PS04ProjectFolder* ps04_project_folder_new_with_path (const char *path, GError **error); const GList* ps04_project_folder_get_items (const PS04ProjectFolder *self); const PS04ProjectFolderItem* ps04_project_folder_get_item_with_number (const PS04ProjectFolder *self, guint number); PS04ProjectFolderItem* ps04_project_folder_get_nth_item (PS04ProjectFolder *self, guint index); const char* ps04_project_folder_get_path (const PS04ProjectFolder *self); void ps04_project_folder_set_path (PS04ProjectFolder *self, const char *path); void ps04_project_folder_update (PS04ProjectFolder *self, GError **error);
This class represents a folder of projects, such as the memory card of the PS-04. Each project is represented by a PS04ProjectFolderItem, which can be displayed for example in a browser.
Create a folder with ps04_project_folder_new()
, giving it
a directory path. Scan the directory with ps04_project_folder_update()
,
then retrieve the items with ps04_project_folder_get_items()
, to get
the entire list, or ps04_project_folder_get_nth_item()
to get a single
item.
PS04ProjectFolder* ps04_project_folder_new (void);
Creates a new project folder.
Returns : | a PS04ProjectFolder. |
PS04ProjectFolder* ps04_project_folder_new_with_path (const char *path, GError **error);
Creates a new project folder with the specified path
.
path : |
The path of the new folder. |
error : |
A placeholder for a GError, or NULL .
|
Returns : | a PS04ProjectFolder. |
const GList* ps04_project_folder_get_items (const PS04ProjectFolder *self);
Gets the folder items as a GList.
self : |
a PS04ProjectFolder. |
Returns : | a GList of PS04ProjectFolderItem, or NULL if the folder
is empty. The list is owned by the class and must not be
changed or freed.
|
const PS04ProjectFolderItem* ps04_project_folder_get_item_with_number (const PS04ProjectFolder *self, guint number);
self : |
|
number : |
|
Returns : |
PS04ProjectFolderItem* ps04_project_folder_get_nth_item (PS04ProjectFolder *self, guint index);
Gets the nth item of the folder.
self : |
a PS04ProjectFolder. |
index : |
the index of the item to get. |
Returns : | a PS04ProjectFolderItem. |
const char* ps04_project_folder_get_path (const PS04ProjectFolder *self);
Gets the directory path of the folder.
self : |
a PS04ProjectFolder. |
Returns : | the path string. |
void ps04_project_folder_set_path (PS04ProjectFolder *self, const char *path);
Sets the directory path of the folder. This function also calls
ps04_project_folder_update()
, ignoring errors.
self : |
a PS04ProjectFolder. |
path : |
the new directory path. |
void ps04_project_folder_update (PS04ProjectFolder *self, GError **error);
Updates the list of projects in the folder and emits a
changed
signal. If an error occurs, error
is set.
self : |
a PS04ProjectFolder. |
error : |
a placeholder for a GError, or NULL .
|
void user_function (PS04ProjectFolder *arg0, gpointer user_data) : Run last
This signal is emitted whenever the contents of the folder have changed.
user_data : |
user data set when the signal handler was connected. |