GtkSource.FileLoader
Description: Reference for GtkSource.FileLoader

### Class

# GtkSourceFileLoader

#### Description [src]

    final class GtkSource.FileLoader : GObject.Object {
      /* No available fields */
    }

Load a file into a GtkSourceBuffer.

A `GtkSourceFileLoader` object permits to load the contents of a `GFile` or a `GInputStream` into a `GtkSourceBuffer`.

A file loader should be used only for one load operation, including errors handling. If an error occurs, you can reconfigure the loader and relaunch the operation with `gtk_source_file_loader_load_async()`.

Running a `GtkSourceFileLoader` is an undoable action for the `GtkSourceBuffer`.

After a file loading, the buffer is reset to the contents provided by the `GFile` or `GInputStream`, so the buffer is set as “unmodified”, that is, `gtk_text_buffer_set_modified()` is called with `FALSE`. If the contents isn’t saved somewhere (for example if you load from stdin), then you should probably call `gtk_text_buffer_set_modified()` with `TRUE` after calling `gtk_source_file_loader_load_finish()`.

#### Hierarchy

#### Ancestors

- GObject

#### Constructors

###### gtk_source_file_loader_new

Creates a new `GtkSourceFileLoader` object. The contents is read from the `GtkSourceFile`‘s location.

###### gtk_source_file_loader_new_from_stream

Creates a new `GtkSourceFileLoader` object. The contents is read from `stream`.

#### Instance methods

###### gtk_source_file_loader_get_buffer

No description available.

###### gtk_source_file_loader_get_compression_type

No description available.

###### gtk_source_file_loader_get_encoding

No description available.

###### gtk_source_file_loader_get_file

No description available.

###### gtk_source_file_loader_get_input_stream

No description available.

###### gtk_source_file_loader_get_location

No description available.

###### gtk_source_file_loader_get_newline_type

No description available.

###### gtk_source_file_loader_load_async

Loads asynchronously the file or input stream contents into the `GtkSourceBuffer`.

###### gtk_source_file_loader_load_finish

Finishes a file loading started with `gtk_source_file_loader_load_async()`.

###### gtk_source_file_loader_set_candidate_encodings

Sets the candidate encodings for the file loading.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### GtkSource.FileLoader:buffer

The `GtkSourceBuffer` to load the contents into. The `GtkSourceFileLoader` object has a weak reference to the buffer.

###### GtkSource.FileLoader:file

The `GtkSourceFile`. The `GtkSourceFileLoader` object has a weak reference to the file.

###### GtkSource.FileLoader:input-stream

The `GInputStream` to load. Useful for reading stdin. If this property is set, the `GtkSourceFileLoader:location` property is ignored.

###### GtkSource.FileLoader:location

The `GFile` to load. If the `GtkSourceFileLoader:input-stream` is `NULL`, by default the location is taken from the `GtkSourceFile` at construction time.

#### Signals

##### Signals inherited from GObject (1)

###### GObject.Object::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GtkSourceFileLoaderClass {
      GObjectClass parent_class;

    }

###### Class members

`parent_class` |
    GObjectClass
| No description available.