]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: Add GLib.File.set_contents_full() binding (since 2.66)
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 1 Aug 2020 14:21:11 +0000 (16:21 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 1 Aug 2020 14:22:01 +0000 (16:22 +0200)
vapi/glib-2.0.vapi

index 38d1872d906395f80e8e5ccd3003abb2c4fc4126..d158122a0dcb50d3c71ea8a9c9ed9e20d6816438 100644 (file)
@@ -3863,6 +3863,8 @@ namespace GLib {
                public static bool get_contents (string filename, out string contents, out size_t length = null) throws FileError;
                [Version (since = "2.8")]
                public static bool set_contents (string filename, string contents, ssize_t length = -1) throws FileError;
+               [Version (since = "2.66")]
+               public static bool set_contents_full (string filename, string contents, ssize_t length = -1, FileSetContentsFlags flags = 0, int mode = 0666) throws FileError;
                [CCode (cname = "g_file_get_contents")]
                public static bool get_data (string filename, [CCode (type = "gchar**", array_length_type = "size_t")] out uint8[] contents) throws FileError;
                [CCode (cname = "g_file_set_contents")]
@@ -3904,6 +3906,16 @@ namespace GLib {
                public static bool close_checked (int fd) throws FileError;
        }
 
+       [Flags]
+       [Version (since = "2.66")]
+       [CCode (cprefix = "G_FILE_SET_CONTENTS_", has_type_id = false)]
+       public enum FileSetContentsFlags {
+               NONE,
+               CONSISTENT,
+               DURABLE,
+               ONLY_EXISTING
+       }
+
        [CCode (cname = "GStatBuf", cheader_filename = "glib/gstdio.h", has_type_id = false)]
        public struct Stat {
                public time_t st_atime;