Lines Matching full:setting

351 @cindex setting
417 at a top-level group and ending at the setting itself. Each name in
418 the path is the name of a setting; if the setting has no name because
423 @code{x} setting is @code{application.window.pos.x}; the path to the
424 @code{version} setting is simply @code{version}; and the path to the
425 @code{title} setting of the second book in the @code{books} list is
457 A setting has the form:
479 Groups can contain any number of settings, but each setting must have
531 The @i{integer} and @i{64-bit integer} setting types are interchangeable to the
534 written to a setting that has an @i{integer} type, if that value is within the
536 reads a value from or writes a value to a setting: if the type conversion would
701 a configuration setting.
725 root setting are recursively destroyed. All other attributes of the configuration
909 floating point setting's value into an integer (or vice versa), or
910 store an integer to a floating point setting's value (or vice versa)
916 This option controls whether a semicolon (`;') is output after each setting
923 group setting's name and its value when the configuration is written to
930 non-group setting's name and its value when the configuration is written
992 @var{config}. If a non-default format has not been set for a setting
994 default format will be used instead when that setting is written to a
1019 These functions look up the value of the setting in the configuration
1021 the setting at @var{value} and return @code{CONFIG_TRUE} on
1022 success. If the setting was not found or if the type of the value did
1027 managed by the library and released automatically when the setting is
1028 destroyed or when the setting's value is changed; the string must not
1035 This function locates the setting in the configuration @var{config}
1038 setting was not found.
1042 @deftypefun {config_setting_t *} config_setting_lookup (@w{const config_setting_t * @var{setting}},…
1044 This function locates a setting by a path @var{path} relative to
1045 the setting @var{setting}. It returns a pointer to the
1047 setting was not found.
1051 @deftypefun int config_setting_get_int (@w{const config_setting_t * @var{setting}})
1052 @deftypefunx {long long} config_setting_get_int64 (@w{const config_setting_t * @var{setting}})
1053 @deftypefunx double config_setting_get_float (@w{const config_setting_t * @var{setting}})
1054 @deftypefunx int config_setting_get_bool (@w{const config_setting_t * @var{setting}})
1055 @deftypefunx {const char *} config_setting_get_string (@w{const config_setting_t * @var{setting}})
1057 These functions return the value of the given @var{setting}. If the
1058 type of the setting does not match the type requested, a 0 or
1061 released automatically when the setting is destroyed or when the
1062 setting's value is changed; the string must not be freed by the
1066 @deftypefun int config_setting_set_int (@w{config_setting_t * @var{setting}}, @w{int @var{value}})
1067 @deftypefunx int config_setting_set_int64 (@w{config_setting_t * @var{setting}}, @w{long long @var{…
1068 @deftypefunx int config_setting_set_float (@w{config_setting_t * @var{setting}}, @w{double @var{val…
1069 @deftypefunx int config_setting_set_bool (@w{config_setting_t * @var{setting}}, @w{int @var{value}})
1070 @deftypefunx int config_setting_set_string (@w{config_setting_t * @var{setting}}, @w{const char * @…
1072 These functions set the value of the given @var{setting} to
1074 the setting does not match the type of the value, they return
1077 modified by the caller without affecting the value of the setting.
1081 @deftypefun int config_setting_lookup_int (@w{const config_setting_t * @var{setting}}, @w{const cha…
1082 @deftypefunx int config_setting_lookup_int64 (@w{const config_setting_t * @var{setting}}, @w{const …
1083 @deftypefunx int config_setting_lookup_float (@w{const config_setting_t * @var{setting}}, @w{const …
1084 @deftypefunx int config_setting_lookup_bool (@w{const config_setting_t * @var{setting}}, @w{const c…
1085 @deftypefunx int config_setting_lookup_string (@w{const config_setting_t * @var{setting}}, @w{const…
1087 These functions look up the value of the child setting named
1088 @var{name} of the setting @var{setting}. They store the value at
1089 @var{value} and return @code{CONFIG_TRUE} on success. If the setting
1095 managed by the library and released automatically when the setting is
1096 destroyed or when the setting's value is changed; the string must not
1101 @deftypefun short config_setting_get_format (@w{config_setting_t * @var{setting}})
1102 @deftypefunx int config_setting_set_format (@w{config_setting_t * @var{setting}}, @w{short @var{for…
1104 These functions get and set the external format for the setting @var{setting}.
1115 is invalid for the given setting, it is ignored.
1117 If a non-default format has not been set for the setting, @code{config_setting_get_format()} return…
1125 @deftypefun {config_setting_t *} config_setting_get_member (@w{config_setting_t * @var{setting}}, @…
1127 This function fetches the child setting named @var{name} from the group
1128 @var{setting}. It returns the requested setting on success, or
1129 @code{NULL} if the setting was not found or if @var{setting} is not a
1134 @deftypefun {config_setting_t *} config_setting_get_elem (@w{const config_setting_t * @var{setting}…
1137 setting @var{setting}, which must be an array, list, or group. It returns the
1138 requested setting on success, or @code{NULL} if @var{index} is out of
1139 range or if @var{setting} is not an array, list, or group.
1143 @deftypefun int config_setting_get_int_elem (@w{const config_setting_t * @var{setting}}, @w{int @va…
1144 @deftypefunx {long long} config_setting_get_int64_elem (@w{const config_setting_t * @var{setting}},…
1145 @deftypefunx double config_setting_get_float_elem (@w{const config_setting_t * @var{setting}}, @w{i…
1146 @deftypefunx int config_setting_get_bool_elem (@w{const config_setting_t * @var{setting}}, @w{int @…
1147 …char *} config_setting_get_string_elem (@w{const config_setting_t * @var{setting}}, @w{int @var{in…
1150 setting @var{setting}. If the setting is not an array or list, or if
1154 managed by the library and released automatically when the setting is
1159 @deftypefun {config_setting_t *} config_setting_set_int_elem (@w{config_setting_t * @var{setting}},…
1160 @deftypefunx {config_setting_t *} config_setting_set_int64_elem (@w{config_setting_t * @var{setting
1161 @deftypefunx {config_setting_t *} config_setting_set_float_elem (@w{config_setting_t * @var{setting
1162 @deftypefunx {config_setting_t *} config_setting_set_bool_elem (@w{config_setting_t * @var{setting}…
1163 …_setting_t *} config_setting_set_string_elem (@w{config_setting_t * @var{setting}}, @w{int @var{in…
1166 setting @var{setting} to @var{value}. If @var{index} is negative, a
1168 these functions return a pointer to the setting representing the
1169 element. If the setting is not an array or list, or if the setting is
1174 modified by the caller without affecting the value of the setting.
1179 This function adds a new child setting or element to the setting
1184 The function returns the new setting on success, or @code{NULL} if
1186 child setting of @var{parent} named @var{name}; or if @var{type} is
1187 invalid. If @var{type} is a scalar type, the new setting will have a
1193 This function removes and destroys the setting named @var{name} from
1194 the parent setting @var{parent}, which must be a group. Any child
1195 settings of the setting are recursively destroyed as well.
1197 The @var{name} parameter can also specify a setting @i{path} relative to
1199 (In that case, the setting will be looked up and removed.)
1202 not a group, or if it has no setting with the given name, it returns
1209 This function removes the child setting at the given index @var{index} from
1210 the setting @var{parent}, which must be a group, list, or array. Any
1211 child settings of the removed setting are recursively destroyed as
1222 …h is implemented as a macro, returns the root setting for the configuration @var{config}. The root…
1226 @deftypefun {const char *} config_setting_name (@w{const config_setting_t * @var{setting}})
1228 This function returns the name of the given @var{setting}, or
1229 @code{NULL} if the setting has no name. Storage for the returned
1231 setting is destroyed; the string must not be freed by the caller.
1235 @deftypefun {config_setting_t *} config_setting_parent (@w{const config_setting_t * @var{setting}})
1237 This function returns the parent setting of the given @var{setting},
1238 or @code{NULL} if @var{setting} is the root setting.
1242 @deftypefun int config_setting_is_root (@w{const config_setting_t * @var{setting}})
1244 This function returns @code{CONFIG_TRUE} if the given @var{setting} is
1245 the root setting, and @code{CONFIG_FALSE} otherwise.
1249 @deftypefun int config_setting_index (@w{const config_setting_t * @var{setting}})
1251 This function returns the index of the given @var{setting} within its
1252 parent setting. If @var{setting} is the root setting, this function
1257 @deftypefun int config_setting_length (@w{const config_setting_t * @var{setting}})
1265 @deftypefun int config_setting_type (@w{const config_setting_t * @var{setting}})
1267 This function returns the type of the given @var{setting}. The return
1275 @deftypefun int config_setting_is_group (@w{const config_setting_t * @var{setting}})
1276 @deftypefunx int config_setting_is_array (@w{const config_setting_t * @var{setting}})
1277 @deftypefunx int config_setting_is_list (@w{const config_setting_t * @var{setting}})
1280 the setting @var{setting} is of a given type. They return
1285 @deftypefun int config_setting_is_aggregate (@w{const config_setting_t * @var{setting}})
1286 @deftypefunx int config_setting_is_scalar (@w{const config_setting_t * @var{setting}})
1287 @deftypefunx int config_setting_is_number (@w{const config_setting_t * @var{setting}})
1291 the setting @var{setting} is of an aggregate type (a group, array, or
1299 @deftypefun {const char *} config_setting_source_file (@w{const config_setting_t * @var{setting}})
1301 This function returns the name of the file from which the setting
1302 @var{setting} was read, or NULL if the setting was not read from a
1310 @deftypefun {unsigned int} config_setting_source_line (@w{const config_setting_t * @var{setting}})
1313 stream at which the setting @var{setting} was read, or 0 if no line
1331 @deftypefun void config_setting_set_hook (@w{config_setting_t * @var{setting}}, @w{void * @var{hook…
1332 @deftypefunx {void *} config_setting_get_hook (@w{const config_setting_t * @var{setting}})
1336 setting structure, for instance a ``wrapper'' or ``peer'' object written in
1339 by the library to dispose of this data when the setting itself is
1359 @tindex Setting
1361 represents a configuration, and the class @code{Setting} represents a
1362 configuration setting. Note that by design, neither of these classes
1372 A @code{SettingTypeException} is thrown when the type of a setting's
1375 @deftypemethod SettingTypeException {} SettingTypeException (@w{const Setting &@var{setting}})
1376 @deftypemethodx SettingTypeException {} SettingTypeException (@w{const Setting &@var{setting}}, @w{…
1377 @deftypemethodx SettingTypeException {} SettingTypeException (@w{const Setting &@var{setting}}, @w{…
1379 These methods construct @code{SettingTypeException} objects for the given @var{setting} and/or memb…
1384 A @code{SettingNotFoundException} is thrown when a setting is not found.
1386 @deftypemethod SettingNotFoundException {} SettingNotFoundException (@w{const Setting &@var{setting
1387 …dx SettingNotFoundException {} SettingNotFoundException (@w{const Setting &@var{setting}}, @w{cons…
1390 These methods construct @code{SettingTypeException} objects for the given @var{setting} and member …
1396 a new setting with a non-unique or invalid name.
1398 @deftypemethod SettingNameException {} SettingNameException (@w{const Setting &@var{setting}}, @w{c…
1400 This method constructs a @code{SettingNameExcpetion} object for the given @var{setting} and member …
1425 This method returns the path to the setting associated with the exception, or
1445 setting are recursively destroyed. All other attributes of the
1561 floating point setting's value into an integer (or vice versa), or
1562 store an integer to a floating point setting's value (or vice versa)
1568 This option controls whether a semicolon (`;') is output after each setting
1575 group setting's name and its value when the configuration is written to
1582 non-group setting's name and its value when the configuration is written
1638 @deftypemethod Config Setting::Format getDefaultFormat () const
1639 @deftypemethodx Config void setDefaultFormat (@w{Setting::Format @var{format}})
1643 setting with @code{Setting::setFormat()}, this configuration-wide
1644 default format will be used instead when that setting is written to a
1675 @deftypemethod Config {Setting &} getRoot () const
1677 This method returns the root setting for the configuration, which is a group.
1681 @deftypemethod Config {Setting &} lookup (@w{const std::string &@var{path}}) const
1682 @deftypemethodx Config {Setting &} lookup (@w{const char * @var{path}}) const
1684 These methods locate the setting specified by the path @var{path}. If
1685 the requested setting is not found, a @code{SettingNotFoundException} is
1692 These methods test if a setting with the given @var{path} exists in
1693 the configuration. They return @code{true} if the setting exists, and
1722 These are convenience methods for looking up the value of a setting
1723 with the given @var{path}. If the setting is found and is of an
1729 released automatically when the setting is destroyed or when its value
1766 @deftypemethod Setting {} {operator bool ()} const
1767 @deftypemethodx Setting {} {operator int ()} const
1768 @deftypemethodx Setting {} {operator unsigned int ()} const
1769 @deftypemethodx Setting {} {operator long ()} const
1770 @deftypemethodx Setting {} {operator unsigned long ()} const
1771 @deftypemethodx Setting {} {operator long long ()} const
1772 @deftypemethodx Setting {} {operator unsigned long long ()} const
1773 @deftypemethodx Setting {} {operator float ()} const
1774 @deftypemethodx Setting {} {operator double ()} const
1775 @deftypemethodx Setting {} {operator const char * ()} const
1776 @deftypemethodx Setting {} {operator std::string ()} const
1777 @deftypemethodx Setting {const char *} c_str () const
1779 These cast operators allow a @code{Setting} object to be assigned to a
1791 library and released automatically when the setting is destroyed or
1828 invoked with a @code{Setting &} as an argument. The compiler is unable
1830 and the @code{std::string} cast operators of @code{Setting} are
1869 @deftypemethod Setting {Setting &} operator= (@w{bool @var{value}})
1870 @deftypemethodx Setting {Setting &} operator= (@w{int @var{value}})
1871 @deftypemethodx Setting {Setting &} operator= (@w{long @var{value}})
1872 @deftypemethodx Setting {Setting &} operator= (@w{const long long &@var{value}})
1873 @deftypemethodx Setting {Setting &} operator= (@w{float @var{value}})
1874 @deftypemethodx Setting {Setting &} operator= (@w{const double &@var{value}})
1875 @deftypemethodx Setting {Setting &} operator= (@w{const char *@var{value}})
1876 @deftypemethodx Setting {Setting &} operator= (@w{const std::string &@var{value}})
1880 @i{std::string} to be assigned to a setting. In the case of strings,
1883 value of the setting.
1885 The following example code looks up a (presumably) integer setting
1890 Setting &setting = config.lookup("application.window.size.w");
1891 setting = 1024;
1900 @deftypemethod Setting {Setting &} {operator[]} (@w{int @var{index}}) const
1901 @deftypemethodx Setting {Setting &} {operator[]} (@w{const std::string &@var{name}}) const
1902 @deftypemethodx Setting {Setting &} {operator[]} (@w{const char *@var{name}}) const
1904 A @code{Setting} object may be subscripted with an integer index
1912 Setting& setting = config.lookup("application.misc");
1913 const char *s = setting["columns"][0];
1917 If the setting is not an array, list, or group, a
1928 @deftypemethod Setting {Setting &} lookup (@w{const char * @var{path}}) const
1929 @deftypemethodx Setting {Setting &} lookup (@w{const std::string &@var{path}}) const
1931 These methods locate a setting by a path @var{path} relative to
1932 this setting. If requested setting is not found, a
1937 @deftypemethod Setting bool lookupValue (@w{const char *@var{name}}, @w{bool &@var{value}}) const
1938 @deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{bool &@var{value}})…
1940 @deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{int &@var{value}}) const
1941 @deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{int &@var{value}}) …
1943 @deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{unsigned int &@var{value}}…
1944 @deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{unsigned int &@var{…
1946 @deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{long long &@var{value}}) c…
1947 @deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{long long &@var{val…
1949 @deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{unsigned long long &@var{v…
1950 @deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{unsigned long long …
1952 @deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{float &@var{value}}) const
1953 @deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{float &@var{value}}…
1955 @deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{double &@var{value}}) const
1956 @deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{double &@var{value}…
1958 @deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{const char *&@var{value}})…
1959 @deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{const char *&@var{v…
1961 @deftypemethodx Setting bool lookupValue (@w{const char *@var{name}}, @w{std::string &@var{value}})…
1962 @deftypemethodx Setting bool lookupValue (@w{const std::string &@var{name}}, @w{std::string &@var{v…
1964 These are convenience methods for looking up the value of a child setting
1965 with the given @var{name}. If the setting is found and is of an
1971 released automatically when the setting is destroyed or when its value
1989 if(setting.lookupValue("var1", var1)
1990 && setting.lookupValue("var2", var2)
1991 && setting.lookupValue("var3", var3))
2008 @deftypemethod Setting {Setting &} add (@w{const std::string &@var{name}}, @w{Setting::Type @var{ty…
2009 @deftypemethodx Setting {Setting &} add (@w{const char *@var{name}}, @w{Setting::Type @var{type}})
2011 These methods add a new child setting with the given @var{name} and
2012 @var{type} to the setting, which must be a group. They return a
2013 reference to the new setting. If the setting already has a child
2014 setting with the given name, or if the name is invalid, a
2015 @code{SettingNameException} is thrown. If the setting is not a group,
2018 Once a setting has been created, neither its name nor type can be
2023 @deftypemethod Setting {Setting &} add (@w{Setting::Type @var{type}})
2025 This method adds a new element to the setting, which must be of type
2026 @code{TypeArray} or @code{TypeList}. If the setting is an array which
2032 The method returns the new setting on success. If @var{type} is a
2033 scalar type, the new setting will have a default value of 0, 0.0,
2036 The method throws a @code{SettingTypeException} if the setting is not
2041 @deftypemethod Setting void remove (@w{const std::string &@var{name}})
2042 @deftypemethodx Setting void remove (@w{const char *@var{name}})
2044 These methods remove the child setting with the given @var{name} from
2045 the setting, which must be a group. Any child settings of the removed
2046 setting are recursively destroyed as well.
2048 If the setting is not a group, a @code{SettingTypeException} is
2049 thrown. If the setting does not have a child setting with the given
2054 @deftypemethod Setting void remove (@w{unsigned int @var{index}})
2056 This method removes the child setting at the given index @var{index} from
2057 the setting, which must be a group, list, or array. Any child settings
2058 of the removed setting are recursively destroyed as well.
2060 If the setting is not a group, list, or array, a
2066 @deftypemethod Setting {const char *} getName () const
2068 This method returns the name of the setting, or @code{NULL} if the
2069 setting has no name. Storage for the returned string is managed by the
2070 library and released automatically when the setting is destroyed; the
2076 @deftypemethod Setting {std::string} getPath () const
2079 setting. Settings which do not have a name (list and array elements)
2084 @deftypemethod Setting {Setting &} getParent () const
2086 This method returns the parent setting of the setting. If the setting
2087 is the root setting, a @code{SettingNotFoundException} is thrown.
2091 @deftypemethod Setting bool isRoot () const
2093 This method returns @code{true} if the setting is the root setting, and
2098 @deftypemethod Setting int getIndex () const
2100 This method returns the index of the setting within its parent
2101 setting. When applied to the root setting, this method returns -1.
2105 @deftypemethod Setting Setting::Type getType () const
2107 @tindex Setting::Type
2108 This method returns the type of the setting. The
2109 @code{Setting::Type} enumeration consists of the following constants:
2116 @deftypemethod Setting Setting::Format getFormat () const
2117 @deftypemethodx Setting void setFormat (@w{Setting::Format @var{format}})
2119 These methods get and set the external format for the setting.
2121 @tindex Setting::Format
2122 The @var{Setting::Format} enumeration consists of the following
2127 @var{format} is invalid for the given setting, it is ignored.
2131 @deftypemethod Setting bool exists (@w{const std::string &@var{name}}) const
2132 @deftypemethodx Setting bool exists (@w{const char *@var{name}}) const
2134 These methods test if the setting has a child setting with the given
2135 @var{name}. They return @code{true} if the setting exists, and
2140 @deftypemethod Setting iterator begin ()
2141 @deftypemethodx Setting iterator end ()
2142 @deftypemethodx Setting const_iterator begin ()
2143 @deftypemethodx Setting const_iterator end ()
2146 the child settings of a given setting. If the setting is not an array, list,
2151 @deftypemethod Setting int getLength () const
2159 @deftypemethod Setting bool isGroup () const
2160 @deftypemethodx Setting bool isArray () const
2161 @deftypemethodx Setting bool isList () const
2163 These convenience methods test if a setting is of a given type.
2167 @deftypemethod Setting bool isAggregate () const
2168 @deftypemethodx Setting bool isScalar () const
2169 @deftypemethodx Setting bool isNumber () const
2170 @deftypemethodx Setting bool isString () const
2172 These convenience methods test if a setting is of an aggregate type (a
2179 @deftypemethod Setting {const char *} getSourceFile () const
2181 This method returns the name of the file from which the setting was
2182 read, or NULL if the setting was not read from a file. This
2190 @deftypemethod Setting {unsigned int} getSourceLine () const
2193 stream at which the setting @var{setting} was read, or 0 if no line
2358 <setting-list>
2361 <setting-list> ::=
2362 <setting>
2363 | <setting-list> <setting>
2365 <setting> ::=
2400 "@{" ( <setting-list> | <empty> ) "@}"