Re: [HACKERS] minor improvement to libpq++ ...

From: Maarten Boekhold <maartenb(at)dutepp0(dot)et(dot)tudelft(dot)nl>
To: Andreas Hauck <Andreas(dot)Hauck(at)earthling(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] minor improvement to libpq++ ...
Date: 1998-06-18 20:59:29
Message-ID: Pine.SUN.3.91.980618225703.20931D-100000@dutepp0.et.tudelft.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 18 Jun 1998, Andreas Hauck wrote:

> Hi y'all,
>
> to unify the framework of the look an feeling of c++ programs relying on
> libpq++ I propose to migrate to a consistant use of 'string' to represent any
> text rather than 'char *'.
>
> Especially I refer to PgConnection::Exec(char *), ExecCommandOk() and
> ExecTuplesOk(). It is very easy to switch over to the use of strings: in the
> headerfiles only (char * --> string) has to be changed and in the
> corresponding c++ files, the call to the c-functions becomes e.g.
> PQexec(pgConn, query) --> PQexec(pgConn, query.c_str()).
>
> The old style call via 'char *' would still be possible, since 'char *' is
> automatically convertet to 'string'.

I'm all for it, but are you sure about the automatic conversion? I don't
think it does that.... I just did a grep on bastring.h, and it doesn't
show a char* operator. And string.c_str() returns a const char*, which
gives all sorts of errors/warning during compile.....

Maarten

_____________________________________________________________________________
| TU Delft, The Netherlands, Faculty of Information Technology and Systems |
| Department of Electrical Engineering |
| Computer Architecture and Digital Technique section |
| M(dot)Boekhold(at)et(dot)tudelft(dot)nl |
-----------------------------------------------------------------------------

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc Howard Zuckman 1998-06-19 04:24:03 RE: [HACKERS] Need help understanding unique indices (fwd)
Previous Message Robin Thomas 1998-06-18 20:44:48 Re: [GENERAL] COALESCE() or NVL()