IOChannel

class IOChannel(pointer: <Error class: unknown class><<Error class: unknown class>>) : Record

A data structure representing an IO Channel. The fields should be considered private and should only be accessed with the following functions.

Skipped during bindings generation

  • parameter length: Unsupported pointer to primitive type

  • parameter bytes_read: Unsupported pointer to primitive type

  • parameter buf: buf: Out parameter is not supported

  • parameter str_return: str_return: Out parameter is not supported

  • parameter terminator_pos: Unsupported pointer to primitive type

  • parameter str_return: str_return: Out parameter is not supported

  • parameter thechar: thechar: Out parameter is not supported

  • parameter bytes_written: Unsupported pointer to primitive type

  • parameter buf: guint8

  • field ref_count: Record field ref_count is private

  • field funcs: Record field funcs is private

  • field encoding: Record field encoding is private

  • field read_cd: Record field read_cd is private

  • field write_cd: Record field write_cd is private

  • field line_term: Record field line_term is private

  • field line_term_len: Record field line_term_len is private

  • field buf_size: Record field buf_size is private

  • field read_buf: Record field read_buf is private

  • field encoded_read_buf: Record field encoded_read_buf is private

  • field write_buf: Record field write_buf is private

  • field partial_write_buf: Record field partial_write_buf is private

  • field use_buffer: Record field use_buffer is private

  • field do_encode: Record field do_encode is private

  • field close_on_unref: Record field close_on_unref is private

  • field is_readable: Record field is_readable is private

  • field is_writeable: Record field is_writeable is private

  • field is_seekable: Record field is_seekable is private

  • field reserved1: Record field reserved1 is private

  • field reserved2: Record field reserved2 is private

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion : RecordCompanion<IOChannel, <Error class: unknown class>>

Properties

Link copied to clipboard
val glibIOChannelPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun close()

Close an IO channel. Any pending data to be written will be flushed, ignoring errors. The channel will not be freed until the last reference is dropped using g_io_channel_unref().

Link copied to clipboard
fun flush(): <Error class: unknown class><IOStatus>

Flushes the write buffer for the GIOChannel.

Link copied to clipboard

This function returns a #GIOCondition depending on whether there is data to be read/space to write data in the internal buffers in the #GIOChannel. Only the flags %G_IO_IN and %G_IO_OUT may be set.

Link copied to clipboard

Returns whether @channel is buffered.

Link copied to clipboard
fun getBufferSize(): <Error class: unknown class>

Gets the buffer size.

Link copied to clipboard

Returns whether the file/socket/whatever associated with @channel will be closed when @channel receives its final unref and is destroyed. The default value of this is true for channels created by g_io_channel_new_file (), and false for all other channels.

Link copied to clipboard

Gets the encoding for the input/output of the channel. The internal encoding is always UTF-8. The encoding null makes the channel safe for binary data.

Link copied to clipboard

Gets the current flags for a #GIOChannel, including read-only flags such as %G_IO_FLAG_IS_READABLE.

Link copied to clipboard
fun init()

Initializes a #GIOChannel struct.

Link copied to clipboard
fun ref(): IOChannel

Increments the reference count of a #GIOChannel.

Link copied to clipboard
fun seek(offset: Long, type: SeekType): IOError

Sets the current position in the #GIOChannel, similar to the standard library function fseek().

Link copied to clipboard
fun seekPosition(offset: Long, type: SeekType): <Error class: unknown class><IOStatus>

Replacement for g_io_channel_seek() with the new API.

Link copied to clipboard
fun setBuffered(buffered: Boolean)

The buffering state can only be set if the channel's encoding is null. For any other encoding, the channel must be buffered.

Link copied to clipboard
fun setBufferSize(size: <Error class: unknown class>)

Sets the buffer size.

Link copied to clipboard
fun setCloseOnUnref(doClose: Boolean)

Whether to close the channel on the final unref of the #GIOChannel data structure. The default value of this is true for channels created by g_io_channel_new_file (), and false for all other channels.

Link copied to clipboard
fun setEncoding(encoding: String? = null): <Error class: unknown class><IOStatus>

Sets the encoding for the input/output of the channel. The internal encoding is always UTF-8. The default encoding for the external file is UTF-8.

Link copied to clipboard
fun setFlags(flags: IOFlags): <Error class: unknown class><IOStatus>

Sets the (writeable) flags in @channel to (@flags & %G_IO_FLAG_SET_MASK).

Link copied to clipboard
fun setLineTerm(lineTerm: String? = null, length: Int)

This sets the string that #GIOChannel uses to determine where in the file a line break occurs.

Link copied to clipboard
fun shutdown(flush: Boolean): <Error class: unknown class><IOStatus>

Close an IO channel. Any pending data to be written will be flushed if @flush is true. The channel will not be freed until the last reference is dropped using g_io_channel_unref().

Link copied to clipboard
fun unixGetFd(): Int

Returns the file descriptor of the #GIOChannel.

Link copied to clipboard
fun unref()

Decrements the reference count of a #GIOChannel.

Link copied to clipboard
fun writeUnichar(thechar: <Error class: unknown class>): <Error class: unknown class><IOStatus>

Writes a Unicode character to @channel. This function cannot be called on a channel with null encoding.