diff options
Diffstat (limited to 'gdata/gdata-parsable.c')
-rw-r--r-- | gdata/gdata-parsable.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gdata/gdata-parsable.c b/gdata/gdata-parsable.c index 64fa1bfe..06ea6221 100644 --- a/gdata/gdata-parsable.c +++ b/gdata/gdata-parsable.c @@ -547,6 +547,29 @@ _gdata_parsable_new_from_json_node (GType parsable_type, JsonReader *reader, gpo return parsable; } +/** + * gdata_parsable_get_content_type: + * @self: a #GDataParsable + * + * Returns the content type upon which the #GDataParsable is built. For example, `application/atom+xml` or `application/json`. + * + * Return value: the parsable's content type + * + * Since: UNRELEASED + */ +const gchar * +gdata_parsable_get_content_type (GDataParsable *self) +{ + GDataParsableClass *klass; + + g_return_val_if_fail (GDATA_IS_PARSABLE (self), NULL); + + klass = GDATA_PARSABLE_GET_CLASS (self); + g_assert (klass->get_content_type != NULL); + + return klass->get_content_type (); +} + static void build_namespaces_cb (gchar *prefix, gchar *href, GString *output) { |