mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
file: add g_file_load_bytes()
This adds g_file_load_bytes() to make it more convenient to load the contents of a GFile as GBytes. It includes a special casing for gresources to increase the chances that the GBytes directly references the embedded data instead of copying to the heap. https://bugzilla.gnome.org/show_bug.cgi?id=790272
This commit is contained in:
16
gio/gfile.h
16
gio/gfile.h
@@ -1251,6 +1251,22 @@ gboolean g_file_replace_contents_finish (GFile *file,
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
gboolean g_file_supports_thread_contexts (GFile *file);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_56
|
||||
GBytes *g_file_load_bytes (GFile *file,
|
||||
GCancellable *cancellable,
|
||||
gchar **etag_out,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_2_56
|
||||
void g_file_load_bytes_async (GFile *file,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
GLIB_AVAILABLE_IN_2_56
|
||||
GBytes *g_file_load_bytes_finish (GFile *file,
|
||||
GAsyncResult *result,
|
||||
gchar **etag_out,
|
||||
GError **error);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __G_FILE_H__ */
|
||||
|
Reference in New Issue
Block a user