[A4l-develop] Details verbessert: Spezifikation
Status: Planning
Brought to you by:
thomas-p
|
From: <cpl...@gm...> - 2002-09-04 19:05:58
|
Datei Header:
---------------
jede Datei sollte so eingeleitet werden
/*****************************************************************************
* AUTHOR: <name> <email>
* VERSION: <version>
* PROJECT: a4l
* DESCRIPTION: <what includes this file>
* DATE: <date>
*
* (C) 2002 by <name>
*
* 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, 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; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*****************************************************************************
/
Die <> makierten Felder müsst ihr natürlich mit euren Informationen ausfüllen
:)
Exceptions:
-------------
(aus errors.hh)
namespace a4l
{
class error
{
public:
error() { }
error(const error &e) { }
error &operator=(const error &obj) { return *this; }
virtual ~error() { }
virtual const char *what(void) const =0;
virtual const std::string &what(void) const =0;
virtual const std::string &describe(void) const =0;
virtual const char *describe(void) const =0;
};
}
davon sollten alle exceptions abgeleitet werden.
Datenbank Schnitstelle:
--------------------------
(aus database.hh)
namespace a4l
{
typedef enum
{
POSTGRESQL,
MYSQL,
ODBC
} db_type;
class database
{
public:
database() { }
database(const database &obj) { }
virtual ~database() { }
database &operator=(const database &obj) { return *this; }
virtual bool connect(const char *host,int port,const char *user, const
char *pwd, const char *options=NULL)=0;
virtual bool connect(const char *host,const char *port,const char *user,
const char *pwd, const char *options=NULL)=0;
virtual bool connect(const std::string &host, int port, const std::string
&user, const std::string &pwd, const std::string &options="")=0;
virtual bool disconnect(void)=0;
virtual bool sqlexecute(const char *sqlcommand)=0;
virtual bool sqlexecute(const std::string &sqlcommand)=0;
virtual void getsqloutput(std::string &output) const =0;
virtual void getsqloutput(char *to, size_t n) const =0;
virtual bool isconnected(void) const =0;
virtual db_type gettype(void) const =0;
};
}
BTW.
wir bräuchten mal CVS Zugang auf dem Sourceforge Server, damit wir langsam
mal den ersten Code abloaden können, muss mal schauen wie man das einrichten
kann (hast du ne Ahnung Thomas?)
mfg
|