TnyStreamCamel

TnyStreamCamel — A CamelStream as adaptor for a TnyStream

Synopsis




#define             TNY_TYPE_STREAM_CAMEL_STREAM
#define             TNY_TYPE_STREAM_CAMEL
#define             TNY_STREAM_CAMEL                    (obj)
#define             TNY_STREAM_CAMEL_CLASS              (k)
                    TnyStreamCamel;
CamelType           tny_stream_camel_get_type           (void);
CamelStream*        tny_stream_camel_new                (TnyStream *stream);
void                tny_stream_camel_set_stream         (TnyStreamCamel *self,
                                                         TnyStream *stream);
gssize              tny_stream_camel_write_to_stream    (TnyStreamCamel *self,
                                                         TnyStream *output);

Description

This type adapts the TnyStream to a CamelStream. It's used in the libtinymail-camel implementation library for converting a TnyStream to a CamelStream.

Details

TNY_TYPE_STREAM_CAMEL_STREAM

#define TNY_TYPE_STREAM_CAMEL_STREAM     (tny_stream_camel_get_type ())


TNY_TYPE_STREAM_CAMEL

#define TNY_TYPE_STREAM_CAMEL     (tny_stream_camel_get_type ())


TNY_STREAM_CAMEL()

#define TNY_STREAM_CAMEL(obj)     (CAMEL_CHECK_CAST((obj), TNY_TYPE_STREAM_CAMEL_STREAM, TnyStreamCamel))

obj :

TNY_STREAM_CAMEL_CLASS()

#define TNY_STREAM_CAMEL_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), TNY_TYPE_STREAM_CAMEL_STREAM, TnyStreamCamelClass))

k :

TnyStreamCamel

typedef struct {
	CamelSeekableSubstream parent;

	TnyStream *stream;
} TnyStreamCamel;


tny_stream_camel_get_type ()

CamelType           tny_stream_camel_get_type           (void);

CamelType system helper function

Returns : a CamelType

tny_stream_camel_new ()

CamelStream*        tny_stream_camel_new                (TnyStream *stream);

Create a new CamelStream instance implemented as a proxy for a TnyStream

stream : A TnyStream stream to play proxy for
Returns : A new CamelStream instance implemented as a proxy for a TnyStream

tny_stream_camel_set_stream ()

void                tny_stream_camel_set_stream         (TnyStreamCamel *self,
                                                         TnyStream *stream);

Set the stream to play proxy for

self : A TnyStreamCamel object
stream : A TnyStream object

tny_stream_camel_write_to_stream ()

gssize              tny_stream_camel_write_to_stream    (TnyStreamCamel *self,
                                                         TnyStream *output);

Write self to output (copy it) in an efficient way

self : a TnyCamelStream object
output : a TnyStream object to write to
Returns : the number of bytes written to the output stream, or -1 on error along with setting errno.

See Also

TnyStream, CamelStream, TnyCamelStream