gnomemm r1859 - in libgdamm/trunk: . examples examples/config



Author: jhs
Date: Mon Dec 15 11:23:14 2008
New Revision: 1859
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1859&view=rev

Log:
2008-12-15  Johannes Schmid  <jschmid openismus com>

	* configure.in:
	* examples/Makefile.am:
	* examples/config/Makefile.am:
	* examples/config/main.cc:
	Added a tiny example to list the available providers
	
	* libgda/src/connection.ccg:
	Some leftover from previous changes...

Added:
   libgdamm/trunk/examples/config/
   libgdamm/trunk/examples/config/Makefile.am
   libgdamm/trunk/examples/config/main.cc
Modified:
   libgdamm/trunk/ChangeLog
   libgdamm/trunk/configure.in
   libgdamm/trunk/examples/Makefile.am

Modified: libgdamm/trunk/configure.in
==============================================================================
--- libgdamm/trunk/configure.in	(original)
+++ libgdamm/trunk/configure.in	Mon Dec 15 11:23:14 2008
@@ -195,5 +195,6 @@
 
   examples/Makefile
     examples/simple/Makefile
+  examples/config/Makefile
 ])
 

Modified: libgdamm/trunk/examples/Makefile.am
==============================================================================
--- libgdamm/trunk/examples/Makefile.am	(original)
+++ libgdamm/trunk/examples/Makefile.am	Mon Dec 15 11:23:14 2008
@@ -1,4 +1,5 @@
-SUBDIRS =  simple
+SUBDIRS =  simple \
+	config
 
 EXTRA_DIST	=  Makefile.am_fragment README.txt
 

Added: libgdamm/trunk/examples/config/Makefile.am
==============================================================================
--- (empty file)
+++ libgdamm/trunk/examples/config/Makefile.am	Mon Dec 15 11:23:14 2008
@@ -0,0 +1,8 @@
+include $(top_srcdir)/examples/Makefile.am_fragment
+
+#Build the executable, but don't install it.
+noinst_PROGRAMS = example
+
+example_SOURCES = main.cc
+
+

Added: libgdamm/trunk/examples/config/main.cc
==============================================================================
--- (empty file)
+++ libgdamm/trunk/examples/config/main.cc	Mon Dec 15 11:23:14 2008
@@ -0,0 +1,44 @@
+/* main.cc
+ *
+ * Copyright (C) 2003 gnome-vfsmm Development Team
+ *
+ * This program is free software; you can redistribute it and/or 
+ * modify it under the terms of the GNU General Public License as 
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+
+#include <libgdamm.h>
+#include <iostream>
+
+using namespace Gnome;
+
+int main (int argc, char** argv)
+{
+  Gda::init();
+  
+  Glib::RefPtr<Gda::DataModel> model = Gda::Config::list_providers();
+  Glib::RefPtr<Gda::DataModelIter> iter = model->create_iter();
+
+  std::cout << "Name\t|\tDescription" << std::endl;
+  do
+  {    
+    Gda::Value name = iter->get_value_at (0);
+    Gda::Value desc = iter->get_value_at (1);
+    std::cout << name.to_string() << " | " << desc.to_string() << std::endl;
+  }
+  while (iter->move_next());
+  
+  return 0;
+}



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