RssParser

RssParser — Parse RSS data streams

Synopsis

enum                RssParserError;
#define             RSS_PARSER_ERROR
GQuark              rss_parser_error_quark              (void);
                    RssParserPrivate;
                    RssParser;
RssParser*          rss_parser_new                      (void);
gboolean            rss_parser_load_from_data           (RssParser *self,
                                                         const gchar *data,
                                                         gsize length,
                                                         GError **error);
gboolean            rss_parser_load_from_file           (RssParser *self,
                                                         gchar *filename,
                                                         GError **error);
RssDocument*        rss_parser_get_document             (RssParser *self);

Object Hierarchy

  GObject
   +----RssParser

Signals

  "parse-end"                                      : Run Last
  "parse-start"                                    : Run Last

Description

RssParser provides an object for parsing a RSS data stream, either inside a file or inside a static buffer.

Details

enum RssParserError

typedef enum {
	RSS_PARSER_ERROR_INVALID_DATA,
} RssParserError;


RSS_PARSER_ERROR

#define RSS_PARSER_ERROR rss_parser_error_quark()


rss_parser_error_quark ()

GQuark              rss_parser_error_quark              (void);

Returns :


RssParserPrivate

typedef struct {
	RssDocument *document;
} RssParserPrivate;


RssParser

typedef struct _RssParser RssParser;


rss_parser_new ()

RssParser*          rss_parser_new                      (void);

Creates a new RssParser instance. You can use the RssParser to load a RSS stream from either a file or a buffer and then walk the items discovered through the resulting RssDocument.

Returns :

the new created RssParser. Use g_object_unref() to release all the memory it allocates.

rss_parser_load_from_data ()

gboolean            rss_parser_load_from_data           (RssParser *self,
                                                         const gchar *data,
                                                         gsize length,
                                                         GError **error);

Parses the contents found at data as an rss file. You can retrieve the parsed document with rss_parser_get_document().

self :

a RssParser

data :

a buffer containing the syndication data

length :

the length of the buffer

error :

a location to place a newly created GError in case of error

Returns :

TRUE on success.

rss_parser_load_from_file ()

gboolean            rss_parser_load_from_file           (RssParser *self,
                                                         gchar *filename,
                                                         GError **error);

Parses the file found at filename as an rss file. You can retrieve the parsed document with rss_parser_get_document().

self :

a RssParser

filename :

the path to the file to parse

error :

a location for a newly created GError

Returns :

TRUE if the parse was successful

rss_parser_get_document ()

RssDocument*        rss_parser_get_document             (RssParser *self);

Retreives the document result from parsing rss data from either a buffer or a file. The document's ref-count is increased, so call g_object_unref when you are done.

self :

a RssParser

Returns :

a RssDocument

Signal Details

The "parse-end" signal

void                user_function                      (RssParser *parser,
                                                        gpointer   user_data)      : Run Last

The ::parse-end signal is emitted when the parser successfully finished parsing a RSS data stream.

parser :

the RssParser that received the signal

user_data :

user data set when the signal handler was connected.

The "parse-start" signal

void                user_function                      (RssParser *parser,
                                                        gpointer   user_data)      : Run Last

The ::parse-signal is emitted when the parser began parsing a RSS data stream.

parser :

the RssParser that received the signal

user_data :

user data set when the signal handler was connected.