Class: GtkSource::FileLoader
- Inherits:
-
Object
- Object
- GtkSource::FileLoader
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#buffer ⇒ GtkSource::Buffer
The Gtk::SourceBuffer to load the contents into.
-
#buffer=(buffer) ⇒ GtkSource::Buffer
The Gtk::SourceBuffer to load the contents into.
-
#candidate_encodings=(candidate_encodings) ⇒ nil
Sets the candidate encodings for the file loading.
-
#compression_type ⇒ GtkSource::CompressionType
The detected compression type.
-
#encoding ⇒ GtkSource::Encoding
The detected file encoding.
-
#file ⇒ GtkSource::File
The Gtk::SourceFile.
-
#file=(file) ⇒ GtkSource::File
The Gtk::SourceFile.
-
#initialize(buffer, file, stream) ⇒ GtkSource::FileLoader
constructor
Creates a new Gtk::SourceFileLoader object.
-
#input_stream ⇒ Gio::InputStream
The GInput::Stream to load.
-
#input_stream=(input_stream) ⇒ Gio::InputStream
The GInput::Stream to load.
-
#load_async(io_priority, cancellable, progress_callback, progress_callback_data, progress_callback_notify, callback, user_data) ⇒ nil
Loads asynchronously the file or input stream contents into the [classBuffer].
-
#load_finish(result) ⇒ Boolean
Finishes a file loading started with [methodFileLoader.load_async].
-
#location ⇒ Gio::File
The #GFile to load.
-
#location=(location) ⇒ Gio::File
The #GFile to load.
-
#newline_type ⇒ GtkSource::NewlineType
The detected newline type.
Constructor Details
#initialize(buffer, file, stream) ⇒ GtkSource::FileLoader
Creates a new Gtk::SourceFileLoader object. The contents is read from stream.
Instance Method Details
#buffer ⇒ GtkSource::Buffer
The Gtk::SourceBuffer to load the contents into. The Gtk::SourceFileLoader object has a weak reference to the buffer.
#buffer=(buffer) ⇒ GtkSource::Buffer
The Gtk::SourceBuffer to load the contents into. The Gtk::SourceFileLoader object has a weak reference to the buffer.
#candidate_encodings=(candidate_encodings) ⇒ nil
Sets the candidate encodings for the file loading.
The encodings are tried in the same order as the list.
For convenience, candidate_encodings can contain duplicates. Only the first occurrence of a duplicated encoding is kept in the list.
By default the candidate encodings are (in that order in the list):
- If set, the [classFile]'s encoding as returned by [methodFile.get_encoding].
- The default candidates as returned by [funcEncoding.get_default_candidates].
#compression_type ⇒ GtkSource::CompressionType
Returns the detected compression type.
#encoding ⇒ GtkSource::Encoding
Returns the detected file encoding.
#file ⇒ GtkSource::File
The Gtk::SourceFile. The #GtkSourceFileLoader object has a weak reference to the file.
#file=(file) ⇒ GtkSource::File
The Gtk::SourceFile. The #GtkSourceFileLoader object has a weak reference to the file.
#input_stream ⇒ Gio::InputStream
The GInput::Stream to load. Useful for reading stdin. If this property is set, the Gtk::SourceFileLoader:location property is ignored.
#input_stream=(input_stream) ⇒ Gio::InputStream
The GInput::Stream to load. Useful for reading stdin. If this property is set, the Gtk::SourceFileLoader:location property is ignored.
#load_async(io_priority, cancellable, progress_callback, progress_callback_data, progress_callback_notify, callback, user_data) ⇒ nil
Loads asynchronously the file or input stream contents into the [classBuffer].
See the [ifaceGio.AsyncResult] documentation to know how to use this function.
#load_finish(result) ⇒ Boolean
Finishes a file loading started with [methodFileLoader.load_async].
If the contents has been loaded, the following [classFile] properties will be updated: the location, the encoding, the newline type and the compression type.
#location ⇒ Gio::File
The #GFile to load. If the Gtk::SourceFileLoader:input-stream is nil, by default the location is taken from the Gtk::SourceFile at construction time.
#location=(location) ⇒ Gio::File
The #GFile to load. If the Gtk::SourceFileLoader:input-stream is nil, by default the location is taken from the Gtk::SourceFile at construction time.
#newline_type ⇒ GtkSource::NewlineType
Returns the detected newline type.