Top |
Modulemd.DefaultsModulemd.Defaults — Represents the default stream, profiles and other global data for a module. |
#define | MD_DEFAULTS_VERSION_LATEST |
#define | MODULEMD_DEFAULTS_ERROR |
#define | MODULEMD_TYPE_DEFAULTS |
ModulemdDefaults |
ModulemdDefaults *
modulemd_defaults_new (void
);
Since: 1.1
void modulemd_defaults_set_version (ModulemdDefaults *self
,guint64 version
);
Sets the version of the metadata in use.
Since: 1.1
guint64
modulemd_defaults_peek_version (ModulemdDefaults *self
);
Retrieves the metadata file format version.
Since: 1.1
void modulemd_defaults_set_module_name (ModulemdDefaults *self
,const gchar *name
);
Sets the "module-name" property.
Since: 1.1
const gchar *
modulemd_defaults_peek_module_name (ModulemdDefaults *self
);
Retrieves the module name to which these defaults apply.
a string containing the "module-name" property. This string must
not be modified or freed. If you need to do so, use
modulemd_defaults_dup_module_name()
instead.
Since: 1.1
gchar *
modulemd_defaults_dup_module_name (ModulemdDefaults *self
);
Retrieves the module name to which these defaults apply.
a string containing the "module-name" property. This string must be
freed with g_free()
when the caller is done with it.
Since: 1.1
void modulemd_defaults_set_default_stream (ModulemdDefaults *self
,const gchar *stream
);
Sets the "default-stream" property.
Since: 1.1
const gchar *
modulemd_defaults_peek_default_stream (ModulemdDefaults *self
);
Retrieves the default stream.
a string containing the "default-stream" property. This string
must not be modified or freed. If you need to do so, use
modulemd_defaults_dup_default_stream()
instead.
Since: 1.1
gchar *
modulemd_defaults_dup_default_stream (ModulemdDefaults *self
);
Retrieves the default stream.
a string containing the "default-stream" property. This string must
be freed with g_free()
when the caller is done with it.
Since: 1.1
void modulemd_defaults_set_profiles_for_stream (ModulemdDefaults *self
,const gchar *stream
,gchar **profiles
);
stream |
The name of the stream getting default profiles |
|
profiles |
The set of profile names to install by default when installing this stream of the module. |
[array zero-terminated=1][transfer none] |
Since: 1.1
void modulemd_defaults_assign_profiles_for_stream (ModulemdDefaults *self
,const gchar *stream
,ModulemdSimpleSet *profiles
);
stream |
The name of the stream getting default profiles |
|
profiles |
A ModulemdSimpleSet of profile names to install by default when installing this stream of the module. |
Since: 1.1
void modulemd_defaults_set_profile_defaults (ModulemdDefaults *self
,GHashTable *profile_defaults
);
Assigns the hash table of streams and their default profiles
Since: 1.1
gchar ** modulemd_defaults_dup_profiles_for_stream (ModulemdDefaults *self
,const gchar *stream
);
A zero-terminated array of strings that provides the list of profiles that should be installed by default when this stream is specified.
[array zero-terminated=1][transfer full]
Since: 1.1
GHashTable *
modulemd_defaults_peek_profile_defaults
(ModulemdDefaults *self
);
Retrieves a hash table of the profile defaults.
A GHashTable
containing the set of profile defaults for streams of this module. This hash
table is maintained by the ModulemdDefaults object and must not be freed or
modified. If modification is necessary, use
modulemd_defaults_dup_profile_defaults()
instead.
[element-type utf8 ModulemdSimpleSet][transfer none]
Since: 1.1
GHashTable *
modulemd_defaults_dup_profile_defaults
(ModulemdDefaults *self
);
Retrieves a copy of the hash table of profile defaults.
A
GHashTable containing the set of profile defaults for streams of this
module. This hash table is a copy and must be freed with
g_hash_table_unref()
when the caller is finished with it. The elements it
contains are maintained by the hash table and will be automatically freed
when their key is removed or the hash table is freed.
[element-type utf8 ModulemdSimpleSet][transfer container]
Since: 1.1
void modulemd_defaults_add_intent (ModulemdDefaults *self
,ModulemdIntent *intent
);
Adds an intent object to the hash table.
Since: 1.5
void modulemd_defaults_set_intents (ModulemdDefaults *self
,GHashTable *intents
);
intents |
A GHashTable containing defaults for individual system intents. |
[element-type utf8 ModulemdIntent][nullable][transfer none] |
Since: 1.5
GHashTable *
modulemd_defaults_peek_intents (ModulemdDefaults *self
);
Get a pointer to the intents hash table. The returned table is managed by the ModulemdDefaults object and must not be modified or freed.
Since: 1.5
GHashTable *
modulemd_defaults_dup_intents (ModulemdDefaults *self
);
Get a copy of the intents hash table. The returned table is managed by the
caller and must be freed with g_hash_table_unref()
Since: 1.5
void modulemd_defaults_set_modified (ModulemdDefaults *self
,guint64 modified
);
Sets the modified field for these defaults.
Since: 1.8
guint64
modulemd_defaults_get_modified (ModulemdDefaults *self
);
Since: 1.8
ModulemdDefaults * modulemd_defaults_new_from_file (const gchar *yaml_file
,GError **error
);
Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.
A ModulemdDefaults object constructed the first valid
modulemd-defaults document in the given module stream. This must be freed
with g_object_unref()
when no longer needed.
Since: 1.2
ModulemdDefaults * modulemd_defaults_new_from_file_ext (const gchar *yaml_file
,GPtrArray **failures
,GError **error
);
Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.
yaml_file |
A YAML file containing the module metadata and other related information such as default streams. |
|
failures |
An array containing any subdocuments from the YAML file that failed to
parse. This must be freed with |
[element-type ModulemdSubdocument][transfer container][out] |
error |
A GError containing additional information if this function fails. |
[out] |
A ModulemdDefaults object constructed the first valid
modulemd-defaults document in the given module stream. This must be freed
with g_object_unref()
when no longer needed.
Since: 1.4
ModulemdDefaults * modulemd_defaults_new_from_string (const gchar *yaml_string
,GError **error
);
Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.
A ModulemdDefaults object constructed the first valid
modulemd-defaults document in the given module stream. This must be freed
with g_object_unref()
when no longer needed.
Since: 1.2
ModulemdDefaults * modulemd_defaults_new_from_string_ext (const gchar *yaml_string
,GPtrArray **failures
,GError **error
);
Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.
yaml_string |
A YAML string containing the module metadata and other related information such as default streams. |
|
failures |
An array containing any subdocuments from the YAML file that failed to
parse. This must be freed with |
[element-type ModulemdSubdocument][transfer container][out] |
error |
A GError containing additional information if this function fails. |
[out] |
A ModulemdDefaults object constructed the first valid
modulemd-defaults document in the given module stream. This must be freed
with g_object_unref()
when no longer needed.
Since: 1.4
ModulemdDefaults * modulemd_defaults_new_from_stream (FILE *stream
,GError **error
);
Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.
A ModulemdDefaults object constructed the first valid
modulemd-defaults document in the given module stream. This must be freed
with g_object_unref()
when no longer needed.
Since: 1.4
ModulemdDefaults * modulemd_defaults_new_from_stream_ext (FILE *stream
,GPtrArray **failures
,GError **error
);
Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.
stream |
A YAML stream containing the module metadata and other related information such as default streams. |
|
failures |
An array containing any subdocuments from the YAML file that failed to
parse. This must be freed with |
[element-type ModulemdSubdocument][transfer container][out] |
error |
A GError containing additional information if this function fails. |
[out] |
A ModulemdDefaults object constructed the first valid
modulemd-defaults document in the given module stream. This must be freed
with g_object_unref()
when no longer needed.
Since: 1.4
void modulemd_defaults_dump (ModulemdDefaults *self
,const gchar *file_path
);
Exports the YAML representation of this defaults object to a file.
Since: 1.1
void modulemd_defaults_dumps (ModulemdDefaults *self
,gchar **yaml_string
);
Exports the YAML representation of this defaults object to a string. The
caller is responsible for calling g_free()
on this string when they are
finished with it.
yaml_string |
File path for exporting the YAML representation of this defaults object. |
[out] |
Since: 1.1
ModulemdDefaults *
modulemd_defaults_copy (ModulemdDefaults *self
);
Since: 1.3
ModulemdDefaults * modulemd_defaults_merge (ModulemdDefaults *first
,ModulemdDefaults *second
,gboolean override
,GError **error
);
first |
A ModulemdDefaults object providing the base for the merge. |
|
second |
A ModulemdDefaults object being merged onto |
|
override |
In the case of a conflict, should |
A merged or replaced ModulemdDefaults object. In
case of unresolvable merge, NULL will be returned and an error will be set.
This object must be freed with g_object_unref()
.
Since: 1.3