GNOME Bugzilla – Bug 578355
g_listenv isn't wrapped
Last modified: 2010-04-23 05:36:58 UTC
(spawned from Bug #465129) Nope, it's not. glib's gutils.h has environment-handlers g_getenv g_setenv g_unsetenv g_listenv, but glibmm's miscutils.h only provides wrappers for g_getenv g_setenv g_unsetenv. Seems like there ought to be a complete/consistent set of wrappers.
A patch would be welcome.
Created attachment 158938 [details] [review] Wrap up g_listenv() Wrapped up g_listenv() into Glib::listenv().
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Oh, and also, thank you for the patch :)
I wonder if that should use Glib::ustring instead of std::string. The documentation says "the UTF-8 encoding that this function and getenv() provide" However, the existing methods already use std::string, so I guess we should keep it consistent.
Yeah, so I spent a long time debating which one made more sense. The other environment functions returned std::string. However, g_strerror and g_strsignal, in the glib documentation, have the same return type description of UTF-8 encoded string as g_listenv().