StreamMem

A memory-backed #GMimeStream.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this()

Creates a new #GMimeStreamMem object.

Members

Functions

getByteArray
ubyte[] getByteArray()

Gets the byte array from the memory stream.

getOwner
bool getOwner()

Gets whether or not mem owns the backend memory buffer.

self
StreamMem self()

Returns this, for use in with statements.

setByteArray
void setByteArray(ubyte[] array)

Sets the byte array on the memory stream.

setOwner
void setOwner(bool owner)

Sets whether or not mem owns the backend memory buffer.

Properties

_gType
GType _gType [@property getter]

Static functions

_getGType
GType _getGType()
builder
StreamMemGidBuilder builder()

Get builder for gmime.stream_mem.StreamMem

newWithBuffer
gmime.stream_mem.StreamMem newWithBuffer(ubyte[] buffer)

Creates a new #GMimeStreamMem object and initializes the stream contents with the first len bytes of buffer.

newWithByteArray
gmime.stream_mem.StreamMem newWithByteArray(ubyte[] array)

Creates a new #GMimeStreamMem with data array.

Inherited Members

From Stream

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
Stream self()

Returns this, for use in with statements.

builder
StreamGidBuilder builder()

Get builder for gmime.stream.Stream

bufferGets
ptrdiff_t bufferGets(ubyte[] buf)

Reads in at most one less than max characters from stream and stores them into the buffer pointed to by buf. Reading stops after an EOS or newline ('\n'). If a newline is read, it is stored into the buffer. A '\0' is stored after the last character in the buffer.

bufferReadln
void bufferReadln(ubyte[] buffer)

Reads a single line into buffer.

close
int close()

Closes the stream.

construct
void construct(long start, long end)

Initializes a new stream with bounds start and end.

eos
bool eos()

Tests the end-of-stream indicator for stream.

flush
int flush()

Sync's the stream to disk.

length
long length()

Gets the length of the stream.

read
ptrdiff_t read(ubyte[] buf)

Attempts to read up to len bytes from stream into buf.

reset
int reset()

Resets the stream.

seek
long seek(long offset, gmime.types.SeekWhence whence)

Repositions the offset of the stream stream to the argument offset according to the directive whence as follows:

setBounds
void setBounds(long start, long end)

Set the bounds on a stream.

substream
gmime.stream.Stream substream(long start, long end)

Creates a new substream of stream with bounds start and end.

tell
long tell()

Gets the current offset within the stream.

write
ptrdiff_t write(ubyte[] buf)

Attempts to write up to len bytes of buf to stream.

writeString
ptrdiff_t writeString(string str)

Writes string to stream.

writeToStream
long writeToStream(gmime.stream.Stream dest)

Attempts to write the source stream to the destination stream.

writev
long writev(gmime.types.StreamIOVector[] vector)

Writes at most count blocks described by vector to stream.