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:
Christian Hergert
2017-11-12 19:55:52 -08:00
parent 5464461e4c
commit 2227918dfd
3 changed files with 207 additions and 0 deletions

View File

@@ -184,6 +184,9 @@ g_file_mount_enclosing_volume_finish
g_file_monitor_directory
g_file_monitor_file
g_file_monitor
g_file_load_bytes
g_file_load_bytes_async
g_file_load_bytes_finish
g_file_load_contents
g_file_load_contents_async
g_file_load_contents_finish