Re: Proposal: make Glib::KeyFile easier to use

2013-12-26 Thread Aurimas Cernius
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, The current interface of Glib::KeyFile::get_* functions is quite inconvenient as exceptions are the only reliable way to receive error conditions. Consider the following example: Glib::KeyFile f; ... int x = f.get_integer(a, b); // (1)

Re: Proposal: make Glib::KeyFile easier to use

2013-12-26 Thread Aurimas Cernius
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, One external thing to consider here is who edits key files. I don't expect non-pro guy doing anything there, so key files probably are unlikely to be broken (low probability). Yes, but I still don't want stack unwinding to occur. In my

Re: Proposal: make Glib::KeyFile easier to use

2013-12-26 Thread Aurimas Cernius
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Okay. I think the following code that uses the current API illustrates my use case well: if (f.has_key(a, b) { // false is not unlikely bool parsed = false; int val; try { val = f.get_integer(a, b); parsed = true; } catch (...) { //

Re: Proposal: make Glib::KeyFile easier to use

2013-12-27 Thread Aurimas Cernius
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, try { fun(f.get_integer(a, b)); } catch(Glib::KeyFileError ) { /* Not found or not parsed */ } That's not an equivalent. I've written my code carefully to expose what The only case it is not equivalent is if Glib::KeyFileError can be