GDataParsable

GDataParsable — GData parsable object

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <gdata/gdata-parsable.h>

                    GDataParsable;
                    GDataParsableClass;

Object Hierarchy

  GObject
   +----GDataParsable
         +----GDataEntry
         +----GDataFeed

Description

GDataParsable is an abstract class allowing easy implementation of an extensible parser. It is primarily extended by GDataFeed and GDataEntry, both of which require XML parsing which can be extended by subclassing.

It allows methods to be defined for handling the root XML node, each of its child nodes, and a method to be called after parsing is complete.

Details

GDataParsable

typedef struct _GDataParsable GDataParsable;

All the fields in the GDataParsable structure are private and should never be accessed directly.

Since 0.3.0


GDataParsableClass

typedef struct {
	GObjectClass parent;

	gboolean (*pre_parse_xml) (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error);
	gboolean (*parse_xml) (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error);
	gboolean (*post_parse_xml) (GDataParsable *parsable, gpointer user_data, GError **error);
} GDataParsableClass;

The class structure for the GDataParsable class.

GObjectClass parent;

the parent class

pre_parse_xml ()

a function called before parsing of an XML tree is started, which allows properties from the root node to be extracted and used in parsable

parse_xml ()

a function to parse an XML representation of the GDataParsable to set the properties of the parsable

post_parse_xml ()

a function called after parsing an XML tree, to allow the parsable to validate the parsed properties

Since 0.3.0