libgda-commoncpp comments
- From: Laurent Marzullo <laurent marzullo sema be>
- To: gnome-db-list gnome org
- Subject: libgda-commoncpp comments
- Date: Tue, 31 Oct 2000 10:32:03 +0100
Hello,
Just a mail to tell you about my work on gda-common C++ wrapper and
to have comment about it.
I'm using 2 namespaces :
namespace GDA
{
	namespace Common
	{
	}
	// There will be a namespace Client too.
}
In Namespace GDA::Common -
I've created a class 'App' which will handle all stuff that is in
gda-config.h (such as, gda_init, gda_config* )
You use it like this:
class	MyApp	: public GDA::Common::App
{
	public:
		MyApp( const string& s1, const string& s2, int argc, char** argv)
			: GDA::Common::App( s1 , s2 , argc , argv )
			{}
};
main( int argc , char **argv )
{
	// this will do gda_init and GConf initialization	
	MyApp	test( "test" , "1.0" , argc , argv );
}
Then I do an iterator for 'GList' and use it to go throw Provider and DSN:
to take the list of the Provider (it's the same thing for DSN):
I've got a class Provider and a class DSN which hold a class Iterator and List.
	//after initialization ....
	Provider::List		l_dsn_list;
	DSN::List		l_prov_list;
	Provider::Iterator	l_prov_itr = l_prov_list.begin();
	// For printing the list of the provider :
	while ( l_prov_iter != l_prov_list.end() )
		cout << "prov = " << (*l_prov_iter++).Name() << endl;
	// to look for a DSN with its name:
	DSN::Iterator	l_dsn_itr = find( l_dsn_list.begin() , l_dsn_list.end() , 
"name" );
	// if l_dsn_itr is l_dsn_list.end() "name" is not found in the DSN list, else
	// (*l_dsn_itr) is the DSN with name "name".
	// find is a common c++ function found in <algorithm>
For now, I'm working on gda_config* stuff and I began to look at GTK-- code 
and how
they 've done gtk wrapping to try to do a wrapper for Gda_Connection as 
close as
gtk--. For now, I just see that they've got some private header file that I 
must
include in mine to be able to do the same kind of thing. Perhaps it is not 
a good
idea to depend on private Gtk-- header files... I will see ...
that's all for now.
+---------------------------+
| Laurent Marzullo          |
| SEMA - GROUP Belgium      |
| 96, rue de stalle         |
| 1180 Bruxelles - BELGIUM  |
| tél: +32(0) 2 333 52 43   |
| laurent marzullo sema be  |
+---------------------------+
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]