Commit 9eccf539 authored by Mark Lindner's avatar Mark Lindner

Misc. code cleanup

parent cc8b0d50
----- version 1.4.10 ------
----- version 1.5 ------
2014-05-25 Mark Lindner <markl@neuromancer>
* lib/libconfig.c++, lib/libconfig.h++ - added patches from Matt
Renaud (added iterators, removed throws() specifications); added
Setting.lookup(); code cleanup; added patch from Yuri Dyachenko
(made exception constructors public)
* lib/libconfig.c, lib/libconfig.h - renamed
config_setting_lookup_from() to config_setting_lookup() and
documented it; patch from Alexander Klauer (floating point precision
loss)
* doc/libconfig.texi - documented new APIs, bumped version
* lib/scanner.c, lib/scanner.h, lib/scanner.l, libconfig.c -
scanner code cleanup; and regenerated with flex 2.5.39
2014-01-21 Mark Lindner <markl@neuromancer> 2014-01-21 Mark Lindner <markl@neuromancer>
......
This diff is collapsed.
This diff is collapsed.
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_INIT(libconfig, 1.4.10, hyperrealm@gmail.com, libconfig, AC_INIT(libconfig, 1.5, hyperrealm@gmail.com, libconfig,
[http://www.hyperrealm.com/main.php?s=libconfig]) [http://www.hyperrealm.com/main.php?s=libconfig])
AC_CONFIG_AUX_DIR([aux-build]) AC_CONFIG_AUX_DIR([aux-build])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
......
This diff is collapsed.
...@@ -1791,6 +1791,17 @@ These methods test if the setting has a child setting with the given ...@@ -1791,6 +1791,17 @@ These methods test if the setting has a child setting with the given
@end deftypemethod @end deftypemethod
@deftypemethod Setting iterator begin ()
@deftypemethodx Setting iterator end ()
@deftypemethodx Setting const_iterator begin ()
@deftypemethodx Setting const_iterator end ()
These methods return STL-style iterators that can be used to enumerate
the child settings of a given setting. If the setting is not an array, list,
or group, they throw a @code{SettingTypeException}.
@end deftypemethod
@deftypemethod Setting int getLength () @deftypemethod Setting int getLength ()
This method returns the number of settings in a group, or the number of This method returns the number of settings in a group, or the number of
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1187,12 +1187,12 @@ Setting::const_iterator Setting::end() const ...@@ -1187,12 +1187,12 @@ Setting::const_iterator Setting::end() const
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
SettingIterator::SettingIterator(Setting& setting, bool endIterator) SettingIterator::SettingIterator(Setting& setting, bool endIterator)
: _setting(&setting), _count(setting.getLength()) : _setting(&setting),
_count(setting.getLength()),
_idx(endIterator ? _count : 0)
{ {
if (endIterator) if(!setting.isAggregate())
_idx = _count; throw SettingTypeException(setting);
else
_idx = 0;
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
...@@ -1313,9 +1313,11 @@ int SettingIterator::operator-(SettingIterator const &other) const ...@@ -1313,9 +1313,11 @@ int SettingIterator::operator-(SettingIterator const &other) const
SettingConstIterator::SettingConstIterator(const Setting &setting, SettingConstIterator::SettingConstIterator(const Setting &setting,
bool endIterator) bool endIterator)
: _setting(&setting), : _setting(&setting),
_count(setting.getLength()) _count(setting.getLength()),
_idx(endIterator ? _count : 0)
{ {
_idx = endIterator ? _count : 0; if(!setting.isAggregate())
throw SettingTypeException(setting);
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
...@@ -1426,7 +1428,7 @@ SettingConstIterator& SettingConstIterator::operator-=(int offset) ...@@ -1426,7 +1428,7 @@ SettingConstIterator& SettingConstIterator::operator-=(int offset)
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
int SettingConstIterator::operator -(SettingConstIterator const &other) const int SettingConstIterator::operator-(SettingConstIterator const &other) const
{ {
return(_idx - other._idx); return(_idx - other._idx);
} }
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment