gi-glib-2.0.29: GLib bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GLib.Structs.StrvBuilder

Description

StrvBuilder is a method of easily building dynamically sized NULL-terminated string arrays.

The following example shows how to build a two element array:

C code

 g_autoptr(GStrvBuilder) builder = g_strv_builder_new ();
 g_strv_builder_add (builder, "hello");
 g_strv_builder_add (builder, "world");
 g_auto(GStrv) array = g_strv_builder_end (builder);

Since: 2.68

Synopsis

Exported types

newtype StrvBuilder Source #

Memory-managed wrapper type.

Constructors

StrvBuilder (ManagedPtr StrvBuilder) 

Instances

Instances details
Eq StrvBuilder Source # 
Instance details

Defined in GI.GLib.Structs.StrvBuilder

BoxedPtr StrvBuilder Source # 
Instance details

Defined in GI.GLib.Structs.StrvBuilder

ManagedPtrNewtype StrvBuilder Source # 
Instance details

Defined in GI.GLib.Structs.StrvBuilder

Methods

toManagedPtr :: StrvBuilder -> ManagedPtr StrvBuilder

Methods

Click to display all available methods, including inherited ones

Expand

Methods

add, addv, end.

Getters

None.

Setters

None.

add

strvBuilderAdd Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> StrvBuilder

builder: a StrvBuilder

-> Text

value: a string.

-> m () 

Add a string to the end of the array.

Since 2.68

addv

strvBuilderAddv Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> StrvBuilder

builder: a StrvBuilder

-> [Text]

value: the vector of strings to add

-> m () 

Appends all the strings in the given vector to the builder.

Since 2.70

end

strvBuilderEnd Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> StrvBuilder

builder: a StrvBuilder

-> m [Text]

Returns: the constructed string array.

Since 2.68

Ends the builder process and returns the constructed NULL-terminated string array. The returned value should be freed with strfreev when no longer needed.