Module gwy :: Class Container
[show private | hide private]
[frames | no frames]

Class Container


Container The Container struct contains private data only and should be accessed using the functions below.
Method Summary
  __init__()
Creates a new Container.
  contains(key)
Returns: Whether container contains something identified by key.
  contains_by_name(name)
Expands to True if container c contains a value identified by name n.
  get_boolean(key)
Returns: The boolean as gboolean.
  get_boolean_by_name(name)
Gets the boolean in container c identified by name n.
  get_double(key)
Returns: The double as gdouble.
  get_double_by_name(name)
Gets the double in container c identified by name n.
  get_enum(key)
Returns: The enum as gint.
  get_enum_by_name(name)
Gets the enum in container c identified by name n.
  get_int32(key)
Returns: The integer as guint32.
  get_int32_by_name(name)
Gets the 32bit integer in container c identified by name n.
  get_int64(key)
Returns: The 64bit integer as guint64.
  get_int64_by_name(name)
Gets the 64bit integer in container c identified by name n.
  get_n_items()
Gets the number of items in a container.
  get_object(key)
Get object of given key from container.
  get_object_by_name(name)
Gets the object in container c identified by name n.
  get_string(key)
Returns: The string.
  get_string_by_name(name)
Gets the string in container c identified by name n.
  get_uchar(key)
Returns: The character as guchar.
  get_uchar_by_name(name)
Gets the unsigned character in container c identified by name n.
  gis_double(key, value)
Get-if-set a double from a container.
  gis_enum(key, value)
Get-if-set an enum from a container.
  gis_int32(key, value)
Get-if-set a 32bit integer from a container.
  gis_int64(key, value)
Get-if-set a 64bit integer from a container.
  gis_object(key, value)
Get-if-set an object from a container.
  gis_uchar(key, value)
Get-if-set an unsigned char from a container.
  keys()
Gets all quark keys of a container.
  keys_by_name()
Gets all string keys of a container.
  remove(key)
Removes a value identified by key from a container.
  remove_by_name(name)
Removes a value identified by name n from container c.
  remove_by_prefix(prefix)
Removes a values whose key start with prefix from container container.
  rename(key, newkey, force)
Makes a value in container identified by key to be identified by newkey.
  rename_by_name(name, new_name, delete)
Makes a value in container c identified by name n to be identified by new name nn.
  set_boolean(key, value)
Stores a boolean into container, identified by key.
  set_boolean_by_name(name, value)
Stores a boolean into container c, identified by name n.
  set_double(key, value)
Stores a double into container, identified by key.
  set_double_by_name(name, value)
Stores a double into container c, identified by name n.
  set_enum(key, value)
Stores an enum into container, identified by key.
  set_enum_by_name(name, value)
Stores an enum into container c, identified by name n.
  set_int32(key, value)
Stores a 32bit integer into container, identified by key.
  set_int32_by_name(name, value)
Stores a 32bit integer into container c, identified by name n.
  set_int64(key, value)
Stores a 64bit integer into container, identified by key.
  set_int64_by_name(name, value)
Stores a 64bit integer into container c, identified by name n.
  set_object(key, value)
Stores an object into container, identified by key.
  set_object_by_name(name, value)
Stores an object into container c, identified by name n.
  set_string(key, value)
Set string for key to given value
  set_string_by_name(name, value)
Stores a string into container c, identified by name n.
  set_uchar(key, value)
Stores an unsigned character into container, identified by key.
  set_uchar_by_name(name, value)
Stores an unsigned character into container c, identified by name n.
  transfer(dest, source_prefix, dest_prefix, force)
Copies a items from one place in container to another place.
  UNIMPLEMENTED_foreach(prefix, function, user_data)
Calls function on each container item whose identifier starts with prefix.
  UNIMPLEMENTED_get_value(key)
Returns: The value as a GValue.
  UNIMPLEMENTED_get_value_by_name(name)
Gets the value in container c identified by name n.
  UNIMPLEMENTED_gis_boolean(key, value)
Get-if-set a boolean from a container.
  UNIMPLEMENTED_gis_string(key, value)
Get-if-set a string from a container.
  UNIMPLEMENTED_gis_value(key, value)
Get-if-set a generic value from a container.
  UNIMPLEMENTED_serialize_to_text()
Creates a text representation of container contents.
  value_type(key)
Returns: The value type as GType; 0 if there is no such value.

Method Details

__init__()
(Constructor)

Creates a new Container.
Returns:
The container, as a GObject.

contains(key)

Returns: Whether container contains something identified by key.
Parameters:
key - A GQuark key. (int)
Returns:
Whether container contains something identified by key.

contains_by_name(name)

Expands to True if container c contains a value identified by name n.

get_boolean(key)

