Logo
~Sockets~
~Examples~
~Contact~

libfuture.h

Go to the documentation of this file.
00001 /*
00002  *       /usr/devel/include/libfuture.h
00003  *       Generated by sql2class v1.9.3 by (C) AH 2000-2006
00004  *        using command line
00005  *        $ sql2class -build -lib libfuture -sqlite str-future -namespace db -overwrite -getset
00006  *       Date: Fri Nov 10 17:16:37 2006
00007  */
00008 
00009 /*
00010 Copyright (C) 2001-2006  Anders Hedstrom (grymse@alhem.net)
00011 
00012 This program is free software; you can redistribute it and/or
00013 modify it under the terms of the GNU General Public License
00014 as published by the Free Software Foundation; either version 2
00015 of the License, or (at your option) any later version.
00016 
00017 This program is distributed in the hope that it will be useful,
00018 but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 GNU General Public License for more details.
00021 
00022 You should have received a copy of the GNU General Public License
00023 along with this program; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00025 */
00026 
00027 #include <stdio.h>
00028 #include <stdlib.h>
00029 #include <string.h>
00030 #include <sqlite3.h>
00031 #include <libsqlitewrapped.h>
00032 #include <map>
00033 
00034 #include <vector>
00035 #include <string>
00036 
00037 #ifndef _LIBFUTURE_H
00038 #define _LIBFUTURE_H
00039 
00040 #ifdef _WIN32
00041 #define strncasecmp strnicmp
00042 #define strcasecmp stricmp
00043 #endif // _WIN32
00044 
00049 namespace db
00050 {
00051 class Account {
00052 public:
00053         Account(Database *);
00054         Account(Database *,const std::string& );
00055         Account(Database *,Query *,int = 0 /* offset */);
00056         Account(Database&,long num);
00057         Account(Database&,const std::string&  name);
00058         ~Account();
00059         Database& GetDatabase() { return *database; }
00060 
00061         unsigned long long int insert();
00062         void update();
00063         void save();
00064         void erase();
00065         std::string xml();
00066         std::string xml(const std::string& ,const std::string& );
00067         size_t num_cols();
00068 
00069         // table columns
00070         long                     num; // integer
00071         std::string              name; // varchar(255)
00072         std::string              passwd; // varchar(255)
00073         std::string              display_name; // varchar(255)
00074         char                     wizard; // tinyint(1)
00075         std::string              email; // varchar(255)
00076         long                     area; // integer
00077         long                     chunk; // integer
00078         long                     chunkx; // integer
00079         long                     chunky; // integer
00080         long                     facing; // integer
00081         long                     wizview; // integer
00082         long                     race; // integer
00083         //
00084 private:
00085         void clear();
00086         void spawn(const std::string& );
00087         void spawn(Query *,int = 0 /* offset */);
00088         void select(const std::string& );
00089         void update(long num);
00090         //
00091         Database *database;
00092         short new_object;
00093 }; // End of class 'Account'
00094 
00095 } // end of namespace
00096 
00101 namespace db
00102 {
00103 class Eventcount {
00104 public:
00105         Eventcount(Database *);
00106         Eventcount(Database *,const std::string& );
00107         Eventcount(Database *,Query *,int = 0 /* offset */);
00108         Eventcount(Database&,long num);
00109         Eventcount(Database&,const std::string&  event_name);
00110         ~Eventcount();
00111         Database& GetDatabase() { return *database; }
00112 
00113         unsigned long long int insert();
00114         void update();
00115         void save();
00116         void erase();
00117         std::string xml();
00118         std::string xml(const std::string& ,const std::string& );
00119         size_t num_cols();
00120 
00121         // table columns
00122         long                     num; // integer
00123         std::string              event_name; // varchar(255)
00124         long                     count; // integer
00125         //
00126 private:
00127         void clear();
00128         void spawn(const std::string& );
00129         void spawn(Query *,int = 0 /* offset */);
00130         void select(const std::string& );
00131         void update(long num);
00132         //
00133         Database *database;
00134         short new_object;
00135 }; // End of class 'Eventcount'
00136 
00137 } // end of namespace
00138 
00143 namespace db
00144 {
00145 class Area {
00146 public:
00147         Area(Database *);
00148         Area(Database *,const std::string& );
00149         Area(Database *,Query *,int = 0 /* offset */);
00150         Area(Database&,long num);
00151         Area(Database&,const std::string&  name);
00152         ~Area();
00153         Database& GetDatabase() { return *database; }
00154 
00155         unsigned long long int insert();
00156         void update();
00157         void save();
00158         void erase();
00159         std::string xml();
00160         std::string xml(const std::string& ,const std::string& );
00161         size_t num_cols();
00162 
00163         // table columns
00164         long                     num; // integer
00165         std::string              name; // varchar(255)
00166         long                     width; // integer
00167         long                     height; // integer
00168         //
00169 private:
00170         void clear();
00171         void spawn(const std::string& );
00172         void spawn(Query *,int = 0 /* offset */);
00173         void select(const std::string& );
00174         void update(long num);
00175         //
00176         Database *database;
00177         short new_object;
00178 }; // End of class 'Area'
00179 
00180 } // end of namespace
00181 
00186 namespace db
00187 {
00188 class Chunk {
00189 public:
00190         Chunk(Database *);
00191         Chunk(Database *,const std::string& );
00192         Chunk(Database *,Query *,int = 0 /* offset */);
00193         Chunk(Database&,long num);
00194         Chunk(Database&,long area,long x,long y,long z);
00195         ~Chunk();
00196         Database& GetDatabase() { return *database; }
00197 
00198         unsigned long long int insert();
00199         void update();
00200         void save();
00201         void erase();
00202         std::string xml();
00203         std::string xml(const std::string& ,const std::string& );
00204         size_t num_cols();
00205 
00206         // table columns
00207         long                     num; // integer
00208         long                     area; // integer
00209         std::string              terrain; // text
00210         long                     x; // integer
00211         long                     y; // integer
00212         long                     z; // integer
00213         long                     created_by; // integer
00214         std::string              created_date; // datetime
00215         //
00216 private:
00217         void clear();
00218         void spawn(const std::string& );
00219         void spawn(Query *,int = 0 /* offset */);
00220         void select(const std::string& );
00221         void update(long num);
00222         //
00223         Database *database;
00224         short new_object;
00225 }; // End of class 'Chunk'
00226 
00227 } // end of namespace
00228 
00233 namespace db
00234 {
00235 class Chunkinfo {
00236 public:
00237         Chunkinfo(Database *);
00238         Chunkinfo(Database *,const std::string& );
00239         Chunkinfo(Database *,Query *,int = 0 /* offset */);
00240         Chunkinfo(Database&,long num);
00241         Chunkinfo(Database&,long chunk,long type,long x,long y);
00242         ~Chunkinfo();
00243         Database& GetDatabase() { return *database; }
00244 
00245         unsigned long long int insert();
00246         void update();
00247         void save();
00248         void erase();
00249         std::string xml();
00250         std::string xml(const std::string& ,const std::string& );
00251         size_t num_cols();
00252 
00253         // table columns
00254         long                     num; // integer
00255         long                     chunk; // integer
00256         long                     type; // integer
00257         long                     x; // integer
00258         long                     y; // integer
00259         std::string              data; // varchar(255)
00260         long                     to_area; // integer
00261         long                     to_chunk; // integer
00262         long                     to_x; // integer
00263         long                     to_y; // integer
00264         //
00265 private:
00266         void clear();
00267         void spawn(const std::string& );
00268         void spawn(Query *,int = 0 /* offset */);
00269         void select(const std::string& );
00270         void update(long num);
00271         //
00272         Database *database;
00273         short new_object;
00274 }; // End of class 'Chunkinfo'
00275 
00276 } // end of namespace
00277 
00282 namespace db
00283 {
00284 class Terrain {
00285 public:
00286         Terrain(Database *);
00287         Terrain(Database *,const std::string& );
00288         Terrain(Database *,Query *,int = 0 /* offset */);
00289         Terrain(Database&,long num);
00290         Terrain(Database&,long area,const std::string&  tchar);
00291         ~Terrain();
00292         Database& GetDatabase() { return *database; }
00293 
00294         unsigned long long int insert();
00295         void update();
00296         void save();
00297         void erase();
00298         std::string xml();
00299         std::string xml(const std::string& ,const std::string& );
00300         size_t num_cols();
00301 
00302         // table columns
00303         long                     num; // integer
00304         long                     area; // integer
00305         std::string              name; // varchar(255)
00306         std::string              tchar; // char(1)
00307         std::string              tcolor; // varchar(10)
00308         long                     impassable; // integer
00309         double                   delay; // float
00310         //
00311 private:
00312         void clear();
00313         void spawn(const std::string& );
00314         void spawn(Query *,int = 0 /* offset */);
00315         void select(const std::string& );
00316         void update(long num);
00317         //
00318         Database *database;
00319         short new_object;
00320 }; // End of class 'Terrain'
00321 
00322 } // end of namespace
00323 
00328 namespace db
00329 {
00330 class Steps {
00331 public:
00332         Steps(Database *);
00333         Steps(Database *,const std::string& );
00334         Steps(Database *,Query *,int = 0 /* offset */);
00335         Steps(Database&,long num);
00336         Steps(Database&,long player,long area,long zcoord,long ycoord);
00337         ~Steps();
00338         Database& GetDatabase() { return *database; }
00339 
00340         unsigned long long int insert();
00341         void update();
00342         void save();
00343         void erase();
00344         std::string xml();
00345         std::string xml(const std::string& ,const std::string& );
00346         size_t num_cols();
00347 
00348         // table columns
00349         long                     num; // integer
00350         long                     player; // integer
00351         long                     area; // integer
00352         long                     zcoord; // integer
00353         long                     ycoord; // integer
00354         std::string              xcoords; // text
00355         //
00356 private:
00357         void clear();
00358         void spawn(const std::string& );
00359         void spawn(Query *,int = 0 /* offset */);
00360         void select(const std::string& );
00361         void update(long num);
00362         //
00363         Database *database;
00364         short new_object;
00365 }; // End of class 'Steps'
00366 
00367 } // end of namespace
00368 
00373 namespace db
00374 {
00375 class Race {
00376 public:
00377         Race(Database *);
00378         Race(Database *,const std::string& );
00379         Race(Database *,Query *,int = 0 /* offset */);
00380         Race(Database&,long num);
00381         Race(Database&,const std::string&  name);
00382         ~Race();
00383         Database& GetDatabase() { return *database; }
00384 
00385         unsigned long long int insert();
00386         void update();
00387         void save();
00388         void erase();
00389         std::string xml();
00390         std::string xml(const std::string& ,const std::string& );
00391         size_t num_cols();
00392 
00393         // table columns
00394         long                     num; // integer
00395         std::string              name; // varchar(255)
00396         double                   sightrange; // float
00397         double                   hearing; // float
00398         //
00399 private:
00400         void clear();
00401         void spawn(const std::string& );
00402         void spawn(Query *,int = 0 /* offset */);
00403         void select(const std::string& );
00404         void update(long num);
00405         //
00406         Database *database;
00407         short new_object;
00408 }; // End of class 'Race'
00409 
00410 } // end of namespace
00411 #endif // _LIBFUTURE_H
Page, code, and content Copyright (C) 2006 by Anders Hedström
Generated on Mon Aug 29 20:21:47 2005 for C++ Sockets by  doxygen 1.4.4