[glibmm] TlsFileDatabase: Wrap the create() method.



commit a133941a3b46141b54955f3db695447d70a81d87
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Tue Mar 12 23:11:20 2013 -0400

    TlsFileDatabase: Wrap the create() method.
    
        * gio/src/tlsfiledatabase.{ccg,hg}: Manually wrap it because
        presently the *_new() function does more than call g_initable_new().

 ChangeLog                   |    6 ++++++
 gio/src/tlsfiledatabase.ccg |   11 +++++++++++
 gio/src/tlsfiledatabase.hg  |    7 +++++--
 gio/src/tlspassword.hg      |    1 +
 4 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 84c19ef..ee36d0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-03-12  José Alburquerque  <jaalburquerque gmail com>
+
+       TlsFileDatabase: Wrap the create() method.
+
+       * gio/src/tlsfiledatabase.{ccg,hg}: Manually wrap it because
+       presently the *_new() function does more than call g_initable_new().
 
 2013-02-26  José Alburquerque  <jaalburquerque gmail com>
 
diff --git a/gio/src/tlsfiledatabase.ccg b/gio/src/tlsfiledatabase.ccg
index 22171e0..6846283 100644
--- a/gio/src/tlsfiledatabase.ccg
+++ b/gio/src/tlsfiledatabase.ccg
@@ -20,4 +20,15 @@
 namespace Gio
 {
 
+Glib::RefPtr<TlsFileDatabase>
+TlsFileDatabase::create(const Glib::ustring& anchors)
+{
+  GError* gerror = 0;
+  GTlsFileDatabase* file_database = g_tls_file_database_new(anchors.c_str(),
+    &gerror);
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+  return Glib::wrap(file_database);
+}
+
 } // namespace Gio
diff --git a/gio/src/tlsfiledatabase.hg b/gio/src/tlsfiledatabase.hg
index 2c5d9f8..ef000b6 100644
--- a/gio/src/tlsfiledatabase.hg
+++ b/gio/src/tlsfiledatabase.hg
@@ -39,8 +39,11 @@ class TlsFileDatabase : public Glib::Interface
   _CLASS_INTERFACE(TlsFileDatabase, GTlsFileDatabase, G_TLS_FILE_DATABASE, GTlsFileDatabaseInterface)
 
 public:
-  //TODO: Wrap the the g_tls_file_database_new() C function which returns a
-  //GTlsDatabase* and does more than calling g_initable_new().
+  //TODO: Wrap this using _WRAP_CTR()/WRAP_CREATE() when the
+  //g_tls_file_database_new() function does not do more than calling
+  //g_initable_new().
+  _WRAP_METHOD_DOCS_ONLY(g_tls_file_database_new)
+  static Glib::RefPtr<TlsFileDatabase> create(const Glib::ustring& anchors);
 
   _WRAP_PROPERTY("anchors", Glib::ustring)
 };
diff --git a/gio/src/tlspassword.hg b/gio/src/tlspassword.hg
index 996373d..96ccdaa 100644
--- a/gio/src/tlspassword.hg
+++ b/gio/src/tlspassword.hg
@@ -41,6 +41,7 @@ public:
   _WRAP_CREATE(TlsPasswordFlags flags, const Glib::ustring& description)
 
   _WRAP_METHOD(const guchar* get_value(gsize& length{?}) const, g_tls_password_get_value)
+
   _WRAP_METHOD(void set_value(const guchar* value, gssize length = -1), g_tls_password_set_value)
   // This function does not copy the value as g_tls_password_set_value() does.
   // It keeps a reference to the original value and expects it to be freed


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