FileSaver

open class FileSaver(pointer: <Error class: unknown class><<Error class: unknown class>>)

Save a class@Buffer into a file.

A GtkSourceFileSaver object permits to save a class@Buffer into a iface@Gio.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 method@FileSaver.save_async.

Skipped during bindings generation

  • parameter callback: Gio.AsyncReadyCallback

  • method encoding: Property TypeInfo of getter and setter do not match

Constructors

Link copied to clipboard
constructor(buffer: Buffer, file: File)

Creates a new #GtkSourceFileSaver object. The @buffer will be saved to the class@File's location.

constructor(buffer: Buffer, file: File, targetLocation: <Error class: unknown class>)

Creates a new #GtkSourceFileSaver object with a target location.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val buffer: Buffer

The #GtkSourceBuffer to save. The #GtkSourceFileSaver object has a weak reference to the buffer.

Link copied to clipboard

The compression type.

Link copied to clipboard
open val file: File

The #GtkSourceFile. The #GtkSourceFileSaver object has a weak reference to the file.

Link copied to clipboard

File saving flags.

Link copied to clipboard
val gtksourceFileSaverPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val location: <Error class: unknown class>

The #GFile where to save the buffer. By default the location is taken from the #GtkSourceFile at construction time.

Link copied to clipboard

The newline type.

Functions

Link copied to clipboard
open fun getBuffer(): Buffer
Link copied to clipboard
Link copied to clipboard
open fun getEncoding(): Encoding
Link copied to clipboard
open fun getFile(): File
Link copied to clipboard
Link copied to clipboard
open fun getLocation(): <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
open fun saveFinish(result: <Error class: unknown class>): <Error class: unknown class><Boolean>

Finishes a file saving started with method@FileSaver.save_async.

Link copied to clipboard
open fun setCompressionType(compressionType: CompressionType)

Sets the compression type. By default the compression type is taken from the #GtkSourceFile.

Link copied to clipboard
open fun setEncoding(encoding: Encoding? = null)

Sets the encoding. If @encoding is null, the UTF-8 encoding will be set.

Link copied to clipboard
open fun setFlags(flags: FileSaverFlags)
Link copied to clipboard
open fun setNewlineType(newlineType: NewlineType)

Sets the newline type. By default the newline type is taken from the #GtkSourceFile.