gtksource.file_saver

Module for [FileSaver] class

Types 3

Save a class@Buffer into a file.

A [gtksource.file_saver.FileSaver] object permits to save a class@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
GType _gType() @property
FileSaver self()Returns `this`, for use in `with` statements.
FileSaverGidBuilder builder()Get builder for [gtksource.file_saver.FileSaver] Returns: New builder object
gtksource.buffer.Buffer buffer() @propertyGet `buffer` property. Returns: The #GtkSourceBuffer to save. The #GtkSourceFileSaver object has a weak reference to the buffer.
gtksource.types.CompressionType compressionType() @propertyGet `compressionType` property. Returns: The compression type.
void compressionType(gtksource.types.CompressionType propval) @propertySet `compressionType` property. Params: propval = The compression type.
gtksource.encoding.Encoding encoding() @propertyGet `encoding` property. Returns: The file's encoding.
void encoding(gtksource.encoding.Encoding propval) @propertySet `encoding` property. Params: propval = The file's encoding.
gtksource.file.File file() @propertyGet `file` property. Returns: The #GtkSourceFile. The #GtkSourceFileSaver object has a weak reference to the file.
gtksource.types.FileSaverFlags flags() @propertyGet `flags` property. Returns: File saving flags.
void flags(gtksource.types.FileSaverFlags propval) @propertySet `flags` property. Params: propval = File saving flags.
gio.file.File location() @propertyGet `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() @propertyGet `newlineType` property. Returns: The newline type.
void newlineType(gtksource.types.NewlineType propval) @propertySet `newlineType` property. Params: propval = The newline type.
gtksource.file_saver.FileSaver newWithTarget(gtksource.buffer.Buffer buffer, gtksource.file.File file, gio.file.File targetLocation)Creates a new #GtkSourceFileSaver object with a target location.
void saveAsync(int ioPriority, gio.cancellable.Cancellable cancellable = null, gio.types.FileProgressCallback progressCallback = null, gio.types.AsyncReadyCallback callback = null)Saves 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)Sets the compression type. By default the compression type is taken from the #GtkSourceFile.
void setEncoding(gtksource.encoding.Encoding encoding = null)Sets the encoding. If encoding is null, the UTF-8 encoding will be set.
void setNewlineType(gtksource.types.NewlineType newlineType)Sets the newline type. By default the newline type is taken from the #GtkSourceFile.
Constructors
this(void * ptr, Flag!"Take" take)
this(gtksource.buffer.Buffer buffer, gtksource.file.File file)Creates a new #GtkSourceFileSaver object. The buffer will be saved to the `classFile`'s location.
Methods
T buffer(gtksource.buffer.Buffer propval)Set `buffer` property. Params: propval = The #GtkSourceBuffer to save. The #GtkSourceFileSaver object has a weak reference to the buffer. Returns: Builder instance for fluent chaining
T compressionType(gtksource.types.CompressionType propval)Set `compressionType` property. Params: propval = The compression type. Returns: Builder instance for fluent chaining
T encoding(gtksource.encoding.Encoding propval)Set `encoding` property. Params: propval = The file's encoding. Returns: Builder instance for fluent chaining
T file(gtksource.file.File propval)Set `file` property. Params: propval = The #GtkSourceFile. The #GtkSourceFileSaver object has a weak reference to the file. Returns: Builder instance for fluent chaining
T flags(gtksource.types.FileSaverFlags propval)Set `flags` property. Params: propval = File saving flags. Returns: Builder instance for fluent chaining
T location(gio.file.File propval)Set `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)Set `newlineType` property. Params: propval = The newline type. Returns: Builder instance for fluent chaining

Fluent builder for [gtksource.file_saver.FileSaver]

Methods