Gnome2::GConf::Value(3pm)

Gnome2::GConf::Value3pm

Opaque datatype for generic values

Usage

  $client = Gnome2::GConf::Client->get_default;
  $client->set($config_key,
      {
        type  => 'string',
        value => 'Hello, World',
      });
  print "The Meaning of Life." if ($client->get($another_key)->{value} == 42);

Overview

"GConfValue" is a dynamic type similar to "GValue", and represents a value that can be obtained from or stored in the configuration database; it contains the value bound to a key, and its type.

In perl, it's an hashref containing these keys:

type

The type of the data. Fundamental types are 'string', 'int', 'float' and 'bool'. Lists are handled by passing an arrayref as the payload of the "value" key:

        $client->set($key, { type => 'string', value => 'some string' });
        $client->set($key, { type => 'float',  value => 0.5           });
        $client->set($key, { type => 'bool',   value => FALSE         });
        $client->set($key, { type => 'int',    value => [0..15]       });

Pairs are handled by using the special type 'pair', and passing, in place of the "value" key, the "car" and the "cdr" keys, each containing an hashref representing a GConfValue:

        $client->set($key, {
                        type => 'pair',
                        car  => { type => 'string', value => 'some string' },
                        cdr  => { type => 'int',    value => 42            },
                });

This is needed since pairs might have different types; lists, instead, are of the same type.

value

The payload, containing the value of type "type". It is used only for fundamental types (scalars or lists).

car, cdr

Special keys, that must be used only when working with the 'pair' type.

Methods

integer = $value_a->compare ($value_b)

•

$value_b (value)

Since: gconf 2.13

string = $value->to_string

Releases

7 releases since Debian 3.1 (Sarge); the text changed 6 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 8
  7. 9

From libgnome2-gconf-perl 1.044-6+b1 in Debian 9 (Stretch). Parsed by carta from the page's man source.