wocky Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
WockyXmppReader; WockyXmppReaderClass; WockyXmppReaderPrivate; enum WockyXmppReaderState; enum WockyXmppReaderError; GQuark wocky_xmpp_reader_error_quark (void
); #define WOCKY_XMPP_READER_ERROR WockyXmppReader * wocky_xmpp_reader_new (void
); WockyXmppReader * wocky_xmpp_reader_new_no_stream (void
); WockyXmppReaderState wocky_xmpp_reader_get_state (WockyXmppReader *reader
); void wocky_xmpp_reader_push (WockyXmppReader *reader
,const guint8 *data
,gsize length
); WockyStanza * wocky_xmpp_reader_pop_stanza (WockyXmppReader *reader
); WockyStanza * wocky_xmpp_reader_peek_stanza (WockyXmppReader *reader
); GError * wocky_xmpp_reader_get_error (WockyXmppReader *reader
); void wocky_xmpp_reader_reset (WockyXmppReader *reader
);
"from" gchar* : Read "id" gchar* : Read "lang" gchar* : Read "streaming-mode" gboolean : Read / Write / Construct Only "to" gchar* : Read "version" gchar* : Read
typedef enum { WOCKY_XMPP_READER_STATE_INITIAL, WOCKY_XMPP_READER_STATE_OPENED, WOCKY_XMPP_READER_STATE_CLOSED, WOCKY_XMPP_READER_STATE_ERROR, } WockyXmppReaderState;
The possible states a reader can be in.
typedef enum { WOCKY_XMPP_READER_ERROR_INVALID_STREAM_START, WOCKY_XMPP_READER_ERROR_PARSE_ERROR, } WockyXmppReaderError;
The different errors that can occur while reading a stream
GQuark wocky_xmpp_reader_error_quark (void
);
Get the error quark used by the reader.
Returns : |
the quark for reader errors. |
#define WOCKY_XMPP_READER_ERROR (wocky_xmpp_reader_error_quark ())
Get access to the error quark of the reader.
WockyXmppReader * wocky_xmpp_reader_new (void
);
Convenience function to create a new WockyXmppReader.
Returns : |
a new WockyXmppReader |
WockyXmppReader * wocky_xmpp_reader_new_no_stream (void
);
Convenience function to create a new WockyXmppReader that has streaming mode disabled.
Returns : |
a new WockyXmppReader in non-streaming mode |
WockyXmppReaderState wocky_xmpp_reader_get_state (WockyXmppReader *reader
);
|
a WockyXmppReader |
Returns : |
The current state of the reader |
void wocky_xmpp_reader_push (WockyXmppReader *reader
,const guint8 *data
,gsize length
);
Push an amount of data to parse.
|
a WockyXmppReader |
|
Data to read |
|
Size of data
|
WockyStanza * wocky_xmpp_reader_pop_stanza (WockyXmppReader *reader
);
Gets one WockyStanza out of the reader or NULL if there are no available stanzas.
|
a WockyXmppReader |
Returns : |
One WockyStanza or NULL if there are no available stanzas. Caller owns the returned stanza. |
WockyStanza * wocky_xmpp_reader_peek_stanza (WockyXmppReader *reader
);
Returns the first WockyStanza available from reader or NULL if there are no available stanzas. The stanza is not removed from the readers queue
|
a WockyXmppReader |
Returns : |
One WockyStanza or NULL if there are no available stanzas. The stanza is owned by the WockyXmppReader |
GError * wocky_xmpp_reader_get_error (WockyXmppReader *reader
);
Get the error from the reader
|
a WockyXmppReader |
Returns : |
A copy of the error as encountered by the reader or NULL if there was no error. Free after use. |
void wocky_xmpp_reader_reset (WockyXmppReader *reader
);
Reset the xml parser.
|
a WockyXmppReader |
"from"
property"from" gchar* : Read
from attribute in the xml stream opening.
Default value: NULL
"lang"
property"lang" gchar* : Read
xml:lang attribute in the xml stream opening.
Default value: NULL
"streaming-mode"
property"streaming-mode" gboolean : Read / Write / Construct Only
Whether the xml to be read is one big stream or separate documents.
Default value: TRUE
"version"
property"version" gchar* : Read
version attribute in the xml stream opening.
Default value: NULL