[glibmm] Gio::Application: Added get_environ().



commit d7673615ec159cc7d1a56b79d8ef2317b57e8f2d
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Mar 4 09:40:36 2011 +0100

    Gio::Application: Added get_environ().
    
    * gio/src/gio_others.defs: Add a hand-written definition for this, because
    h2defs.py ignores functions with this return type.
    * gio/src/applicationcommandline.hg: Wrap the function.

 ChangeLog                         |    8 ++++++++
 gio/src/applicationcommandline.hg |    5 +++--
 gio/src/gio_others.defs           |    8 ++++++++
 3 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index af0d857..7021b21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-03-04  Murray Cumming  <murrayc murrayc com>
 
+	Gio::Application: Added get_environ().
+
+	* gio/src/gio_others.defs: Add a hand-written definition for this, because 
+	h2defs.py ignores functions with this return type.
+	* gio/src/applicationcommandline.hg: Wrap the function.
+
+2011-03-04  Murray Cumming  <murrayc murrayc com>
+
 	ApplicationCommandLine: Use std::string instead of ustring in some API.
 
 	* gio/src/applicationcommandline.hg: The C documentation says that some 
diff --git a/gio/src/applicationcommandline.hg b/gio/src/applicationcommandline.hg
index 02e02a0..bb95fe5 100644
--- a/gio/src/applicationcommandline.hg
+++ b/gio/src/applicationcommandline.hg
@@ -38,8 +38,9 @@ public:
   //We use std::string instead of ustring because the C documentation says that it may be non-UTF-8 data:
   _WRAP_METHOD(std::string get_cwd() const, g_application_command_line_get_cwd)
 
-  // it seems that h2defs.py has trouble parsing the const gchar * const * type
-  //_WRAP_METHOD(std::vector<std::string> get_environ() const, g_application_command_line_get_environ)
+  //We use std::string instead of ustring because the C documentation says that it may be non-UTF-8 data:
+#m4 _CONVERSION(`const gchar*const*',`std::vector<std::string>',`Glib::ArrayHandler<std::string>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
+  _WRAP_METHOD(std::vector<std::string> get_environ() const, g_application_command_line_get_environ)
   
   //We use std::string instead of ustring because the C documentation says that it may be non-UTF-8 data:
   _WRAP_METHOD(std::string getenv(const Glib::ustring& name) const, g_application_command_line_getenv)
diff --git a/gio/src/gio_others.defs b/gio/src/gio_others.defs
index 7330612..312c73c 100644
--- a/gio/src/gio_others.defs
+++ b/gio/src/gio_others.defs
@@ -4,6 +4,13 @@
   (return-type "const-char*const*")
 )
 
+; h2defs failed to generate this murrayc:
+(define-method get_environ
+  (of-object "GApplicationCommandLine")
+  (c-name "g_application_command_line_get_environ")
+  (return-type "const-gchar*const*")
+)
+
 
 ; extra_defs does not generate these, for some reason. murrayc:
 (define-signal changed
@@ -32,3 +39,4 @@
 )
 
 
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]