Modulemd.Translation

Modulemd.Translation — Translation information for a module stream

Functions

Types and Values

Description

Functions

modulemd_translation_error_quark ()

GQuark
modulemd_translation_error_quark (void);

modulemd_translation_new ()

ModulemdTranslation *
modulemd_translation_new (void);

Creates a new, uninitialized ModulemdTranslation object. Use .import_from_*() to initialize from an existing source.

Since: 1.6


modulemd_translation_new_full ()

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.

Parameters

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


modulemd_translation_copy ()

ModulemdTranslation *
modulemd_translation_copy (ModulemdTranslation *self);

Make a deep copy of a ModulemdTranslation.

Returns

A newly-allocated ModulemdTranslation identical to the one passed in. This object must be freed with g_object_unref().

[transfer full]

Since: 1.6


modulemd_translation_import_from_file ()

gboolean
modulemd_translation_import_from_file (ModulemdTranslation *self,
                                       const gchar *yaml_file,
                                       GError **error);

Parameters

yaml_file

The path to a YAML file that contains one modulemd-translations subdocument.

[transfer none][not nullable]

Returns

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


modulemd_translation_import_from_string ()

gboolean
modulemd_translation_import_from_string
                               (ModulemdTranslation *self,
                                const gchar *yaml,
                                GError **error);

Parameters

yaml

A string that contains one modulemd-translations YAML subdocument.

[transfer none][not nullable]

Returns

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


modulemd_translation_import_from_stream ()

gboolean
modulemd_translation_import_from_stream
                               (ModulemdTranslation *self,
                                FILE *yaml_stream,
                                GError **error);

Parameters

yaml_stream

A YAML stream that contains one modulemd-translations YAML subdocument.

[transfer none][not nullable]

Returns

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


modulemd_translation_dump ()

gboolean
modulemd_translation_dump (ModulemdTranslation *self,
                           const gchar *yaml_file,
                           GError **error);

Writes this module stream translation out to a YAML document on disk.

Parameters

yaml_file

A string containing the path to the output file

 

Returns

False if the file could not be written and sets error .

Since: 1.6


modulemd_translation_dumps ()

gchar *
modulemd_translation_dumps (ModulemdTranslation *self,
                            GError **error);

Writes this module out to a YAML document string.

Returns

The serialized YAML representation of this module stream translation or NULL and sets error appropriately. The returned string must be freed with g_free().

[transfer full]

Since: 1.6


modulemd_translation_set_mdversion ()

void
modulemd_translation_set_mdversion (ModulemdTranslation *self,
                                    guint64 version);

Parameters

version

The version of the modulemd-translation format in use

 

Since: 1.6


modulemd_translation_get_mdversion ()

guint64
modulemd_translation_get_mdversion (ModulemdTranslation *self);

Returns

The version of the modulemd-translation format in use

Since: 1.6


modulemd_translation_set_module_name ()

void
modulemd_translation_set_module_name (ModulemdTranslation *self,
                                      const gchar *module_name);

Parameters

module_name

The module name to which these translations apply.

[transfer none][not nullable]

Since: 1.6


modulemd_translation_get_module_name ()

gchar *
modulemd_translation_get_module_name (ModulemdTranslation *self);

Returns

The name of the module to which these translations apply. This string must be freed with g_free().

[transfer full]

Since: 1.6


modulemd_translation_peek_module_name ()

const gchar *
modulemd_translation_peek_module_name (ModulemdTranslation *self);

[skip]

Returns

The name of the module to which these translations apply. This string must not be modified or freed.

[transfer none]

Since: 1.6


modulemd_translation_set_module_stream ()

void
modulemd_translation_set_module_stream
                               (ModulemdTranslation *self,
                                const gchar *module_stream);

Parameters

module_stream

The module stream to which these translations apply.

[transfer none][not nullable]

Since: 1.6


modulemd_translation_get_module_stream ()

gchar *
modulemd_translation_get_module_stream
                               (ModulemdTranslation *self);

Returns

The name of the module stream to which these translations apply. This string must be freed with g_free().

[transfer full]

Since: 1.6


modulemd_translation_peek_module_stream ()

const gchar *
modulemd_translation_peek_module_stream
                               (ModulemdTranslation *self);

[skip]

Returns

The name of the module stream to which these translations apply. This string must not be modified or freed.

[transfer none]

Since: 1.6


modulemd_translation_set_modified ()

void
modulemd_translation_set_modified (ModulemdTranslation *self,
                                   guint64 modified);

Parameters

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


modulemd_translation_get_modified ()

guint64
modulemd_translation_get_modified (ModulemdTranslation *self);

Returns

A 64-bit unsigned integer representing the last modified time.

Since: 1.6


modulemd_translation_add_entry ()

void
modulemd_translation_add_entry (ModulemdTranslation *self,
                                ModulemdTranslationEntry *entry);

Parameters

entry

A set of translations of this module stream for a particular language.

[transfer none][not nullable]

Since: 1.6


modulemd_translation_get_entry_by_locale ()

ModulemdTranslationEntry *
modulemd_translation_get_entry_by_locale
                               (ModulemdTranslation *self,
                                const gchar *locale);

Parameters

locale

The locale of the translation to retrieve. It must correspond to the format specified by libc locale names.

[transfer none][not nullable]

Returns

A ModulemdTranslationEntry containing the translations for the requested locale. This object must be freed with g_object_unref().

[transfer full]

Since: 1.6


modulemd_translation_get_locales ()

GPtrArray *
modulemd_translation_get_locales (ModulemdTranslation *self);

Returns

A sorted list of locales known to this ModulemdTranslation.

[transfer container][element-type utf8]

Since: 1.6

Types and Values

MODULEMD_TRANSLATION_ERROR

#define MODULEMD_TRANSLATION_ERROR modulemd_translation_error_quark ()

MD_TRANSLATION_VERSION_LATEST

#define MD_TRANSLATION_VERSION_LATEST MD_TRANSLATION_VERSION_1

MODULEMD_TYPE_TRANSLATION

#define MODULEMD_TYPE_TRANSLATION (modulemd_translation_get_type ())

ModulemdTranslation

typedef struct _ModulemdTranslation ModulemdTranslation;