![]() |
Database.hGo to the documentation of this file.00001 // Database.h 00002 /* 00003 Copyright (C) 2001-2005 Anders Hedstrom 00004 00005 This program is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU General Public License 00007 as published by the Free Software Foundation; either version 2 00008 of the License, or (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 */ 00019 00020 #ifndef _DATABASE_H 00021 #define _DATABASE_H 00022 00023 #include <vector> 00024 #include "Query.h" 00025 00026 class Session; 00027 typedef std::vector<Session *> sessions_t; 00028 00029 class Database 00030 { 00031 public: 00032 Database(const std::string &); 00033 Database(char *filename,int mode); 00034 virtual ~Database(); 00035 00036 Session * grabdb(); 00037 void freedb(Session *odb); 00038 Query * GetQuery(); 00039 Query * GetQuery(const std::string &); 00040 00041 short errcode(); 00042 void debug(short val); 00043 short debug(); 00044 00045 void SetEscapeChar( char ); 00046 char GetEscapeChar(); 00047 void SetDecimalChar( char ); 00048 char GetDecimalChar(); 00049 00050 void GetErrorText(char *) {} 00051 00052 private: 00053 char *filename; 00054 int mode; 00055 sessions_t m_sessions; 00056 short errc; 00057 short _debug; 00058 char m_escape; 00059 char m_decimal; 00060 }; 00061 00062 00063 #endif // _DATABASE_H |