WockyXmppWriter

WockyXmppWriter — Xmpp stanza to XML serializer

Functions

Properties

gboolean streaming-mode Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── WockyXmppWriter

Description

The WockyXmppWriter serializes WockyStanzas and XMPP stream opening and closing to raw XML. The various functions provide a pointer to an internal buffer, which remains valid until the next call to the writer.

Functions

wocky_xmpp_writer_new ()

WockyXmppWriter *
wocky_xmpp_writer_new (void);

Convenience function to create a new WockyXmppWriter.

Returns

a new WockyXmppWriter


wocky_xmpp_writer_new_no_stream ()

WockyXmppWriter *
wocky_xmpp_writer_new_no_stream (void);

Convenience function to create a new WockyXmppWriter that has streaming mode disabled.

Returns

a new WockyXmppWriter in non-streaming mode


wocky_xmpp_writer_stream_open ()

void
wocky_xmpp_writer_stream_open (WockyXmppWriter *writer,
                               const gchar *to,
                               const gchar *from,
                               const gchar *version,
                               const gchar *lang,
                               const gchar *id,
                               const guint8 **data,
                               gsize *length);

Create the XML opening header of an XMPP stream. The result is available in the data buffer. The buffer is only valid until the next call to a function the writer.

This function can only be called in streaming mode.

Parameters

writer

a WockyXmppWriter

 

to

the target of the stream opening (usually the xmpp server name)

 

from

the sender of the stream opening (usually the jid of the client)

 

version

XMPP version

 

lang

default XMPP stream language

 

id

XMPP Stream ID, if any, or NULL

 

data

location to store a pointer to the data buffer

 

length

length of the data buffer

 

wocky_xmpp_writer_stream_close ()

void
wocky_xmpp_writer_stream_close (WockyXmppWriter *writer,
                                const guint8 **data,
                                gsize *length);

Create the XML closing footer of an XMPP stream . The result is available in the data buffer. The buffer is only valid until the next call to a function

This function can only be called in streaming mode.

Parameters

writer

a WockyXmppWriter

 

data

location to store a pointer to the data buffer

 

length

length of the data buffer

 

wocky_xmpp_writer_write_stanza ()

void
wocky_xmpp_writer_write_stanza (WockyXmppWriter *writer,
                                WockyStanza *stanza,
                                const guint8 **data,
                                gsize *length);

Serialize the stanza to XML. The result is available in the data buffer. The buffer is only valid until the next call to a function

Parameters

writer

a WockyXmppWriter

 

stanza

the stanza to serialize

 

data

location to store a pointer to the data buffer

 

length

length of the data buffer

 

wocky_xmpp_writer_write_node_tree ()

void
wocky_xmpp_writer_write_node_tree (WockyXmppWriter *writer,
                                   WockyNodeTree *tree,
                                   const guint8 **data,
                                   gsize *length);

Serialize the tree to XML. The result is available in the data buffer. The buffer is only valid until the next call to a function. This function may only be called in non-streaming mode.

Parameters

writer

a WockyXmppWriter

 

tree

the node tree to serialize

 

data

location to store a pointer to the data buffer

 

length

length of the data buffer

 

wocky_xmpp_writer_flush ()

void
wocky_xmpp_writer_flush (WockyXmppWriter *writer);

Flushes and frees the internal data buffer

Parameters

writer

a WockyXmppWriter

 

Types and Values

struct WockyXmppWriterClass

struct WockyXmppWriterClass {
};

The class of a WockyXmppWriter.

Property Details

The “streaming-mode” property

  “streaming-mode”           gboolean

Whether the xml to be written is one big stream or separate documents.

Flags: Read / Write / Construct Only

Default value: TRUE