Hi,

I am trying to wrap gda_server_operation_prepare_create_table(). The
patch still doesn't work and I need some expert check and adjustment.
Could you please take a look at your convenience? 

Thanks.

-- 
- Pavlo Solntsev
---------------------------------------------
Sent from Evolution on GNU/Debian <www.debian.org> id="-x-evo-
selection-start-marker">

diff --git a/libgda/src/serveroperation.ccg b/libgda/src/serveroperation.ccg
index 7062331..e15f6c0 100644
--- a/libgda/src/serveroperation.ccg
+++ b/libgda/src/serveroperation.ccg
@@ -77,6 +77,25 @@ void ServerOperation::set_value_at_as_value(const Glib::ustring& path, const Gli
     ::Glib::Error::throw_exception(gerror);
 }
 
+
+typedef GdaServerOperationCreateTableArg CreateTableArg;
+
+static Glib::RefPtr<ServerOperation> prepare_create_table(Glib::RefPtr<Connection> &cnc, 
+                                                          const Glib::ustring &table_name,
+                                                          std::vector<CreateTableArg> &arguments)
+{
+      GError* gerror = 0;
+      Glib::RefPtr<ServerOperation> op =
+    Glib::wrap(gda_server_operation_prepare_create_table(cnc.operator->()->gobj(), 
+                                                         table_name.c_str(),
+               Glib::SListHandler<CreateTableArg>::vector_to_slist(arguments).data()),
+               &gerror);   
+
+  if(gerror) ::Glib::Error::throw_exception(gerror);
+
+  return op;
+}
+
 } /* namespace Gda */
 
 } /* namespace Gnome */
diff --git a/libgda/src/serveroperation.hg b/libgda/src/serveroperation.hg
index 079651d..af9f8a0 100644
--- a/libgda/src/serveroperation.hg
+++ b/libgda/src/serveroperation.hg
@@ -68,6 +68,12 @@ public:
   static Glib::RefPtr<ServerOperation> prepare_drop_database(const Glib::ustring& provider,
                                                              const Glib::ustring& db_name);
 
+   typedef GdaServerOperationCreateTableArg CreateTableArg;
+  
+   static Glib::RefPtr<ServerOperation> prepare_create_table(Glib::RefPtr<Connection> &cnc, 
+                                                             const Glib::ustring &table_name,
+                                                             std::vector<CreateTableArg> &arguments);
+
   _WRAP_METHOD(void perform_create_table(), gda_server_operation_perform_create_table, errthrow)
   _WRAP_METHOD(void perform_drop_database(const Glib::ustring& provider), gda_server_operation_perform_drop_database, errthrow)
   _WRAP_METHOD(void perform_create_database(const Glib::ustring& provider), gda_server_operation_perform_create_database, errthrow)
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to