Add GIOStream operations to GFile

g_file_open_readwrite, g_file_create_readwrite, g_file_replace_readwrite
and async variants, with default implementations using threads.
This commit is contained in:
Alexander Larsson
2009-05-13 13:00:26 +02:00
parent bd0b8c60c2
commit 7a2d4889b5
2 changed files with 749 additions and 0 deletions

View File

@@ -431,6 +431,48 @@ struct _GFileIface
GFileMonitorFlags flags,
GCancellable *cancellable,
GError **error);
GFileIOStream * (* open_readwrite) (GFile *file,
GCancellable *cancellable,
GError **error);
void (* open_readwrite_async) (GFile *file,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GFileIOStream * (* open_readwrite_finish) (GFile *file,
GAsyncResult *res,
GError **error);
GFileIOStream * (* create_readwrite) (GFile *file,
GFileCreateFlags flags,
GCancellable *cancellable,
GError **error);
void (* create_readwrite_async) (GFile *file,
GFileCreateFlags flags,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GFileIOStream * (* create_readwrite_finish) (GFile *file,
GAsyncResult *res,
GError **error);
GFileIOStream * (* replace_readwrite) (GFile *file,
const char *etag,
gboolean make_backup,
GFileCreateFlags flags,
GCancellable *cancellable,
GError **error);
void (* replace_readwrite_async) (GFile *file,
const char *etag,
gboolean make_backup,
GFileCreateFlags flags,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GFileIOStream * (* replace_readwrite_finish) (GFile *file,
GAsyncResult *res,
GError **error);
};
GType g_file_get_type (void) G_GNUC_CONST;
@@ -517,6 +559,47 @@ void g_file_replace_async (GFile
GFileOutputStream * g_file_replace_finish (GFile *file,
GAsyncResult *res,
GError **error);
GFileIOStream * g_file_open_readwrite (GFile *file,
GCancellable *cancellable,
GError **error);
void g_file_open_readwrite_async (GFile *file,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GFileIOStream * g_file_open_readwrite_finish (GFile *file,
GAsyncResult *res,
GError **error);
GFileIOStream * g_file_create_readwrite (GFile *file,
GFileCreateFlags flags,
GCancellable *cancellable,
GError **error);
void g_file_create_readwrite_async (GFile *file,
GFileCreateFlags flags,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GFileIOStream * g_file_create_readwrite_finish (GFile *file,
GAsyncResult *res,
GError **error);
GFileIOStream * g_file_replace_readwrite (GFile *file,
const char *etag,
gboolean make_backup,
GFileCreateFlags flags,
GCancellable *cancellable,
GError **error);
void g_file_replace_readwrite_async (GFile *file,
const char *etag,
gboolean make_backup,
GFileCreateFlags flags,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GFileIOStream * g_file_replace_readwrite_finish (GFile *file,
GAsyncResult *res,
GError **error);
gboolean g_file_query_exists (GFile *file,
GCancellable *cancellable);
GFileType g_file_query_file_type (GFile *file,