Module dglib.IOChannel
Constructor Summary | |
---|---|
public |
(GIOChannel* gIOChannel) Creates a IOChannel from a GtkIOChannel |
(int fd) Creates a new GIOChannel given a file descriptor. |
|
(String filename, String mode, ErrorG error) Open a file filename as a GIOChannel using mode mode. |
Methods Summary | |
---|---|
void |
init() Initializes a GIOChannel struct. |
IOStatus |
readChars(String buf, gsize count, gsize* bytes_read, ErrorG error) Replacement for gIoChannelRead() with the new API. |
IOStatus |
readUnichar(gunichar* thechar, ErrorG error) This function cannot be called on a channel with NULL encoding. |
IOStatus |
readLine(String str, gsize length, gsize terminator_pos, ErrorG error) Reads a line, including the terminating character(s), from a GIOChannel into a newly-allocated string. |
IOStatus |
readLineString(StringG buffer, gsize terminator_pos, ErrorG error) Reads a line from a GIOChannel, using a GString as a buffer. |
IOStatus |
readToEnd(String str, gsize length, ErrorG error) Reads all the remaining data from the file. |
IOStatus |
writeChars(String buf, gssize count, gsize* bytes_written, ErrorG error) Replacement for gIoChannelWrite() with the new API. |
IOStatus |
writeUnichar(gunichar thechar, ErrorG error) This function cannot be called on a channel with NULL encoding. |
IOStatus |
flush(ErrorG error) Flushes the write buffer for the GIOChannel. |
IOStatus |
seekPosition(gint64 offset, SeekType type, ErrorG error) Replacement for gIoChannelSeek() with the new API. |
IOStatus |
shutdown(bit flush, ErrorG err) Close an IO channel. |
void |
ref() Converts an errno error number to a GIOChannelError. |
void |
unref() Decrements the reference count of a GIOChannel. |
GSource* |
createWatch(IOCondition condition) Creates a GSource that's dispatched when condition is met for the given channel. |
guint |
addWatch(IOCondition condition, void* func, gpointer user_data) Adds the GIOChannel into the main event loop with the default priority. |
guint |
watchFull(gint priority, IOCondition condition, void* func, gpointer user_data, void* notify) Adds the GIOChannel into the main event loop with the given priority. |
gsize |
getBufferSize() Specifies the type of function passed to gIoAddWatch() or gIoAddWatchFull(), which is called when the requested condition on a GIOChannel is satisfied. |
void |
setBufferSize(gsize size) Sets the buffer size. |
IOCondition |
getBufferCondition() 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. |
IOFlags |
getFlags() Gets the current flags for a GIOChannel, including read-only flags such as GIOFLAGISREADABLE. |
IOStatus |
setFlags(IOFlags flags, ErrorG error) Sets the (writeable) flags in channel to (flags & GIOCHANNELSETMASK). |
String |
getLineTerm(gint* length) This returns the string that GIOChannel uses to determine where in the file a line break occurs. |
void |
setLineTerm(String line_term, gint length) This sets the string that GIOChannel uses to determine where in the file a line break occurs. |
bit |
getBuffered() Returns whether channel is buffered. |
void |
setBuffered(bit buffered) The buffering state can only be set if the channel's encoding is NULL. |
String |
getEncoding() Gets the encoding for the input/output of the channel. |
IOStatus |
setEncoding(String encoding, ErrorG error) Sets the encoding for the input/output of the channel. |
bit |
getCloseOnUnref() Returns whether the file/socket/whatever associated with channel will be closed when channel receives its final unref and is destroyed. |
void |
setCloseOnUnref(bit do_close) Setting this flag to TRUE for a channel you have already closed can cause problems. |
IOError |
read(String buf, gsize count, gsize* bytes_read) Warning gIoChannelRead is deprecated and should not be used in newly-written code. |
IOError |
write(String buf, gsize count, gsize* bytes_written) Warning gIoChannelWrite is deprecated and should not be used in newly-written code. |
IOError |
seek(gint64 offset, SeekType type) Warning gIoChannelSeek is deprecated and should not be used in newly-written code. |
void |
close() Warning gIoChannelClose is deprecated and should not be used in newly-written code. |