package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gio/Ocgtk_gio/Gio/Wrappers/Memory_output_stream/index.html

Module Wrappers.Memory_output_stream

type t = [ `memory_output_stream | `output_stream | `object_ ] Gobject.obj
val new_resizable : unit -> t

Create a new MemoryOutputStream

val steal_as_bytes : t -> Glib_bytes.t

Returns data from the @ostream as a #GBytes. @ostream must be closed before calling this function.

val get_size : t -> Gsize.t

Gets the size of the currently allocated data area (available from g_memory_output_stream_get_data()).

You probably don't want to use this function on resizable streams. See g_memory_output_stream_get_data_size() instead. For resizable streams the size returned by this function is an implementation detail and may be change at any time in response to operations on the stream.

If the stream is fixed-sized (ie: no realloc was passed to g_memory_output_stream_new()) then this is the maximum size of the stream and further writes will return %G_IO_ERROR_NO_SPACE.

In any case, if you want the number of bytes currently written to the stream, use g_memory_output_stream_get_data_size().

val get_data_size : t -> Gsize.t

Returns the number of bytes from the start up to including the last byte written in the stream that has not been truncated away.