Top |
TeplMetadata * | tepl_metadata_new () |
gchar * | tepl_metadata_get () |
void | tepl_metadata_set () |
A TeplMetadata object contains a set of file metadata as key/value pairs.
The tepl_metadata_get()
and tepl_metadata_set()
functions don't load or save
the metadata on disk, they only access the metadata stored in the
TeplMetadata object memory.
TeplMetadata is intended to be used alongside TeplMetadataManager to load and store the metadata on disk.
Keys must be non-empty strings containing only:
ASCII alphanumeric characters (see g_ascii_isalnum()
);
'-'
characters (hyphens / minus signs);
or '_'
characters (underscores).
Additionally, it's preferable that keys start with a namespace, to not get metadata conflicts between the application and libraries.
Examples of valid metadata keys:
"gedit-spell-checking-language"
"gCSVedit_column_delimiter"
"tepl-character-encoding"
gchar * tepl_metadata_get (TeplMetadata *metadata
,const gchar *key
);
Gets the value of a metadata stored in the metadata
object memory.
key
must follow the requirements explained in the class
description.
the associated value (a UTF-8 string),
or NULL
. Free with g_free()
when no longer needed.
[transfer full][nullable]
Since: 5.0
void tepl_metadata_set (TeplMetadata *metadata
,const gchar *key
,const gchar *value
);
Sets or unsets key
. This function just stores the new metadata value in the
metadata
object memory.
key
must follow the requirements explained in the class
description.
metadata |
a TeplMetadata. |
|
key |
a key. |
|
value |
a nul-terminated UTF-8 string, or |
[nullable] |
Since: 5.0