1Gnome2::GConf::Value(3)User Contributed Perl DocumentatioGnnome2::GConf::Value(3)
2
3
4
6 Gnome2::GConf::Value - Opaque datatype for generic values
7
9 $client = Gnome2::GConf::Client->get_default;
10 $client->set($config_key,
11 {
12 type => 'string',
13 value => 'Hello, World',
14 });
15 print "The Meaning of Life." if ($client->get($another_key)->{value} == 42);
16
18 "GConfValue" is a dynamic type similar to "GValue", and represents a
19 value that can be obtained from or stored in the configuration
20 database; it contains the value bound to a key, and its type.
21
22 In perl, it's an hashref containing these keys:
23
24 type
25 The type of the data. Fundamental types are 'string', 'int',
26 'float' and 'bool'. Lists are handled by passing an arrayref as
27 the payload of the "value" key:
28
29 $client->set($key, { type => 'string', value => 'some string' });
30 $client->set($key, { type => 'float', value => 0.5 });
31 $client->set($key, { type => 'bool', value => FALSE });
32 $client->set($key, { type => 'int', value => [0..15] });
33
34 Pairs are handled by using the special type 'pair', and passing, in
35 place of the "value" key, the "car" and the "cdr" keys, each
36 containing an hashref representing a GConfValue:
37
38 $client->set($key, {
39 type => 'pair',
40 car => { type => 'string', value => 'some string' },
41 cdr => { type => 'int', value => 42 },
42 });
43
44 This is needed since pairs might have different types; lists,
45 instead, are of the same type.
46
47 value
48 The payload, containing the value of type "type". It is used only
49 for fundamental types (scalars or lists).
50
51 car, cdr
52 Special keys, that must be used only when working with the 'pair'
53 type.
54
56 Gnome2::GConf(3pm), Gnome2::GConf::Entry(3pm),
57 Gnome2::GConf::Schema(3pm), Gnome2::GConf::ChangeSet(3pm).
58
60 integer = $value_a->compare ($value_b)
61 ยท $value_b (value)
62
63 Since: gconf 2.13
64
65 string = $value->to_string
67 Gnome2::GConf
68
70 Copyright (C) 2003-2006 by the gtk2-perl team.
71
72 This software is licensed under the LGPL. See Gnome2::GConf for a full
73 notice.
74
75
76
77perl v5.28.0 2018-07-14 Gnome2::GConf::Value(3)