Modulemd.SimpleSet

Modulemd.SimpleSet — Stores a set of strings, guaranteeing uniqueness.

Functions

Types and Values

Description

Functions

modulemd_simpleset_new ()

ModulemdSimpleSet *
modulemd_simpleset_new (void);

Returns

A newly-allocated ModulemdSimpleset. This object must be freed with g_object_unref().

[transfer full]

Since: 1.0


modulemd_simpleset_contains ()

gboolean
modulemd_simpleset_contains (ModulemdSimpleSet *self,
                             const gchar *value);

Parameters

value

A string to compare against the set

 

Returns

TRUE if the value existed in the set.

Since: 1.0


modulemd_simpleset_size ()

guint
modulemd_simpleset_size (ModulemdSimpleSet *self);

Returns

The number of elements in the set

Since: 1.0


modulemd_simpleset_set ()

void
modulemd_simpleset_set (ModulemdSimpleSet *self,
                        gchar **set);

Make the contents of the set equal to an array of strings. This function will trigger a signal only if the resulting set is different. It does not guarantee any order to the resulting set, only that it will be unique.

Parameters

set

Extensible metadata block.

[array zero-terminated=1][transfer none]

Since: 1.0


modulemd_simpleset_get ()

gchar **
modulemd_simpleset_get (ModulemdSimpleSet *self);

Retrieves the set as an array of strings

Returns

A list representing a set of string values.

[array zero-terminated=1][transfer full]

Since: 1.0


modulemd_simpleset_dup ()

gchar **
modulemd_simpleset_dup (ModulemdSimpleSet *self);

Retrieves the set as an array of strings

Returns

A list representing a set of string values.

[array zero-terminated=1][transfer full]

Since: 1.1


modulemd_simpleset_add ()

void
modulemd_simpleset_add (ModulemdSimpleSet *self,
                        const gchar *value);

This routine will add a new value to the set if it is not already present.

Parameters

value

A new string to add to the set

 

Since: 1.0


modulemd_simpleset_remove ()

void
modulemd_simpleset_remove (ModulemdSimpleSet *self,
                           const gchar *value);

This routine will remove a value from the set if it is present.

Parameters

value

A string to remove from the set

 

modulemd_simpleset_copy ()

void
modulemd_simpleset_copy (ModulemdSimpleSet *self,
                         ModulemdSimpleSet **dest);

This function will copy the contents of this ModulemdSimpleSet to dest . If the dereferenced pointer is NULL, a new ModulemdSimpleSet will be allocated.

If the dereferenced pointer is not NULL, it will replace the contents of dest . All existing values in the set will be freed.

In either case, the caller is responsible for calling g_object_unref() later to free it.

Parameters

dest

A reference to the destination ModulemdSimpleSet.

[out][transfer full]

Since: 1.0


modulemd_simpleset_is_equal ()

gboolean
modulemd_simpleset_is_equal (ModulemdSimpleSet *self,
                             ModulemdSimpleSet *other);

Parameters

other

A ModulemdSimpleSet to compare against

 

Returns

True if the sets contain the same strings.

Since: 1.3


ModulemdSimpleSetValidationFn ()

gboolean
(*ModulemdSimpleSetValidationFn) (const gchar *str);

modulemd_simpleset_validate_contents ()

gboolean
modulemd_simpleset_validate_contents (ModulemdSimpleSet *self,
                                      ModulemdSimpleSetValidationFn func,
                                      GPtrArray **failures);

Parameters

func

a SimpleSetValidationFn that will be run against each entry in the set.

[scope call]

failures

An array of strings in the set that failed the validation function. If this returns non-NULL, it must be freed with g_ptr_array_unref().

[array zero-terminated=1][element-type utf8][out][nullable]

Returns

TRUE if all members of the set passed the validation. If any of the set fails validation, they will be returned via failures.

Since: 1.4

Types and Values

MODULEMD_TYPE_SIMPLESET

#define MODULEMD_TYPE_SIMPLESET modulemd_simpleset_get_type ()

ModulemdSimpleSet

typedef struct _ModulemdSimpleSet ModulemdSimpleSet;