| Top |
| WockyXmppWriter * | wocky_xmpp_writer_new () |
| WockyXmppWriter * | wocky_xmpp_writer_new_no_stream () |
| void | wocky_xmpp_writer_stream_open () |
| void | wocky_xmpp_writer_stream_close () |
| void | wocky_xmpp_writer_write_stanza () |
| void | wocky_xmpp_writer_write_node_tree () |
| void | wocky_xmpp_writer_flush () |
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.
WockyXmppWriter *
wocky_xmpp_writer_new (void);
Convenience function to create a new WockyXmppWriter.
WockyXmppWriter *
wocky_xmpp_writer_new_no_stream (void);
Convenience function to create a new WockyXmppWriter that has streaming mode disabled.
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.
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 |
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.
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
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.
void
wocky_xmpp_writer_flush (WockyXmppWriter *writer);
Flushes and frees the internal data buffer
“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