GwyStringList

GwyStringList — A string list object wrapper

Functions

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GwyStringList

Implemented Interfaces

GwyStringList implements GwySerializable.

Includes

#include <libgwyddion/gwyddion.h>

Description

GwyStringList object represents a reference-counted, serializable list of strings. The current interface is very minimal, more methods may be added later as needed.

Functions

gwy_string_list_duplicate()

#define             gwy_string_list_duplicate(strlist)

Convenience macro doing gwy_serializable_duplicate() with all the necessary typecasting.

Parameters

strlist

A string list to duplicate.

 

gwy_string_list_new ()

GwyStringList *
gwy_string_list_new (void);

Creates a new string list.

Returns

A new empty string list.


gwy_string_list_append ()

void
gwy_string_list_append (GwyStringList *strlist,
                        const gchar *string);

Appends a string to the end of a string list.

Parameters

strlist

A string list.

 

string

A string to add.

 

gwy_string_list_append_take ()

void
gwy_string_list_append_take (GwyStringList *strlist,
                             gchar *string);

Appends a string to the end of a string list, taking ownership of the string.

Parameters

strlist

A string list.

 

string

A string to add.

 

Since: 2.35


gwy_string_list_get_length ()

guint
gwy_string_list_get_length (GwyStringList *strlist);

Gets the number of strings in a string list.

Parameters

strlist

A string list.

 

Returns

The number of strings in strlist .


gwy_string_list_get ()

const gchar *
gwy_string_list_get (GwyStringList *strlist,
                     guint i);

Gets a string from a string list by position.

Parameters

strlist

A string list.

 

i

The position of string to get.

 

Returns

The string, owned by strlist . It is valid only until strlist changes.


gwy_string_list_clear ()

void
gwy_string_list_clear (GwyStringList *strlist);

Clears the contents of a string list, removing all strings.

Parameters

strlist

A string list.

 

Since: 2.35

Types and Values

struct GwyStringList

struct GwyStringList;

The GwyStringList struct contains private data only and should be accessed using the functions below.


struct GwyStringListClass

struct GwyStringListClass {
    GObjectClass parent_class;

    void (*value_changed)(GwyStringList *strlist);
};

Signal Details

The “value-changed” signal

void
user_function (GwyStringList *gwystrlist,
               gpointer       user_data)

The ::value-changed signal is emitted whenever a string list changes.

Parameters

gwystrlist

The GwyStringList which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First