#include <glib-object.h>
#include <gio/gio.h>
Go to the source code of this file.
|
GType | ev_metadata_get_type (void) G_GNUC_CONST |
|
EvMetadata * | ev_metadata_new (GFile *file) |
|
gboolean | ev_metadata_is_empty (EvMetadata *metadata) |
|
gboolean | ev_metadata_get_string (EvMetadata *metadata, const gchar *key, gchar **value) |
|
gboolean | ev_metadata_set_string (EvMetadata *metadata, const gchar *key, const gchar *value) |
|
gboolean | ev_metadata_get_int (EvMetadata *metadata, const gchar *key, gint *value) |
|
gboolean | ev_metadata_set_int (EvMetadata *metadata, const gchar *key, gint value) |
|
gboolean | ev_metadata_get_double (EvMetadata *metadata, const gchar *key, gdouble *value) |
|
gboolean | ev_metadata_set_double (EvMetadata *metadata, const gchar *key, gdouble value) |
|
gboolean | ev_metadata_get_boolean (EvMetadata *metadata, const gchar *key, gboolean *value) |
|
gboolean | ev_metadata_set_boolean (EvMetadata *metadata, const gchar *key, gboolean value) |
|
gboolean | ev_metadata_has_key (EvMetadata *metadata, const gchar *key) |
|
gboolean | ev_is_metadata_supported_for_file (GFile *file) |
|
#define EV_IS_METADATA |
( |
|
object) | |
(G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_METADATA)) |
gboolean ev_is_metadata_supported_for_file |
( |
GFile * |
file) | |
|
Definition at line 305 of file ev-metadata.c.
307 GFileAttributeInfoList *namespaces;
309 gboolean retval =
FALSE;
311 namespaces = g_file_query_writable_namespaces (file, NULL, NULL);
315 for (i = 0; i < namespaces->n_infos; i++) {
316 if (strcmp (namespaces->infos[i].name,
"metadata") == 0) {
322 g_file_attribute_info_list_unref (namespaces);
gboolean ev_metadata_get_boolean |
( |
EvMetadata * |
metadata, |
|
|
const gchar * |
key, |
|
|
gboolean * |
value |
|
) |
| |
gboolean ev_metadata_get_double |
( |
EvMetadata * |
metadata, |
|
|
const gchar * |
key, |
|
|
gdouble * |
value |
|
) |
| |
Definition at line 244 of file ev-metadata.c.
250 gdouble double_value;
255 double_value = g_ascii_strtod (string_value, &endptr);
256 if (double_value == 0. && string_value == endptr)
259 *value = double_value;
gboolean ev_metadata_get_int |
( |
EvMetadata * |
metadata, |
|
|
const gchar * |
key, |
|
|
gint * |
value |
|
) |
| |
Definition at line 212 of file ev-metadata.c.
223 int_value = g_ascii_strtoull (string_value, &endptr, 0);
224 if (int_value == 0 && string_value == endptr)
gboolean ev_metadata_get_string |
( |
EvMetadata * |
metadata, |
|
|
const gchar * |
key, |
|
|
gchar ** |
value |
|
) |
| |
GType ev_metadata_get_type |
( |
void |
) | |
|
gboolean ev_metadata_has_key |
( |
EvMetadata * |
metadata, |
|
|
const gchar * |
key |
|
) |
| |
Definition at line 298 of file ev-metadata.c.
301 return g_hash_table_lookup (metadata->
items, key) != NULL;
gboolean ev_metadata_is_empty |
( |
EvMetadata * |
metadata) | |
|
Definition at line 126 of file ev-metadata.c.
130 g_return_val_if_fail (G_IS_FILE (file), NULL);
134 metadata->
file = g_object_ref (file);
gboolean ev_metadata_set_boolean |
( |
EvMetadata * |
metadata, |
|
|
const gchar * |
key, |
|
|
gboolean |
value |
|
) |
| |
gboolean ev_metadata_set_double |
( |
EvMetadata * |
metadata, |
|
|
const gchar * |
key, |
|
|
gdouble |
value |
|
) |
| |
Definition at line 264 of file ev-metadata.c.
268 gchar string_value[G_ASCII_DTOSTR_BUF_SIZE];
270 g_ascii_dtostr (string_value, G_ASCII_DTOSTR_BUF_SIZE, value);
gboolean ev_metadata_set_int |
( |
EvMetadata * |
metadata, |
|
|
const gchar * |
key, |
|
|
gint |
value |
|
) |
| |
Definition at line 232 of file ev-metadata.c.
236 gchar string_value[32];
238 g_snprintf (string_value,
sizeof (string_value),
"%d", value);
gboolean ev_metadata_set_string |
( |
EvMetadata * |
metadata, |
|
|
const gchar * |
key, |
|
|
const gchar * |
value |
|
) |
| |
Definition at line 176 of file ev-metadata.c.
183 g_hash_table_insert (metadata->
items, g_strdup (key), g_strdup (value));
187 info = g_file_info_new ();
191 g_file_info_set_attribute_string (info, gio_key, value);
193 g_file_info_set_attribute (info, gio_key,
194 G_FILE_ATTRIBUTE_TYPE_INVALID,
199 g_file_set_attributes_async (metadata->
file,
206 g_object_unref (info);