glibmm: Glib::StreamIOChannel Class Reference

glibmm 2.66.8

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Glib::StreamIOChannel Class Reference

`#include <glibmm/streamiochannel.h>`

Inheritance diagram for Glib::StreamIOChannel:
[legend]

## Public Member Functions
| ~StreamIOChannel () noexcept override
Public Member Functions inherited from Glib::IOChannel
virtual | ~IOChannel ()
IOStatus | read (gunichar & thechar)
| Read a single UCS-4 character.
IOStatus | read (char * buf, gsize count, gsize & bytes_read)
| Read a character sequence into memory.
IOStatus | read (Glib::ustring & str, gsize count)
| Read a maximum of count bytes into str.
IOStatus | read_line (Glib::ustring & line)
| Read a whole line.
IOStatus | read_to_end (Glib::ustring & str)
| Reads all the remaining data from the file.
IOStatus | write (const Glib::ustring & str)
| Write a string to the I/O channel.
IOStatus | write (const char * buf, gssize count, gsize & bytes_written)
| Write a memory area of count bytes to the I/O channel.
IOStatus | write (gunichar unichar)
| Write a single UCS-4 character to the I/O channel.
IOStatus | seek (gint64 offset, SeekType type=SEEK_TYPE_SET)
| Seek the I/O channel to a specific position.
IOStatus | flush ()
| Flush the buffers of the I/O channel.
IOStatus | close (bool flush_pending=true)
| Close the I/O channel.
gsize | get_buffer_size () const
| Get the IOChannel internal buffer size.
void | set_buffer_size (gsize size)
| Set the internal IOChannel buffer size.
IOFlags | get_flags () const
| Get the current flags for a IOChannel, including read-only flags such as Glib::IO_FLAG_IS_READABLE.
IOStatus | set_flags (IOFlags flags)
| Set flags on the IOChannel.
void | set_buffered (bool buffered)
| Set the buffering status of the I/O channel.
bool | get_buffered () const
| Get the buffering status of the I/O channel.
IOCondition | get_buffer_condition () const
| Returns an IOCondition depending on whether there is data to be read/space to write data in the internal buffers in the I/O channel.
bool | get_close_on_unref () const
| Returns whether the file/socket/whatever associated with the I/O channel will be closed when the channel receives its final unref and is destroyed.
void | set_close_on_unref (bool do_close)
| Setting this flag to true for a channel you have already closed can cause problems.
IOStatus | set_encoding (const std::string & encoding=std::string())
| Sets the encoding for the input/output of the channel.
std::string | get_encoding () const
| Get the encoding of the I/O channel.
void | set_line_term (const std::string & term=std::string())
std::string | get_line_term () const
Glib::RefPtr< IOSource > | create_watch (IOCondition condition)
| Creates an IOSource object.
virtual void | reference () const
virtual void | unreference () const
GIOChannel * | gobj ()
const GIOChannel * | gobj () const
Public Member Functions inherited from sigc::trackable
| trackable () noexcept
| trackable (const trackable &src) noexcept
| trackable (trackable &&src)
| ~trackable ()
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
trackable & | operator= (trackable &&src)
void | remove_destroy_notify_callback (void *data) const

## Static Public Member Functions
static Glib::RefPtr< StreamIOChannel > | create (std::istream & stream)
static Glib::RefPtr< StreamIOChannel > | create (std::ostream & stream)
static Glib::RefPtr< StreamIOChannel > | create (std::iostream & stream)
Static Public Member Functions inherited from Glib::IOChannel
static Glib::RefPtr< IOChannel > | create_from_file (const std::string & filename, const std::string & mode)
| Open a file filename as an I/O channel using mode mode.
static Glib::RefPtr< IOChannel > | create_from_fd (int fd)
| Creates an I/O channel from a file descriptor.
static Glib::RefPtr< IOChannel > | create_from_win32_fd (int fd)
| Create an I/O channel for C runtime (emulated Unix-like) file descriptors.
static Glib::RefPtr< IOChannel > | create_from_win32_socket (int socket)
| Create an I/O channel for a winsock socket.

