gtksource.file_saver
Module for [FileSaver] class
Types 3
Save a gtksource.buffer.Buffer into a file.
A gtksource.file_saver.FileSaver object permits to save a gtksource.buffer.Buffer into a gio.file.File.
A file saver should be used only for one save operation, including errors handling. If an error occurs, you can reconfigure the saver and relaunch the operation with gtksource.file_saver.FileSaver.saveAsync.
Methods
FileSaverGidBuilder builder() static nothrowGet builder for [gtksource.file_saver.FileSaver] Returns: New builder objectgtksource.buffer.Buffer buffer() @property nothrowGet `buffer` property. Returns: The #GtkSourceBuffer to save. The #GtkSourceFileSaver object has a weak reference to the buffer.gtksource.types.CompressionType compressionType() @property nothrowGet `compressionType` property. Returns: The compression type.void compressionType(gtksource.types.CompressionType propval) @property nothrowSet `compressionType` property. Params: propval = The compression type.gtksource.encoding.Encoding encoding() @property nothrowGet `encoding` property. Returns: The file's encoding.void encoding(gtksource.encoding.Encoding propval) @property nothrowSet `encoding` property. Params: propval = The file's encoding.gtksource.file.File file() @property nothrowGet `file` property. Returns: The #GtkSourceFile. The #GtkSourceFileSaver object has a weak reference to the file.gtksource.types.FileSaverFlags flags() @property nothrowGet `flags` property. Returns: File saving flags.void flags(gtksource.types.FileSaverFlags propval) @property nothrowSet `flags` property. Params: propval = File saving flags.gio.file.File location() @property nothrowGet `location` property. Returns: The #GFile where to save the buffer. By default the location is taken from the #GtkSourceFile at construction time.gtksource.types.NewlineType newlineType() @property nothrowGet `newlineType` property. Returns: The newline type.void newlineType(gtksource.types.NewlineType propval) @property nothrowSet `newlineType` property. Params: propval = The newline type.gtksource.file_saver.FileSaver newWithTarget(gtksource.buffer.Buffer buffer, gtksource.file.File file, gio.file.File targetLocation) static nothrowCreates a new #GtkSourceFileSaver object with a target location.gtksource.buffer.Buffer getBuffer() nothrowgtksource.encoding.Encoding getEncoding() nothrowgtksource.file.File getFile() nothrowgtksource.types.FileSaverFlags getFlags() nothrowgio.file.File getLocation() nothrowgtksource.types.NewlineType getNewlineType() nothrowvoid saveAsync(int ioPriority, gio.cancellable.Cancellable cancellable = null, gio.types.FileProgressCallback progressCallback = null, gio.types.AsyncReadyCallback callback = null) nothrowSaves asynchronously the buffer into the file.bool saveFinish(gio.async_result.AsyncResult result)Finishes a file saving started with [gtksource.file_saver.FileSaver.saveAsync].void setCompressionType(gtksource.types.CompressionType compressionType) nothrowSets the compression type. By default the compression type is taken from the #GtkSourceFile.void setEncoding(gtksource.encoding.Encoding encoding = null) nothrowSets the encoding. If encoding is null, the UTF-8 encoding will be set.void setFlags(gtksource.types.FileSaverFlags flags) nothrowvoid setNewlineType(gtksource.types.NewlineType newlineType) nothrowSets the newline type. By default the newline type is taken from the #GtkSourceFile.Constructors
this(gtksource.buffer.Buffer buffer, gtksource.file.File file)Creates a new #GtkSourceFileSaver object. The buffer will be saved to the [gtksource.file.File]'s location.Fluent builder implementation template for gtksource.file_saver.FileSaver
Methods
T buffer(gtksource.buffer.Buffer propval) nothrowSet `buffer` property. Params: propval = The #GtkSourceBuffer to save. The #GtkSourceFileSaver object has a weak reference to the buffer. Returns: Builder instance for fluent chainingT compressionType(gtksource.types.CompressionType propval) nothrowSet `compressionType` property. Params: propval = The compression type. Returns: Builder instance for fluent chainingT encoding(gtksource.encoding.Encoding propval) nothrowSet `encoding` property. Params: propval = The file's encoding. Returns: Builder instance for fluent chainingT file(gtksource.file.File propval) nothrowSet `file` property. Params: propval = The #GtkSourceFile. The #GtkSourceFileSaver object has a weak reference to the file. Returns: Builder instance for fluent chainingT flags(gtksource.types.FileSaverFlags propval) nothrowSet `flags` property. Params: propval = File saving flags. Returns: Builder instance for fluent chainingT location(gio.file.File propval) nothrowSet `location` property. Params: propval = The #GFile where to save the buffer. By default the location is taken from the #GtkSourceFile at construction time. Returns: Builder instance for fluent c...T newlineType(gtksource.types.NewlineType propval) nothrowSet `newlineType` property. Params: propval = The newline type. Returns: Builder instance for fluent chainingFluent builder for gtksource.file_saver.FileSaver