Modulemd.ModuleIndex

Modulemd.ModuleIndex — A simplistic wrapper around GHashTable to ensure type-safety for [Modulemd.Module](Modulemd.Module.md) objects.

Stability Level

Stable, unless otherwise indicated

Functions

Types and Values

Description

Functions

modulemd_module_index_new ()

ModulemdModuleIndex *
modulemd_module_index_new (void);

Returns

A newly-allocated ModulemdModuleIndex object.

[transfer full]

Since: 2.0


modulemd_module_index_update_from_file ()

gboolean
modulemd_module_index_update_from_file
                               (ModulemdModuleIndex *self,
                                const gchar *yaml_file,
                                GPtrArray **failures,
                                GError **error);

Parameters

self

This ModulemdModuleIndex object

 

yaml_file

A YAML file containing the module metadata and other related information such as default streams.

[in]

failures

An array containing any subdocuments from the YAML file that failed to parse. See ModulemdSubdocumentInfo for more details.

[out][element-type ModulemdSubdocumentInfo][transfer container]

error

A GError containing additional information if this function fails.

[out]

Returns

TRUE if the update was successful. Returns FALSE and sets failures and error approriately if any of the YAML subdocuments were invalid or if there was a parse error.

Since: 2.0


modulemd_module_index_update_from_string ()

gboolean
modulemd_module_index_update_from_string
                               (ModulemdModuleIndex *self,
                                const gchar *yaml_string,
                                GPtrArray **failures,
                                GError **error);

Parameters

self

This ModulemdModuleIndex object

 

yaml_string

A YAML string containing the module metadata and other related information such as default streams.

[in]

failures

An array containing any subdocuments from the YAML file that failed to parse. See ModulemdSubdocumentInfo for more details.

[out][element-type ModulemdSubdocumentInfo][transfer container]

error

A GError containing additional information if this function fails.

[out]

Returns

TRUE if the update was successful. Returns FALSE and sets failures and error approriately if any of the YAML subdocuments were invalid or if there was a parse error.

Since: 2.0


modulemd_module_index_update_from_stream ()

gboolean
modulemd_module_index_update_from_stream
                               (ModulemdModuleIndex *self,
                                FILE *yaml_stream,
                                GPtrArray **failures,
                                GError **error);

[skip]

Parameters

self

This ModulemdModuleIndex object

 

yaml_stream

A YAML stream containing the module metadata and other related information such as default streams.

[in]

failures

An array containing any subdocuments from the YAML file that failed to parse. See ModulemdSubdocumentInfo for more details.

[out][element-type ModulemdSubdocumentInfo][transfer container]

error

A GError containing additional information if this function fails.

[out]

Returns

TRUE if the update was successful. Returns FALSE and sets failures and error approriately if any of the YAML subdocuments were invalid or if there was a parse error.

Since: 2.0


modulemd_module_index_dump_to_string ()

const gchar *
modulemd_module_index_dump_to_string (ModulemdModuleIndex *self,
                                      GError **error);

Parameters

self

This ModulemdModuleIndex

 

error

A GError containing the reason the function failed, NULL if the function succeeded.

[out]

Returns

A YAML representation of the index as a string. In the event of an error, sets error appropriately and returns NULL.

[transfer full]

Since: 2.0


modulemd_module_index_dump_to_stream ()

gboolean
modulemd_module_index_dump_to_stream (ModulemdModuleIndex *self,
                                      FILE *yaml_stream,
                                      GError **error);

[skip]

Parameters

self

This ModulemdModuleIndex

 

yaml_stream

A stream to write the module metadata and other related information to.

[in]

error

A GError containing the reason the function failed, NULL if the function succeeded.

[out]

Returns

TRUE if written successfully, FALSE and sets error appropriately in the event of an error.

Since: 2.0


modulemd_module_index_get_module_names_as_strv ()

GStrv
modulemd_module_index_get_module_names_as_strv
                               (ModulemdModuleIndex *self);

[rename-to modulemd_module_index_get_module_names]

Parameters

self

This ModulemdModuleIndex

 

Returns

An ordered list of string keys in this index.

[transfer full]

Since: 2.0


modulemd_module_index_get_module ()

ModulemdModule *
modulemd_module_index_get_module (ModulemdModuleIndex *self,
                                  const gchar *module_name);

Parameters

self

This ModulemdModuleIndex

 

module_name

The module name to look up in the index.

 

Returns

The ModulemdModule object matching the provided module name or NULL if the key was not present in the index.

[transfer none]

Since: 2.0


modulemd_module_index_add_module_stream ()

gboolean
modulemd_module_index_add_module_stream
                               (ModulemdModuleIndex *self,
                                ModulemdModuleStream *stream,
                                GError **error);

Parameters

self

This ModulemdModuleIndex

 

stream

The ModulemdModuleStream to add to the index.

 

error

A GError containing the reason the ModulemdModuleStream object could not be added or NULL if the function succeeded.

[out]

Returns

TRUE if the ModulemdModule was added succesfully. If the stream already existed in the index, it will be replaced by the new one. On failure, returns FALSE and sets error appropriately.

Since: 2.0


modulemd_module_index_add_defaults ()

gboolean
modulemd_module_index_add_defaults (ModulemdModuleIndex *self,
                                    ModulemdDefaults *defaults,
                                    GError **error);

Parameters

self

This ModulemdModuleIndex

 

defaults

The ModulemdDefaults object to add to the index.

 

error

A GError containing the reason the ModulemdDefaults object could not be added or NULL if the function succeeded.

[out]

Returns

TRUE if the ModulemdDefaults was added succesfully. If the defaults already existed in the index, it will be replaced by the new one. On failure, returns FALSE and sets error approriately.

Since: 2.0


modulemd_module_index_add_translation ()

gboolean
modulemd_module_index_add_translation (ModulemdModuleIndex *self,
                                       ModulemdTranslation *translation,
                                       GError **error);

Types and Values

MODULEMD_TYPE_MODULE_INDEX

#define MODULEMD_TYPE_MODULE_INDEX (modulemd_module_index_get_type ())

ModulemdModuleIndex

typedef struct _ModulemdModuleIndex ModulemdModuleIndex;