Projects / libconfigduo / Comments

Comments for libconfigduo

15 Aug 2011 03:14 mesmerism

Nomasvisto, why do you need "hacks" to access string values? Just assign the Setting object to a std::string or const char *.

14 Aug 2011 22:15 Nomasvisto

It would be very helpful to use a libconfig in c++ that it wouldn't be a c++ wrapper from the c library, I'm sure you will increase people who help you easily and you will gain more people in the proyect.

I made a lot of times use of hacks to access to strings in complex configs (NameSettingWhatever->value.sval, something like that), with complexity superior of 3 (list of lists of arrays, for example)

Even with their bad points, I reccomend it!

12 Aug 2011 08:59 mesmerism

If you use libconfig, please help pay for the web hosting...make a small donation at www.hyperrealm.com

28 Jul 2011 20:33 rainwoodman

Am I supposed to file bug tickets on freshmeat? How otherwise can I contact the author?

25 Jun 2011 01:55 npotereyko

Awesome project! I am a big fan.

Do you think it would be possible to make any (or perhaps all) of the following enhancements?

1. allow complex group member names? For instance: { "some key" : "some value"; } in addition to existing {someKey: "some value"; }.

2. allow to separate members of the group by "," in addition to ";". For example { a : 10, b : 20, }

2.1 allow to leave out last ";" in group definition. For example { a = 10, b = 20 }

3. Use "[]" in addition to "()" to denote arrays. For example ( 10, 20, 30 )

None of the above enhancements should interfere with existing protocol, and will make this library JSON compatible for the most parts which will open whole new world of possibilities.

22 Jun 2011 07:52 crookies

Hello Mark,

I am using your library and I wanted to suggests an interesting option. If a setting is present multiple times in the configuration, then an error is generated (duplicate setting), why not give the option to update the setting by the new value. This is very interresting when you work with include files because you can create a default configuration and overload some values by including a custom file at the end.

The behaviour ("no duplicate" or "allow override" could be selected by a specific setting).
I made the change in quick and dirty in config_setting_add for testing and it seems to work nicely
if(config_setting_get_member(parent, name) != NULL)
return(config_setting_get_member(parent, name)); /* already exists */


Best regards,

Pierre Crokaert

13 Jun 2011 20:15 kf6uzf

It would be really nice if the library was able to write to std::ostream and read from std::istream sources.
Keep up the good work.

08 Jun 2011 11:16 andreh5

First of all, thanks for making such a useful library available !

I noticed a minor 'feature' when trying to get the value of an optional configuration item.
For example the following:

double value = 1;
config.getRoot()["X"]["Y"]["Z"].lookupValue("optionalValue", value);

works as expected if the configuration file contains:

optionalValue = 2.0;

but does not modify the variable value if the configuration file contains:

optionalValue = 2;

(i.e. the value is recognized as int but not as double).

24 May 2011 20:41 jmarchetti

I compiled your excellent library with gcc -Wall -Wextra options.
It found several warnings, most worth looking, for instance:
libconfig/libconfigcpp.c++:52: warning: base class `class libconfig::ConfigException' should be explicitly initialized in the copy constructor
Or the copy constructor is not initializing the base class ConfigException.
Where I added:
ParseException::ParseException(const ParseException &other)
: ConfigException(other),
_file(other._file ? ::strdup(other._file) : NULL),
_line(other._line),
_error(other._error)
{
}

Also I run dmalloc and it complained of some free(NULL) from your library (this is a runtime tool so it actually happened), example:
in **scanctx_cleanup there was:
free((void *)(strbuf_release(&(ctx->string))));
Now I have:
strbuf_release(&(ctx->string));

Those above are only examples, there are +-15 of those corrections.
I would be happy to pass a report to you, I do not want to pass these changes to every new version I get from you.
I also think you are going to benefit from the changes.

Thanks!

06 May 2011 22:53 lavermil

The spec file is missing the inclusion of /usr/bin/libconfig_tests. This file needs to be added to the %files and everything will then work fine.
Current rpmbuild error :
RPM build errors:
Installed (but unpackaged) file(s) found: /usr/bin/libconfig_tests

Screenshot

Project Spotlight

ReciJournal

An open, cross-platform journaling program.

Screenshot

Project Spotlight

Veusz

A scientific plotting package.