EBackend.CacheColumnValues

Fields

None

Methods

class

new ()

contains (name)

copy ()

free ()

get_size ()

init_iter (iter)

lookup (name)

put (name, value)

remove (name)

remove_all ()

take (name, value)

take_value (name, value)

Details

class EBackend.CacheColumnValues
classmethod new()
Returns:

a new EBackend.CacheColumnValues. Free with EBackend.CacheColumnValues.free(), when no longer needed.

Return type:

EBackend.CacheColumnValues

Creates a new EBackend.CacheColumnValues to store values for additional columns. The column names are compared case insensitively.

New in version 3.26.

contains(name)
Parameters:

name (str) – a column name

Returns:

Whether self contains column named name.

Return type:

bool

New in version 3.26.

copy()
Returns:

Copy of the self. Free with EBackend.CacheColumnValues.free(), when no longer needed.

Return type:

EBackend.CacheColumnValues

New in version 3.26.

free()

Frees previously allocated self with EBackend.CacheColumnValues.new() or EBackend.CacheColumnValues.copy().

New in version 3.26.

get_size()
Returns:

How many columns are stored in the self.

Return type:

int

New in version 3.26.

init_iter(iter)
Parameters:

iter ({object: object}) – a GLib.HashTableIter

Initialized the iter, thus the self can be traversed with GLib.HashTableIter.next(). The key is a column name and the value is the corresponding column value.

New in version 3.26.

lookup(name)
Parameters:

name (str) – a column name

Returns:

Stored value for the column named name, or None, if no such column values is stored.

Return type:

str or None

Looks up currently stored value for the column named name. As the values can be None one cannot distinguish between a column which doesn’t have stored any value and a column which has stored None value. Use EBackend.CacheColumnValues.contains() to check whether such column exitst in the self. The returned pointer is owned by self and is valid until the value is overwritten of the self freed.

New in version 3.26.

put(name, value)
Parameters:
  • name (str) – a column name

  • value (str or None) – a column value

Puts the value for column name. If contains a value for the same column, then it is replaced. This creates a copy of both name and value.

New in version 3.26.

remove(name)
Parameters:

name (str) – a column name

Returns:

Whether such column existed and had been removed.

Return type:

bool

Removes value for the column named name from self.

New in version 3.26.

remove_all()

Removes all values from the self, leaving it empty.

New in version 3.26.

take(name, value)
Parameters:
  • name (str) – a column name

  • value (str or None) – a column value

Puts the value for column name. If contains a value for the same column, then it is replaced. This creates takes ownership of both the name and the value.

New in version 3.26.

take_value(name, value)
Parameters:
  • name (str) – a column name

  • value (str or None) – a column value

Puts the value for column name. If contains a value for the same column, then it is replaced. This creates a copy of the name, but takes owner ship of the value.

New in version 3.26.