EDataServer.NamedParameters

Fields

None

Methods

class

new ()

class

new_string (str)

class

new_strv (strv)

assign (from_)

clear ()

count ()

equal (parameters2)

exists (name)

free ()

get (name)

get_name (index)

new_clone ()

set (name, value)

test (name, value, case_sensitively)

to_string ()

to_strv ()

Details

class EDataServer.NamedParameters

New in version 3.8.

classmethod new()
Returns:

newly allocated EDataServer.NamedParameters

Return type:

EDataServer.NamedParameters

Creates a new instance of an EDataServer.NamedParameters. This should be freed with EDataServer.NamedParameters.free(), when no longer needed. Names are compared case insensitively.

The structure is not thread safe, if the caller requires thread safety, then it should provide it on its own.

New in version 3.8.

classmethod new_string(str)
Parameters:

str (str) – a string to be used as a content of a newly created EDataServer.NamedParameters

Returns:

newly allocated EDataServer.NamedParameters

Return type:

EDataServer.NamedParameters

Creates a new instance of an EDataServer.NamedParameters, with initial content being taken from str. This should be freed with EDataServer.NamedParameters.free(), when no longer needed. Names are compared case insensitively.

The str should be created with EDataServer.NamedParameters.to_string(), to be properly encoded.

The structure is not thread safe, if the caller requires thread safety, then it should provide it on its own.

New in version 3.18.

classmethod new_strv(strv)
Parameters:

strv (str) – None-terminated string array to be used as a content of a newly created EDataServer.NamedParameters

Returns:

newly allocated EDataServer.NamedParameters

Return type:

EDataServer.NamedParameters

Creates a new instance of an EDataServer.NamedParameters, with initial content being taken from strv. This should be freed with EDataServer.NamedParameters.free(), when no longer needed. Names are compared case insensitively.

The structure is not thread safe, if the caller requires thread safety, then it should provide it on its own.

New in version 3.8.

assign(from_)
Parameters:

from (EDataServer.NamedParameters or None) – an EDataServer.NamedParameters to get values from, or None

Makes content of the self the same as from. Functions clears content of self if from is None.

New in version 3.8.

clear()

Removes all stored parameters from self.

New in version 3.8.

count()
Returns:

The number of stored named parameters in self

Return type:

int

New in version 3.18.

equal(parameters2)
Parameters:

parameters2 (EDataServer.NamedParameters) – the second EDataServer.NamedParameters

Returns:

whether the two parameters are equal

Return type:

bool

Compares the two parameters objects and returns whether they equal. Note a None and empty parameters are also considered equal.

New in version 3.46.

exists(name)
Parameters:

name (str) – name of the parameter whose existence to check

Returns:

Whether self holds a parameter named name

Return type:

bool

New in version 3.18.

free()

Frees an instance of EDataServer.NamedParameters, previously allocated with EDataServer.NamedParameters.new(). Function does nothing, if self is None.

New in version 3.8.

get(name)
Parameters:

name (str) – name of a parameter to get

Returns:

value of a parameter named name, or None.

Return type:

str or None

Returns current value of a parameter with name name. If not such exists, then returns None.

New in version 3.8.

get_name(index)
Parameters:

index (int) – an index of the parameter whose name to retrieve

Returns:

The name of the parameters at index index, or None, of the index is out of bounds or other error. The returned string should be freed with GLib.free() when done with it.

Return type:

str or None

New in version 3.18.

new_clone()
Returns:

newly allocated EDataServer.NamedParameters

Return type:

EDataServer.NamedParameters

Creates a new instance of an EDataServer.NamedParameters, with initial content being taken from self. This should be freed with EDataServer.NamedParameters.free(), when no longer needed. Names are compared case insensitively.

The structure is not thread safe, if the caller requires thread safety, then it should provide it on its own.

New in version 3.16.

set(name, value)
Parameters:
  • name (str) – name of a parameter to set

  • value (str or None) – value to set, or None to unset

Sets parameter named name to value value. If value is None, then the parameter is removed. value can be an empty string.

Note: There is a restriction on parameter names, it cannot be empty or contain a colon character (’:’), otherwise it can be pretty much anything.

New in version 3.8.

test(name, value, case_sensitively)
Parameters:
  • name (str) – name of a parameter to test

  • value (str) – value to test

  • case_sensitively (bool) – whether to compare case sensitively

Returns:

Whether parameter of given name has stored value of given value.

Return type:

bool

Compares current value of parameter named name with given value and returns whether they are equal, either case sensitively or insensitively, based on case_sensitively argument. Function returns False, if no such parameter exists.

New in version 3.8.

to_string()
Returns:

Contents of self as a string

Return type:

str or None

New in version 3.18.

to_strv()
Returns:

Contents of self as a null-terminated strv

Return type:

[str]

New in version 3.8.