/usr/include/gconfmm-2.6/gconfmm/value.h is in libgconfmm-2.6-dev 2.28.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | // -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GCONFMM_VALUE_H
#define _GCONFMM_VALUE_H
#include <glibmm.h>
// -*- Mode: C++; c-basic-offset: 4 -*-
/* $Id: value.hg,v 1.3 2004/12/12 22:04:01 murrayc Exp $ */
/* value.hg
*
* Copyright (C) 2000-2002 GConfmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <glibmm/ustring.h>
#include <gconfmm/value_listhelpers.h>
namespace Gnome
{
namespace Conf
{
/** @addtogroup gconfmmEnums Enums and Flags */
/**
* @ingroup gconfmmEnums
*/
enum ValueType
{
VALUE_INVALID,
VALUE_STRING,
VALUE_INT,
VALUE_FLOAT,
VALUE_BOOL,
VALUE_SCHEMA,
VALUE_LIST,
VALUE_PAIR
};
} // namespace Conf
} // namespace Gnome
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Gnome::Conf::ValueType> : public Glib::Value_Enum<Gnome::Conf::ValueType>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gnome
{
namespace Conf
{
/**
* @ingroup gconfmmEnums
*/
enum UnsetFlags
{
UNSET_INCLUDING_SCHEMA_NAMES
};
} // namespace Conf
} // namespace Gnome
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Gnome::Conf::UnsetFlags> : public Glib::Value_Enum<Gnome::Conf::UnsetFlags>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gnome
{
namespace Conf
{
typedef std::pair<Value, Value> ValuePair;
typedef std::pair<ValueType, ValueType> ValueTypePair;
/** Wrapper for primitive types.
* This class wraps the primitive types that are passed to
* and from instances of Gnome::Conf::Client. It has an associated
* @c ValueType, which is specified at creation time,
* but can be changed with assignment. If the type is @c 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 @c double, not @c float, to preserve
* accuracy.
*/
class Value
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef Value CppObjectType;
typedef GConfValue BaseObjectType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
// Use make_a_copy=true when getting it directly from a struct.
explicit Value(GConfValue* castitem, bool make_a_copy = false);
Value(const Value& src);
Value& operator=(const Value& src);
~Value();
GConfValue* gobj() { return gobject_; }
const GConfValue* gobj() const { return gobject_; }
///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
GConfValue* gobj_copy() const;
protected:
GConfValue* gobject_;
private:
public:
/** Create a Value.
* You should call a set() method before using the Value.
* @param type: The type of the produced value.
*/
Value(ValueType type = VALUE_INVALID);
/** Set the integer value of a Value whose type is VALUE_INT
*/
void set(gint val);
/** Set the float value of a Value whose type is VALUE_FLOAT
* @param val: the @c double this Value will be se to.
*/
void set(gdouble val);
/** Set the boolean value of a Value whose type is VALUE_BOOL */
void set(bool val);
/** Set the Schema of a Value whose type is VALUE_SCHEMA */
void set(const Schema& sc);
/** Set the car (in a pair, the first element) of a Value whose type is VALUE_PAIR */
void set_car(const Value& car);
/** Set the cdr (in a pair, the second element) of a Value whose type is VALUE_PAIR */
void set_cdr(const Value& cdr);
/** Set the string of a Value whose type is VALUE_STRING */
void set(const Glib::ustring& val);
/** Sets the type of the elements of a Value with type VALUE_LIST */
void set_list_type(ValueType type);
/** Sets the Value to contain a list of integers.
* set_list_type(VALUE_INT) must have been called prior this call.
* @param list: an STL-compatible container whose value_type is @c int
*/
void set_int_list(const SListHandle_ValueInt& list);
/** Sets the Value to contain a list of bools.
* @see set_int_list */
void set_bool_list(const SListHandle_ValueBool& list);
/** Sets the Value to contain a list of doubles.
* @see set_int_list */
void set_float_list(const SListHandle_ValueFloat& list);
/** Sets the Value to contain a list of strings.
* @see set_int_list */
void set_string_list(const SListHandle_ValueString& list);
/** Sets the Value to contain a list of Schema.
* @see set_int_list */
void set_schema_list(const SListHandle_ValueSchema& list);
/** Get the type of the Value.
* @return the type of the Value
*/
ValueType get_type() const;
/** Get the type of the list elements of the Value.
* Do not call this method on non-list Values.
* @return the type of the list elements.
*/
ValueType get_list_type() const;
/** Get the integer that the Value contains */
int get_int() const;
/** Get the boolean that the Value contains */
bool get_bool() const;
/** Get the double that the Value contains */
double get_float() const;
/** Get the string that the Value contains */
Glib::ustring get_string() const;
/** Get a copy of the Schema of the value.. */
Schema get_schema() const;
/** Get a copy of the car of a VALUE_PAIR Value */
Value get_car() const;
/** Get a copy of the cdr of a VALUE_PAIR Value */
Value get_cdr() const;
/** Gets a list of doubles from the Value.
* Typical usage is
* @code
* std::vector<double> foo = value.get_float_list();
* @endcode.
* @return: an STL-compatible container with doubles as its value type.
* Assign to an std::vector, list or deque for proper use.
*/
SListHandle_ValueFloat get_float_list() const;
/** Retrieves the list of integers from the Value.
* @see get_float_list
*/
SListHandle_ValueInt get_int_list() const;
/** Retrieves the list of booleans from the Value.
* @see get_float_list
*/
SListHandle_ValueBool get_bool_list() const;
/** Retrieves the list of strings from the Value.
* @see get_float_list
*/
SListHandle_ValueString get_string_list() const;
/** Retrieves the list of Schemas from the Value.
* @See get_float_list
*/
SListHandle_ValueSchema get_schema_list() const;
/** Convert the Value to a string.
* The string is not machine-parseable. Do not depend on the
* format of the string.
*/
Glib::ustring to_string() const;
};
} /* namespace Conf */
} /* namespace Gnome */
namespace Glib
{
/** A Glib::wrap() method for this object.
*
* @param object The C instance.
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
* @result A C++ instance that wraps this C instance.
*
* @relates Gnome::Conf::Value
*/
Gnome::Conf::Value wrap(GConfValue* object, bool take_copy = false);
} // namespace Glib
#endif /* _GCONFMM_VALUE_H */
|