glibmm
2.33.2
|
Streaming output operations on memory chunks. More...
#include <giomm/memoryoutputstream.h>
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. | |
void* | get_data () |
Gets any loaded data from the ostream. | |
const void* | get_data () const |
Gets any loaded data from the ostream. | |
void* | steal_data () |
Gets any loaded data from the ostream. | |
gsize | get_size () const |
Gets the size of the currently allocated data area (available from g_memory_output_stream_get_data()). | |
gsize | get_data_size () const |
Returns the number of bytes from the start up to including the last byte written in the stream that has not been truncated away. | |
Glib::PropertyProxy_ReadOnly < void* > | property_data () const |
Pointer to buffer where data will be written. | |
Glib::PropertyProxy_ReadOnly < gulong > | property_data_size () const |
Size of data written to the buffer. | |
Glib::PropertyProxy_ReadOnly < gulong > | property_size () const |
Current size of the data buffer. | |
Static Public Member Functions | |
static Glib::RefPtr < MemoryOutputStream > | create (void* data, gsize size, GReallocFunc realloc_function, GDestroyNotify destroy_function) |
Protected Member Functions | |
MemoryOutputStream (void* data, gsize size, GReallocFunc realloc_function, GDestroyNotify destroy_function) | |
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.
This class uses arbitrary memory chunks as output for GIO streaming output operations.
virtual Gio::MemoryOutputStream::~MemoryOutputStream | ( | ) | [virtual] |
Gio::MemoryOutputStream::MemoryOutputStream | ( | void * | data, |
gsize | size, | ||
GReallocFunc | realloc_function, | ||
GDestroyNotify | destroy_function | ||
) | [explicit, protected] |
static Glib::RefPtr<MemoryOutputStream> Gio::MemoryOutputStream::create | ( | void * | data, |
gsize | size, | ||
GReallocFunc | realloc_function, | ||
GDestroyNotify | destroy_function | ||
) | [static] |
void* 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.
const void* Gio::MemoryOutputStream::get_data | ( | ) | const |
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 from the start up to including the last byte written in the stream that has not been truncated away.
gsize Gio::MemoryOutputStream::get_size | ( | ) | const |
Gets the size of the currently allocated data area (available 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().
GMemoryOutputStream* Gio::MemoryOutputStream::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gio::OutputStream.
const GMemoryOutputStream* Gio::MemoryOutputStream::gobj | ( | ) | const [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::PropertyProxy_ReadOnly< void* > Gio::MemoryOutputStream::property_data | ( | ) | const |
Pointer to buffer where data will be written.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< gulong > Gio::MemoryOutputStream::property_data_size | ( | ) | const |
Size of data written to the buffer.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< gulong > Gio::MemoryOutputStream::property_size | ( | ) | const |
Current size of the data buffer.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
void* Gio::MemoryOutputStream::steal_data | ( | ) |
Gets any loaded data from the ostream.
Ownership of the data is transferred to the caller; when no longer needed it must be freed using the free function set in ostream's MemoryOutputStream::property_destroy_function() property.
ostream must be closed before calling this function.
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. |