## Protected Member Functions
| StreamIOChannel (std::istream * stream_in, std::ostream * stream_out)
IOStatus | read_vfunc (char * buf, gsize count, gsize & bytes_read) override
IOStatus | write_vfunc (const char * buf, gsize count, gsize & bytes_written) override
IOStatus | seek_vfunc (gint64 offset, SeekType type) override
IOStatus | close_vfunc () override
IOStatus | set_flags_vfunc (IOFlags flags) override
IOFlags | get_flags_vfunc () override
Glib::RefPtr< Glib::Source > | create_watch_vfunc (IOCondition cond) override
Protected Member Functions inherited from Glib::IOChannel
| IOChannel ()
| Constructor that should be used by derived classes.

## Protected Attributes
std::istream * | stream_in_
std::ostream * | stream_out_
Protected Attributes inherited from Glib::IOChannel
GIOChannel * | gobject_

## Additional Inherited Members
Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify | func_destroy_notify

## Detailed Description

Deprecated
  This whole class was deprecated in glibmm 2.2 - See the Glib::IOChannel documentation for an explanation.

## Constructor & Destructor Documentation

## ◆ ~StreamIOChannel()

Glib::StreamIOChannel::~StreamIOChannel | ( |  | ) |
| overridenoexcept

## ◆ StreamIOChannel()

Glib::StreamIOChannel::StreamIOChannel | ( | std::istream * | stream_in,
|  | std::ostream * | stream_out )
| protected

## Member Function Documentation

## ◆ close_vfunc()

IOStatus Glib::StreamIOChannel::close_vfunc | ( |  | ) |
| overrideprotectedvirtual

Deprecated
  Custom Glib::IOChannel implementation was never really supported.

Reimplemented from Glib::IOChannel.

## ◆ create() [1/3]

Glib::RefPtr< StreamIOChannel > Glib::StreamIOChannel::create | ( | std::iostream & | stream | ) |
| static

## ◆ create() [2/3]

Glib::RefPtr< StreamIOChannel > Glib::StreamIOChannel::create | ( | std::istream & | stream | ) |
| static

## ◆ create() [3/3]

Glib::RefPtr< StreamIOChannel > Glib::StreamIOChannel::create | ( | std::ostream & | stream | ) |
| static

## ◆ create_watch_vfunc()

Glib::RefPtr< Glib::Source > Glib::StreamIOChannel::create_watch_vfunc | ( | IOCondition | cond | ) |
| overrideprotectedvirtual

Deprecated
  Custom Glib::IOChannel implementation was never really supported.

Reimplemented from Glib::IOChannel.

## ◆ get_flags_vfunc()

IOFlags Glib::StreamIOChannel::get_flags_vfunc | ( |  | ) |
| overrideprotectedvirtual

Deprecated
  Custom Glib::IOChannel implementation was never really supported.

Reimplemented from Glib::IOChannel.

## ◆ read_vfunc()

IOStatus Glib::StreamIOChannel::read_vfunc | ( | char * | buf,
|  | gsize | count,
|  | gsize & | bytes_read )
| overrideprotectedvirtual

Deprecated
  Custom Glib::IOChannel implementation was never really supported.

Reimplemented from Glib::IOChannel.

## ◆ seek_vfunc()

IOStatus Glib::StreamIOChannel::seek_vfunc | ( | gint64 | offset,
|  | SeekType | type )
| overrideprotectedvirtual

Deprecated
  Custom Glib::IOChannel implementation was never really supported.

Reimplemented from Glib::IOChannel.

## ◆ set_flags_vfunc()

IOStatus Glib::StreamIOChannel::set_flags_vfunc | ( | IOFlags | flags | ) |
| overrideprotectedvirtual

Deprecated
  Custom Glib::IOChannel implementation was never really supported.

Reimplemented from Glib::IOChannel.

## ◆ write_vfunc()

IOStatus Glib::StreamIOChannel::write_vfunc | ( | const char * | buf,
|  | gsize | count,
|  | gsize & | bytes_written )
| overrideprotectedvirtual

Deprecated
  Custom Glib::IOChannel implementation was never really supported.

Reimplemented from Glib::IOChannel.

## Member Data Documentation

## ◆ stream_in_

std::istream* Glib::StreamIOChannel::stream_in_
| protected

## ◆ stream_out_

std::ostream* Glib::StreamIOChannel::stream_out_
| protected