| GIMP Application Reference Manual | ||||
|---|---|---|---|---|
GimpXmlParser;
GimpXmlParser* gimp_xml_parser_new (const GMarkupParser *markup_parser,
gpointer user_data);
gboolean gimp_xml_parser_parse_file (GimpXmlParser *parser,
const gchar *filename,
GError **error);
gboolean gimp_xml_parser_parse_fd (GimpXmlParser *parser,
gint fd,
GError **error);
gboolean gimp_xml_parser_parse_io_channel (GimpXmlParser *parser,
GIOChannel *io,
GError **error);
gboolean gimp_xml_parser_parse_buffer (GimpXmlParser *parser,
const gchar *buffer,
gssize len,
GError **error);
void gimp_xml_parser_free (GimpXmlParser *parser);
GimpXmlParser* gimp_xml_parser_new (const GMarkupParser *markup_parser, gpointer user_data);
GimpXmlParser is a thin wrapper around GMarkupParser. This function creates one for you and sets up a GMarkupParseContext.
|
a GMarkupParser |
|
user data to pass to GMarkupParser functions |
Returns : |
a new GimpXmlParser |
gboolean gimp_xml_parser_parse_file (GimpXmlParser *parser, const gchar *filename, GError **error);
This function creates a GIOChannel for filename and calls
gimp_xml_parser_parse_io_channel() for you.
|
a GimpXmlParser |
|
name of a file to parse |
|
return location for possible errors |
Returns : |
TRUE on success, FALSE otherwise
|
gboolean gimp_xml_parser_parse_fd (GimpXmlParser *parser, gint fd, GError **error);
This function creates a GIOChannel for fd and calls
gimp_xml_parser_parse_io_channel() for you.
|
a GimpXmlParser |
|
a file descriptor |
|
return location for possible errors |
Returns : |
TRUE on success, FALSE otherwise
|
gboolean gimp_xml_parser_parse_io_channel (GimpXmlParser *parser, GIOChannel *io, GError **error);
Makes parser read from the specified io channel. This function
returns when the GIOChannel becomes empty (end of file) or an
error occurs, either reading from io or parsing the read data.
This function tries to determine the character encoding from the XML header and converts the content to UTF-8 for you. For this feature to work, the XML header with the encoding attribute must be contained in the first 4096 bytes read. Otherwise UTF-8 encoding will be assumed and parsing may break later if this assumption was wrong.
|
a GimpXmlParser |
|
a GIOChannel |
|
return location for possible errors |
Returns : |
TRUE on success, FALSE otherwise
|
gboolean gimp_xml_parser_parse_buffer (GimpXmlParser *parser, const gchar *buffer, gssize len, GError **error);
This function uses the given parser to parse the XML in buffer.
|
a GimpXmlParser |
|
a string buffer |
|
the number of byes in buffer or -1 if buffer is nul-terminated
|
|
return location for possible errors |
Returns : |
TRUE on success, FALSE otherwise
|
void gimp_xml_parser_free (GimpXmlParser *parser);
Frees the resources allocated for parser. You must not access
parser after calling this function.
|
a GimpXmlParser |