Returns: The boolean as gboolean.
Parameters:
key - A GQuark key. (int)
Returns:
The boolean as gboolean.

get_boolean_by_name(name)

Gets the boolean in container c identified by name n.

get_double(key)

Returns: The double as gdouble.
Parameters:
key - A GQuark key. (int)
Returns:
The double as gdouble.

get_double_by_name(name)

Gets the double in container c identified by name n.

get_enum(key)

Returns: The enum as gint.
Parameters:
key - A GQuark key. (int)
Returns:
The enum as gint.

get_enum_by_name(name)

Gets the enum in container c identified by name n.

Note enums are treated as 32bit integers.

get_int32(key)

Returns: The integer as guint32.
Parameters:
key - A GQuark key. (int)
Returns:
The integer as guint32.

get_int32_by_name(name)

Gets the 32bit integer in container c identified by name n.

get_int64(key)

Returns: The 64bit integer as guint64.
Parameters:
key - A GQuark key. (int)
Returns:
The 64bit integer as guint64.

get_int64_by_name(name)

Gets the 64bit integer in container c identified by name n.

get_n_items()

Gets the number of items in a container.
Returns:
The number of items.

get_object(key)

Get object of given key from container.
Returns:
object of given key

get_object_by_name(name)

Gets the object in container c identified by name n.

The returned object doesn't have its reference count increased, use g_object_ref() if you want to access it even when container may cease to exist.

get_string(key)

Returns: The string.
Parameters:
key - A GQuark key. (int)
Returns:
The string.

get_string_by_name(name)

Gets the string in container c identified by name n.

The returned string must be treated as constant and never freed or modified.

get_uchar(key)

Returns: The character as guchar.
Parameters:
key - A GQuark key. (int)
Returns:
The character as guchar.

get_uchar_by_name(name)

Gets the unsigned character in container c identified by name n.

gis_double(key, value)

Get-if-set a double from a container.
Parameters:
key - A GQuark key. (int)
value - Pointer to the double to update. (float)
Returns:
True if v was actually updated, False when there is no such double in the container.

gis_enum(key, value)

Get-if-set an enum from a container.

Note enums are treated as 32bit integers.
Parameters:
key - A GQuark key. (int)
value - Pointer to the enum to update. (int)
Returns:
True if v was actually updated, False when there is no such enum in the container.

gis_int32(key, value)

Get-if-set a 32bit integer from a container.
Parameters:
key - A GQuark key. (int)
value - Pointer to the 32bit integer to update. (int)
Returns:
True if v was actually updated, False when there is no such 32bit integer in the container.

gis_int64(key, value)

Get-if-set a 64bit integer from a container.
Parameters:
key - A GQuark key. (int)
value - Pointer to the 64bit integer to update. (int)
Returns:
True if v was actually updated, False when there is no such 64bit integer in the container.

gis_object(key, value)

Get-if-set an object from a container.

The object eventually stored in value doesn't have its reference count increased, use g_object_ref() if you want to access it even when container may cease to exist.
Parameters:
key - A GQuark key. (int)
value - Pointer to the object pointer to update. (gpointer)
Returns:
True if v was actually updated, False when there is no such object in the container.

gis_uchar(key, value)

Get-if-set an unsigned char from a container.
Parameters:
key - A GQuark key. (int)
value - Pointer to the unsigned char to update. (guchar*)
Returns:
True if v was actually updated, False when there is no such unsigned char in the container.

keys()

Gets all quark keys of a container.
Returns:

A newly allocated array with quark keys of all container items, in no particular order. The number of items can be obtained with Container.get_n_items(). If there are no items, NULL is returned.

Since: 2.7

keys_by_name()

Gets all string keys of a container.
Returns:

A newly allocated array with string keys of all container items, in no particular order. The number of items can be obtained with Container.get_n_items(). If there are no items, NULL is returned. Unlike the array the strings are owned by GLib and must not be freed.

Since: 2.7

remove(key)

Removes a value identified by key from a container.
Parameters:
key - A GQuark key. (int)
Returns:
True if there was such a value and was removed.

remove_by_name(name)

Removes a value identified by name n from container c.

Expands to True if there was such a value and was removed.

remove_by_prefix(prefix)

Removes a values whose key start with prefix from container container.

prefix can be NULL, all values are then removed.
Parameters:
prefix - A nul-terminated id prefix. (string)
Returns:
The number of values removed.

rename(key, newkey, force)

Makes a value in container identified by key to be identified by newkey.

When force is True existing value at newkey is removed from container. When it's False, an existing value newkey inhibits the rename and False is returned.
Parameters:
key - The current key. (int)
newkey - A new key for the value. (int)
force - Whether to replace existing value at newkey. (bool)
Returns:
Whether the rename succeeded.

