Module gwy :: Class StringList
[hide private]
[frames] | no frames]

Class StringList

source code

A string list object wrapper

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

Instance Methods [hide private]
 
__init__()
Creates a new string list.
source code
 
append(string)
Appends a string to the end of a string list.
source code
 
append_take(string)
Appends a string to the end of a string list, taking ownership of the string.
source code
 
get_length()
Gets the number of strings in a string list.
source code
 
get(i)
Gets a string from a string list by position.
source code
 
clear()
Clears the contents of a string list, removing all strings.
source code
 
duplicate()
Convenience macro doing gwy_serializable_duplicate() with all the necessary typecasting.
source code
Method Details [hide private]

__init__()
(Constructor)

source code 

Creates a new string list.

Returns:
A new empty string list. (StringList)

append(string)

source code 

Appends a string to the end of a string list.

Parameters:
  • string - A string to add. (string)

append_take(string)

source code 

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

Parameters:
  • string - A string to add. (string)

Since: 2.35

get_length()

source code 

Gets the number of strings in a string list.

Returns:
The number of strings in strlist. (int)

get(i)

source code 

Gets a string from a string list by position.

Parameters:
  • i - The position of string to get. (int)
Returns:
The string, owned by strlist. It is valid only until strlist changes. (string)

clear()

source code 

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

Since: 2.35

duplicate()

source code 

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

Returns:
(StringList)