Commit a0923b62 authored by Martin Nordholts's avatar Martin Nordholts

libgimpconfig: Add gimp_config_serialize() and _deserialize()

parent 93d8b91d
......@@ -40,6 +40,9 @@
<index role="GIMP 2.6" id="libgimpconfig-index-new-in-2-6">
<title>Index of new symbols in GIMP 2.6</title>
</index>
<index role="GIMP 2.8" id="libgimpconfig-index-new-in-2-8">
<title>Index of new symbols in GIMP 2.8</title>
</index>
<index role="deprecated" id="libgimpconfig-index-deprecated">
<title>Index of deprecated symbols</title>
</index>
......
......@@ -492,6 +492,57 @@ gimp_config_deserialize_return (GScanner *scanner,
}
/**
* gimp_config_serialize:
* @config: a #GObject that implements the #GimpConfigInterface.
* @writer: the #GimpConfigWriter to use.
* @data: client data
*
* Serialize the #GimpConfig object.
*
* Returns: %TRUE if serialization succeeded, %FALSE otherwise.
*
* Since: GIMP 2.8
**/
gboolean
gimp_config_serialize (GimpConfig *config,
GimpConfigWriter *writer,
gpointer data)
{
g_return_val_if_fail (GIMP_IS_CONFIG (config), FALSE);
return GIMP_CONFIG_GET_INTERFACE (config)->serialize (config,
writer,
data);
}
/**
* gimp_config_deserialize:
* @config: a #GObject that implements the #GimpConfigInterface.
* @scanner: the #GScanner to use.
* @nest_level: the nest level.
* @data: client data.
*
* Deserialize the #GimpConfig object.
*
* Returns: %TRUE if deserialization succeeded, %FALSE otherwise.
*
* Since: GIMP 2.8
**/
gboolean
gimp_config_deserialize (GimpConfig *config,
GScanner *scanner,
gint nest_level,
gpointer data)
{
g_return_val_if_fail (GIMP_IS_CONFIG (config), FALSE);
return GIMP_CONFIG_GET_INTERFACE (config)->deserialize (config,
scanner,
nest_level,
data);
}
/**
* gimp_config_duplicate:
* @config: a #GObject that implements the #GimpConfigInterface.
......
......@@ -69,37 +69,44 @@ struct _GimpConfigInterface
GType gimp_config_interface_get_type (void) G_GNUC_CONST;
gboolean gimp_config_serialize_to_file (GimpConfig *config,
const gchar *filename,
const gchar *header,
const gchar *footer,
gpointer data,
GError **error);
gboolean gimp_config_serialize_to_fd (GimpConfig *config,
gint fd,
gpointer data);
gchar * gimp_config_serialize_to_string (GimpConfig *config,
gpointer data);
gboolean gimp_config_deserialize_file (GimpConfig *config,
const gchar *filename,
gpointer data,
GError **error);
gboolean gimp_config_deserialize_string (GimpConfig *config,
const gchar *text,
gint text_len,
gpointer data,
GError **error);
gboolean gimp_config_deserialize_return (GScanner *scanner,
GTokenType expected_token,
gint nest_level);
gpointer gimp_config_duplicate (GimpConfig *config);
gboolean gimp_config_is_equal_to (GimpConfig *a,
GimpConfig *b);
void gimp_config_reset (GimpConfig *config);
gboolean gimp_config_copy (GimpConfig *src,
GimpConfig *dest,
GParamFlags flags);
gboolean gimp_config_serialize_to_file (GimpConfig *config,
const gchar *filename,
const gchar *header,
const gchar *footer,
gpointer data,
GError **error);
gboolean gimp_config_serialize_to_fd (GimpConfig *config,
gint fd,
gpointer data);
gchar * gimp_config_serialize_to_string (GimpConfig *config,
gpointer data);
gboolean gimp_config_deserialize_file (GimpConfig *config,
const gchar *filename,
gpointer data,
GError **error);
gboolean gimp_config_deserialize_string (GimpConfig *config,
const gchar *text,
gint text_len,
gpointer data,
GError **error);
gboolean gimp_config_deserialize_return (GScanner *scanner,
GTokenType expected_token,
gint nest_level);
gboolean gimp_config_serialize (GimpConfig *config,
GimpConfigWriter *writer,
gpointer data);
gboolean gimp_config_deserialize (GimpConfig *config,
GScanner *scanner,
gint nest_level,
gpointer data);
gpointer gimp_config_duplicate (GimpConfig *config);
gboolean gimp_config_is_equal_to (GimpConfig *a,
GimpConfig *b);
void gimp_config_reset (GimpConfig *config);
gboolean gimp_config_copy (GimpConfig *src,
GimpConfig *dest,
GParamFlags flags);
G_END_DECLS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment