Top |
#define | MODULEMD_TRANSLATION_ERROR |
#define | MD_TRANSLATION_VERSION_LATEST |
#define | MODULEMD_TYPE_TRANSLATION |
ModulemdTranslation |
ModulemdTranslation *
modulemd_translation_new (void
);
Creates a new, uninitialized ModulemdTranslation object. Use .import_from_*() to initialize from an existing source.
Since: 1.6
ModulemdTranslation * modulemd_translation_new_full (const gchar *module_name
,const gchar *module_stream
,guint64 mdversion
,guint64 modified
);
Creates a new ModulemdTranslation object and initializes its basic information.
module_name |
The name of the module to which these translations apply. |
[transfer none] |
module_stream |
The name of the stream to which these translations apply. |
[transfer none] |
mdversion |
The metadata version of the document. |
|
modified |
The last modified time represented as a 64-bit integer (such as 201807011200) |
Since: 1.6
ModulemdTranslation *
modulemd_translation_copy (ModulemdTranslation *self
);
Make a deep copy of a ModulemdTranslation.
A newly-allocated ModulemdTranslation identical to
the one passed in. This object must be freed with g_object_unref()
.
Since: 1.6
gboolean modulemd_translation_import_from_file (ModulemdTranslation *self
,const gchar *yaml_file
,GError **error
);
yaml_file |
The path to a YAML file that contains one modulemd-translations subdocument. |
[transfer none][not nullable] |
TRUE if the YAML document was a valid modulemd-translations document
and populates self
with its contents. If any error occurs, error
is set
appropriately and the function returns FALSE.
Since: 1.6
gboolean modulemd_translation_import_from_string (ModulemdTranslation *self
,const gchar *yaml
,GError **error
);
yaml |
A string that contains one modulemd-translations YAML subdocument. |
[transfer none][not nullable] |
TRUE if the YAML document was a valid modulemd-translations document
and populates self
with its contents. If any error occurs, error
is set
appropriately and the function returns FALSE.
Since: 1.6
gboolean modulemd_translation_import_from_stream (ModulemdTranslation *self
,FILE *yaml_stream
,GError **error
);
yaml_stream |
A YAML stream that contains one modulemd-translations YAML subdocument. |
[transfer none][not nullable] |
TRUE if the YAML document was a valid modulemd-translations document
and populates self
with its contents. If any error occurs, error
is set
appropriately and the function returns FALSE.
Since: 1.6
gboolean modulemd_translation_dump (ModulemdTranslation *self
,const gchar *yaml_file
,GError **error
);
Writes this module stream translation out to a YAML document on disk.
Since: 1.6
gchar * modulemd_translation_dumps (ModulemdTranslation *self
,GError **error
);
Writes this module out to a YAML document string.
The serialized YAML representation of this module
stream translation or NULL and sets error
appropriately. The returned string
must be freed with g_free()
.
Since: 1.6
void modulemd_translation_set_mdversion (ModulemdTranslation *self
,guint64 version
);
Since: 1.6
guint64
modulemd_translation_get_mdversion (ModulemdTranslation *self
);
Since: 1.6
void modulemd_translation_set_module_name (ModulemdTranslation *self
,const gchar *module_name
);
module_name |
The module name to which these translations apply. |
[transfer none][not nullable] |
Since: 1.6
gchar *
modulemd_translation_get_module_name (ModulemdTranslation *self
);
The name of the module to which these translations
apply. This string must be freed with g_free()
.
Since: 1.6
const gchar *
modulemd_translation_peek_module_name (ModulemdTranslation *self
);
[skip]
The name of the module to which these translations apply. This string must not be modified or freed.
Since: 1.6
void modulemd_translation_set_module_stream (ModulemdTranslation *self
,const gchar *module_stream
);
module_stream |
The module stream to which these translations apply. |
[transfer none][not nullable] |
Since: 1.6
gchar *
modulemd_translation_get_module_stream
(ModulemdTranslation *self
);
The name of the module stream to which these
translations apply. This string must be freed with g_free()
.
Since: 1.6
const gchar *
modulemd_translation_peek_module_stream
(ModulemdTranslation *self
);
[skip]
The name of the module stream to which these translations apply. This string must not be modified or freed.
Since: 1.6
void modulemd_translation_set_modified (ModulemdTranslation *self
,guint64 modified
);
modified |
A 64-bit unsigned integer. Use YYYYMMDDHHMM to easily identify the last modification time. Use UTC for consistency. When merging, entries with a newer 'modified' value will override any earlier values. |
Since: 1.6
guint64
modulemd_translation_get_modified (ModulemdTranslation *self
);
Since: 1.6
void modulemd_translation_add_entry (ModulemdTranslation *self
,ModulemdTranslationEntry *entry
);
entry |
A set of translations of this module stream for a particular language. |
[transfer none][not nullable] |
Since: 1.6
ModulemdTranslationEntry * modulemd_translation_get_entry_by_locale (ModulemdTranslation *self
,const gchar *locale
);
locale |
The locale of the translation to retrieve. It must correspond to the format specified by libc locale names. |
[transfer none][not nullable] |
A ModulemdTranslationEntry containing the
translations for the requested locale. This object must be freed with
g_object_unref()
.
Since: 1.6
GPtrArray *
modulemd_translation_get_locales (ModulemdTranslation *self
);
A sorted list of locales known to this ModulemdTranslation.
[transfer container][element-type utf8]
Since: 1.6