#include <value.h>
Public Member Functions | |
Value (GConfValue *castitem, bool make_a_copy=false) | |
Value (const Value &src) | |
Value & | operator= (const Value &src) |
~Value () | |
GConfValue * | gobj () |
const GConfValue * | gobj () const |
GConfValue * | gobj_copy () const |
Value (ValueType type=VALUE_INVALID) | |
Create a Value. | |
void | set (gint val) |
Set the integer value of a Value whose type is VALUE_INT. | |
void | set (gdouble val) |
Set the float value of a Value whose type is VALUE_FLOAT. | |
void | set (bool val) |
Set the boolean value of a Value whose type is VALUE_BOOL. | |
void | set (const Schema &sc) |
Set the Schema of a Value whose type is VALUE_SCHEMA. | |
void | set_car (const Value &car) |
Set the car (in a pair, the first element) of a Value whose type is VALUE_PAIR. | |
void | set_cdr (const Value &cdr) |
Set the cdr (in a pair, the second element) of a Value whose type is VALUE_PAIR. | |
void | set (const Glib::ustring &val) |
Set the string of a Value whose type is VALUE_STRING. | |
void | set_list_type (ValueType type) |
Sets the type of the elements of a Value with type VALUE_LIST. | |
void | set_int_list (const SListHandle_ValueInt &list) |
Sets the Value to contain a list of integers. | |
void | set_bool_list (const SListHandle_ValueBool &list) |
Sets the Value to contain a list of bools. | |
void | set_float_list (const SListHandle_ValueFloat &list) |
Sets the Value to contain a list of doubles. | |
void | set_string_list (const SListHandle_ValueString &list) |
Sets the Value to contain a list of strings. | |
void | set_schema_list (const SListHandle_ValueSchema &list) |
Sets the Value to contain a list of Schema. | |
ValueType | get_type () const |
Get the type of the Value. | |
ValueType | get_list_type () const |
Get the type of the list elements of the Value. | |
int | get_int () const |
Get the integer that the Value contains. | |
bool | get_bool () const |
Get the boolean that the Value contains. | |
double | get_float () const |
Get the double that the Value contains. | |
Glib::ustring | get_string () const |
Get the string that the Value contains. | |
Schema | get_schema () const |
Get a copy of the Schema of the value.. | |
Value | get_car () const |
Get a copy of the car of a VALUE_PAIR Value. | |
Value | get_cdr () const |
Get a copy of the cdr of a VALUE_PAIR Value. | |
SListHandle_ValueFloat | get_float_list () const |
Gets a list of doubles from the Value. | |
SListHandle_ValueInt | get_int_list () const |
Retrieves the list of integers from the Value. | |
SListHandle_ValueBool | get_bool_list () const |
Retrieves the list of booleans from the Value. | |
SListHandle_ValueString | get_string_list () const |
Retrieves the list of strings from the Value. | |
SListHandle_ValueSchema | get_schema_list () const |
Retrieves the list of Schemas from the Value. | |
Glib::ustring | to_string () const |
Convert the Value to a string. | |
Protected Attributes | |
GConfValue * | gobject_ |
Related Functions | |
(Note that these are not member functions.) | |
Gnome::Conf::Value | wrap (GConfValue *object, bool take_copy=false) |
This class wraps the primitive types that are passed to and from instances of Gnome::Conf::Client. It has an associated ValueType
, which is specified at creation time, but can be changed with assignment. If the type is VALUE_INVALID
then the effect of the set and get methods is undefined. Using a default-constructed Value without using any of the set methods produces undefined behaviour.
Compound Values of type VALUE_PAIR and VALUE_LIST can only have elements whose types are neither VALUE_PAIR or VALUE_LIST - they can only have primitive types.
The Value class has copy-by-value semantics - all arguments to the set methods are copied.
Note that while the type is named VALUE_FLOAT, the accessors for floating-point values use double
, not float
, to preserve accuracy.
|
|
|
|
|
|
|
Create a Value. You should call a set() method before using the Value.
|
|
Get the boolean that the Value contains.
|
|
Retrieves the list of booleans from the Value.
|
|
Get a copy of the car of a VALUE_PAIR Value.
|
|
Get a copy of the cdr of a VALUE_PAIR Value.
|
|
Get the double that the Value contains.
|
|
Gets a list of doubles from the Value. Typical usage is std::vector<double> foo = value.get_float_list();
|
|
Get the integer that the Value contains.
|
|
Retrieves the list of integers from the Value.
|
|
Get the type of the list elements of the Value. Do not call this method on non-list Values.
|
|
Get a copy of the Schema of the value..
|
|
Retrieves the list of Schemas from the Value. get_float_list |
|
Get the string that the Value contains.
|
|
Retrieves the list of strings from the Value.
|
|
Get the type of the Value.
|
|
|
|
|
|
|
|
|
|
Set the string of a Value whose type is VALUE_STRING.
|
|
Set the Schema of a Value whose type is VALUE_SCHEMA.
|
|
Set the boolean value of a Value whose type is VALUE_BOOL.
|
|
Set the float value of a Value whose type is VALUE_FLOAT.
|
|
Set the integer value of a Value whose type is VALUE_INT.
|
|
Sets the Value to contain a list of bools.
|
|
Set the car (in a pair, the first element) of a Value whose type is VALUE_PAIR.
|
|
Set the cdr (in a pair, the second element) of a Value whose type is VALUE_PAIR.
|
|
Sets the Value to contain a list of doubles.
|
|
Sets the Value to contain a list of integers. set_list_type(VALUE_INT) must have been called prior this call.
|
|
Sets the type of the elements of a Value with type VALUE_LIST.
|
|
Sets the Value to contain a list of Schema.
|
|
Sets the Value to contain a list of strings.
|
|
Convert the Value to a string. The string is not machine-parseable. Do not depend on the format of the string. |
|
|
|
|