|  |  |  | Wocky Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
struct WockyXmppWriterClass; void wocky_xmpp_writer_flush (WockyXmppWriter *writer); WockyXmppWriter * wocky_xmpp_writer_new (void); WockyXmppWriter * wocky_xmpp_writer_new_no_stream (void); void wocky_xmpp_writer_stream_close (WockyXmppWriter *writer,const guint8 **data,gsize *length); 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); void wocky_xmpp_writer_write_node_tree (WockyXmppWriter *writer,WockyNodeTree *tree,const guint8 **data,gsize *length); void wocky_xmpp_writer_write_stanza (WockyXmppWriter *writer,WockyStanza *stanza,const guint8 **data,gsize *length);
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.
void                wocky_xmpp_writer_flush             (WockyXmppWriter *writer);
Flushes and frees the internal data buffer
| 
 | a WockyXmppWriter | 
WockyXmppWriter *   wocky_xmpp_writer_new               (void);
Convenience function to create a new WockyXmppWriter.
| Returns : | a new WockyXmppWriter | 
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 | 
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.
| 
 | a WockyXmppWriter | 
| 
 | location to store a pointer to the data buffer | 
| 
 | length of the data buffer | 
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.
| 
 | a WockyXmppWriter | 
| 
 | the target of the stream opening (usually the xmpp server name) | 
| 
 | the sender of the stream opening (usually the jid of the client) | 
| 
 | XMPP version | 
| 
 | default XMPP stream language | 
| 
 | XMPP Stream ID, if any, or NULL | 
| 
 | location to store a pointer to the data buffer | 
| 
 | length of the data buffer | 
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.
| 
 | a WockyXmppWriter | 
| 
 | the node tree to serialize | 
| 
 | location to store a pointer to the data buffer | 
| 
 | length of the data buffer | 
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
| 
 | a WockyXmppWriter | 
| 
 | the stanza to serialize | 
| 
 | location to store a pointer to the data buffer | 
| 
 | length of the data buffer |