00001 #ifndef GTASK_STREAM_PARSER_H
00002 #define GTASK_STREAM_PARSER_H
00003
00004 #include <glib.h>
00005 #include <glib-2.0/glib-object.h>
00006
00007 #include <libxml/xmlreader.h>
00008
00011
00012
00013 typedef struct _GTaskStreamParser GTaskStreamParser;
00014 typedef struct _GTaskStreamParserPrivate GTaskStreamParserPrivate;
00015 typedef struct _GTaskStreamParserClass GTaskStreamParserClass;
00016
00018 #define GTASK_STREAM_PARSER_TYPE (gtask_stream_parser_get_type())
00019
00021 #define GTASK_STREAM_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST( (obj), \
00022 GTASK_STREAM_PARSER_TYPE, \
00023 GTaskStreamParser ))
00024
00026 #define GTASK_STREAM_PARSER_CLASS(kclass) (G_TYPE_CHECK_CLASS_CAST( (klass), \
00027 GTASK_STREAM_PARSER_TYPE, \
00028 GTaskStreamParserClass ))
00029
00034 #define GTASK_IS_STREAM_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE( (obj), \
00035 GTASK_STREAM_PARSER_TYPE ))
00036
00041 #define GTASK_IS_STREAM_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE( (klass), \
00042 GTASK_STREAM_PARSER_TYPE ))
00043
00044 #define GTASK_STREAM_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS( (obj), \
00045 GTASK_STREAM_PARSER_TYPE, \
00046 GTaskStreamParserClass ))
00047
00048 struct _GTaskStreamParser {
00049 GObject parent;
00050 GTaskStreamParserPrivate *private;
00051 };
00052
00053 struct _GTaskStreamParserClass {
00054 GObjectClass parent;
00055 };
00056
00057 typedef enum {
00058 GTASK_STREAM_PARSER_ERROR_NONE,
00059 GTASK_STREAM_PARSER_ERROR_SYNTAX_ERROR
00060 } GTaskStreamParserError;
00061
00062 GType
00063 gtask_stream_parser_get_type( void );
00064
00065 GTaskStreamParser *
00066 gtask_stream_parser_new( void );
00067
00068
00069 GObject *
00070 gtask_stream_parser_get_next_packet( GTaskStreamParser *parser );
00071
00072 gboolean
00073 gtask_stream_parser_has_error( GTaskStreamParser *parser );
00074
00075 GTaskStreamParserError
00076 gtask_stream_parser_get_error( GTaskStreamParser *parser );
00077
00078 gboolean
00079 gtask_stream_parser_at_eof( GTaskStreamParser *parser );
00080
00081 gboolean
00082 gtask_stream_parser_has_packets( GTaskStreamParser *parser );
00083
00084 gboolean
00085 gtask_stream_parser_push_data( GTaskStreamParser *parser, char *buff, int len );
00086
00087 void
00088 gtask_stream_parser_reset_state( GTaskStreamParser *parser );
00089
00090
00091
00092 #endif