Received: from steel.orel.ru (steel.orel.ru [195.90.189.225]) by hub.org (8.9.3/8.9.3) with ESMTP id AAA77758 for ; Fri, 26 May 2000 00:57:57 -0400 (EDT) (envelope-from jk@steel.oryol.ru) Received: from jk.dev ([192.168.131.37]) by steel.orel.ru with esmtp (Exim 3.00 #1) id 12vCBN-000334-00 for pgsql-interfaces@postgresql.org; Fri, 26 May 2000 08:57:13 +0400 Received: from jk by jk.dev with local (Exim 3.00 #1) id 12vCBL-00019u-00 for pgsql-interfaces@postgresql.org; Fri, 26 May 2000 08:57:11 +0400 Date: Fri, 26 May 2000 08:57:11 +0400 From: Eugene Karpachov To: pgsql-interfaces@postgresql.org Subject: Re: libpq++ updates Message-ID: <20000526085711.A3380@steel.orel.ru> Mail-Followup-To: pgsql-interfaces@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2i In-Reply-To: ; from dagraz@mindspring.com on Wed, May 24, 2000 at 04:54:05PM -0400 X-Archive-Number: 200005/57 Wed, May 24, 2000 at 04:54:05PM -0400, dagraz@mindspring.com пишет: > There are a couple of changes I would like to make to libpq++, > but I thought I would write first to check > a) add string overloads to the methods accepting char*'s Are you mean somefun(const char *) --> somefun(string) or somefun(const string &) ? It would be useful, with 'string' from STL. But it will force class users to use STL :(. > > c) Move PgConnection::Connect and PgConnection::PgConnection() > from the protected to the public interface. > > Any reasons why this would be undesirable? The only reason is that: less public members is better. If you really need, for example, PgConnection::Connect() in your program, you can derive class from PgConnection or PgDatabase and use the protected member in derived class methods. These protected members have almost no use for 'public users'. > any thoughts will be appreciated, Maybe some methods like ExecTuplesOk, ExecCommandOk should emit exceptions? Something derived from standard class 'exception', like #include class PGerror : public exception { private: string err; // or, maybe, 'const char *err' if you don't like STL public: PGerror(PgDatabase *db) : err(db->ErrorMessage()) {} virtual const char *what() const { return err.c_str(); } }; -- jk