Logo Search packages:      
Sourcecode: ardour version File versions  Download package

Glib::IOChannel Class Reference

#include <iochannel.h>

Inheritance diagram for Glib::IOChannel:

sigc::trackable Glib::StreamIOChannel

List of all members.


Detailed Description

IOChannel aims to provide portable I/O support for files, pipes and sockets, and to integrate them with the GLib main event loop.

Note that IOChannels implement an automatic implicit character set conversion to the data stream, and usually will not pass by default binary data unchanged. To set the encoding of the channel, use e.g. set_encoding("ISO-8859-15"). To set the channel to no encoding, use set_encoding() without any arguments.

You can create an IOChannel with one of the static create methods, or implement one yourself, in which case you have to 1) override all _vfunc() members. 2) set the GIOChannel flags in your constructor.

Note:
This feature of being able to implement a custom Glib::IOChannel is deprecated in glibmm 2.2. The vfunc interface has not yet stabilized enough to allow that -- the C++ wrapper went in by pure accident. Besides, it isn't terribly useful either. Thus please refrain from overriding any IOChannel vfuncs.

Definition at line 179 of file iochannel.h.


Public Types

typedef GIOChannel BaseObjectType
typedef IOChannel CppObjectType

Public Member Functions

IOStatus close (bool flush=true)
Glib::RefPtr< IOSource > create_watch (IOCondition condition)
IOStatus flush ()
IOCondition get_buffer_condition () const
gsize get_buffer_size () const
bool get_buffered () const
bool get_close_on_unref () const
std::string get_encoding () const
IOFlags get_flags () const
std::string get_line_term () const
const GIOChannel * gobj () const
GIOChannel * gobj ()
IOStatus read (Glib::ustring &str, gsize count)
IOStatus read (char *buf, gsize count, gsize &bytes_read)
IOStatus read (gunichar &unichar)
IOStatus read_line (Glib::ustring &line)
IOStatus read_to_end (Glib::ustring &str)
virtual void reference () const
IOStatus seek (gint64 offset, SeekType type=SEEK_TYPE_SET)
void set_buffer_size (gsize size)
void set_buffered (bool buffered)
void set_close_on_unref (bool do_close)
IOStatus set_encoding (const std::string &encoding=std::string())
IOStatus set_flags (IOFlags flags)
void set_line_term (const std::string &term=std::string())
virtual void unreference () const
IOStatus write (gunichar unichar)
IOStatus write (const char *buf, gssize count, gsize &bytes_written)
IOStatus write (const Glib::ustring &str)

Static Public Member Functions

static Glib::RefPtr< IOChannelcreate_from_fd (int fd)
static Glib::RefPtr< IOChannelcreate_from_file (const std::string &filename, const std::string &mode)

Protected Member Functions

virtual IOStatus close_vfunc ()
virtual Glib::RefPtr
< Glib::Source > 
create_watch_vfunc (IOCondition cond)
virtual IOFlags get_flags_vfunc ()
 IOChannel (GIOChannel *gobject, bool take_copy)
 IOChannel ()
virtual IOStatus read_vfunc (char *buf, gsize count, gsize &bytes_read)
virtual IOStatus seek_vfunc (gint64 offset, SeekType type)
virtual IOStatus set_flags_vfunc (IOFlags flags)
virtual IOStatus write_vfunc (const char *buf, gsize count, gsize &bytes_written)

Protected Attributes

GIOChannel * gobject_

Package Functions

void add_destroy_notify_callback (void *data, func_destroy_notify func) const
void notify_callbacks ()
 Execute and remove all previously installed callbacks.
void remove_destroy_notify_callback (void *data) const

Package Attributes

 __pad0__:func_destroy_notify func_destroy_notify

Friends

class Glib::GlibmmIOChannel

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index