rename_by_name(name, new_name, delete)

Makes a value in container c identified by name n to be identified by new name nn.

See Container.rename() for details.

set_boolean(key, value)

Stores a boolean into container, identified by key.
Parameters:
key - A GQuark key. (int)
value - A boolean. (bool)

set_boolean_by_name(name, value)

Stores a boolean into container c, identified by name n.

set_double(key, value)

Stores a double into container, identified by key.
Parameters:
key - A GQuark key. (int)
value - A double. (float)

set_double_by_name(name, value)

Stores a double into container c, identified by name n.

set_enum(key, value)

Stores an enum into container, identified by key.

Note enums are treated as 32bit integers.
Parameters:
key - A GQuark key. (int)
value - An enum integer. (int)

set_enum_by_name(name, value)

Stores an enum into container c, identified by name n.

Note enums are treated as 32bit integers.

set_int32(key, value)

Stores a 32bit integer into container, identified by key.
Parameters:
key - A GQuark key. (int)
value - A 32bit integer. (int)

set_int32_by_name(name, value)

Stores a 32bit integer into container c, identified by name n.

set_int64(key, value)

Stores a 64bit integer into container, identified by key.
Parameters:
key - A GQuark key. (int)
value - A 64bit integer. (gint64)

set_int64_by_name(name, value)

Stores a 64bit integer into container c, identified by name n.

set_object(key, value)

Stores an object into container, identified by key.

The container claims ownership on the object, i.e. its reference count is incremented.

The object must implement Serializable interface to allow serialization of the container.
Parameters:
key - A GQuark key. (int)
value - An object to store into container. (gpointer)

set_object_by_name(name, value)

Stores an object into container c, identified by name n.

See Container.set_object() for details.

set_string(key, value)

Set string for key to given value
Parameters:
value - new string (some_type)

set_string_by_name(name, value)

Stores a string into container c, identified by name n.

The container takes ownership of the string, so it can't be used on static strings, use g_strdup() to duplicate them first.

set_uchar(key, value)

Stores an unsigned character into container, identified by key.
Parameters:
key - A GQuark key. (int)
value - An unsigned character. (guchar)

set_uchar_by_name(name, value)

Stores an unsigned character into container c, identified by name n.

transfer(dest, source_prefix, dest_prefix, force)

Copies a items from one place in container to another place.

The copies are shallow, objects are not physically duplicated, only referenced in dest.
Parameters:
dest - Destination container. It may be the same container as source, but source_prefix and dest_prefix may not overlap then. (Container)
source_prefix - Prefix in source to take values from. (string)
dest_prefix - Prefix in dest to put values to. (string)
force - True to replace existing values in dest. (bool)
Returns:
The number of actually transferred items.

UNIMPLEMENTED_foreach(prefix, function, user_data)

Calls function on each container item whose identifier starts with prefix.

The function is called function(GQuark key, GValue *value, user_data).
Parameters:
prefix - A nul-terminated id prefix. (string)
function - The function called on the items. (GHFunc)
user_data - The user data passed to function. (gpointer)
Returns:
The number of items function was called on.

UNIMPLEMENTED_get_value(key)

Returns: The value as a GValue.
Parameters:
key - A GQuark key. (int)
Returns:
The value as a GValue.

UNIMPLEMENTED_get_value_by_name(name)

Gets the value in container c identified by name n.

UNIMPLEMENTED_gis_boolean(key, value)

Get-if-set a boolean from a container.
Parameters:
key - A GQuark key. (int)
value - Pointer to the boolean to update. (gboolean*)
Returns:
True if v was actually updated, False when there is no such boolean in the container.

UNIMPLEMENTED_gis_string(key, value)

Get-if-set a string from a container.

The string eventually stored in value must be treated as constant and never freed or modified.
Parameters:
key - A GQuark key. (int)
value - Pointer to the string pointer to update. (const-guchar**)
Returns:
True if v was actually updated, False when there is no such string in the container.

UNIMPLEMENTED_gis_value(key, value)

Get-if-set a generic value from a container.
Parameters:
key - A GQuark key. (int)
value - Pointer to a GValue to update. If item does not exist, it is left untouched. (GValue*)
Returns:
True if v was actually updated, False when there is no such value in the container.

UNIMPLEMENTED_serialize_to_text()

Creates a text representation of container contents.

Note only simple data types are supported as serialization of compound objects is not controllable.
Returns:
A pointer array, each item containing string with one container item representation (name, type, value). The array is sorted by name.

value_type(key)

Returns: The value type as GType; 0 if there is no such value.
Parameters:
key - A GQuark key. (int)
Returns:
The value type as GType; 0 if there is no such value.

Generated by Epydoc 2.1 on Tue Dec 30 04:01:41 2008 http://epydoc.sf.net