Streaming output operations on memory chunks. More...
Inherits Gio::OutputStream, and Gio::Seekable.
Public Member Functions | |
virtual | ~MemoryOutputStream () |
GMemoryOutputStream* | gobj () |
Provides access to the underlying C GObject. | |
const GMemoryOutputStream* | gobj () const |
Provides access to the underlying C GObject. | |
GMemoryOutputStream* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
gpointer | get_data () |
Gets any loaded data from the ostream. | |
gsize | get_size () const |
Gets the size of the currently allocated data area (availible from g_memory_output_stream_get_data()). | |
gsize | get_data_size () const |
Returns: the number of bytes written to the stream. | |
Static Public Member Functions | |
static Glib::RefPtr < MemoryOutputStream > | create (gpointer data, gsize len, GReallocFunc realloc_fn, GDestroyNotify destroy) |
Protected Member Functions | |
MemoryOutputStream (gpointer data, gsize len, GReallocFunc realloc_fn, GDestroyNotify destroy) | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr < Gio::MemoryOutputStream > | wrap (GMemoryOutputStream* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
Streaming output operations on memory chunks.
virtual Gio::MemoryOutputStream::~MemoryOutputStream | ( | ) | [virtual] |
Gio::MemoryOutputStream::MemoryOutputStream | ( | gpointer | data, | |
gsize | len, | |||
GReallocFunc | realloc_fn, | |||
GDestroyNotify | destroy | |||
) | [explicit, protected] |
static Glib::RefPtr<MemoryOutputStream> Gio::MemoryOutputStream::create | ( | gpointer | data, | |
gsize | len, | |||
GReallocFunc | realloc_fn, | |||
GDestroyNotify | destroy | |||
) | [static] |
gpointer Gio::MemoryOutputStream::get_data | ( | ) |
Gets any loaded data from the ostream.
Note that the returned pointer may become invalid on the next write or truncate operation on the stream.
gsize Gio::MemoryOutputStream::get_data_size | ( | ) | const |
Returns: the number of bytes written to the stream.
gsize Gio::MemoryOutputStream::get_size | ( | ) | const |
Gets the size of the currently allocated data area (availible from g_memory_output_stream_get_data()).
If the stream isn't growable (no realloc was passed to g_memory_output_stream_new()) then this is the maximum size of the stream and further writes will return IO_ERROR_NO_SPACE.
Note that for growable streams the returned size may become invalid on the next write or truncate operation on the stream.
If you want the number of bytes currently written to the stream, use g_memory_output_stream_get_data_size().
const GMemoryOutputStream* Gio::MemoryOutputStream::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gio::OutputStream.
GMemoryOutputStream* Gio::MemoryOutputStream::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gio::OutputStream.
GMemoryOutputStream* Gio::MemoryOutputStream::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Reimplemented from Gio::OutputStream.
Glib::RefPtr< Gio::MemoryOutputStream > wrap | ( | GMemoryOutputStream * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. | |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |