Google
Web alhem.net
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

libfd.h

Go to the documentation of this file.
00001 /* 00002 * /usr/devel/include/libfd.h 00003 * Generated by sql2class by (C) AH 2000 00004 * Wed Feb 9 19:19:38 2005 00005 */ 00006 00007 /* 00008 Copyright (C) 2001 Anders Hedstrom (grymse@alhem.net) 00009 00010 This program is free software; you can redistribute it and/or 00011 modify it under the terms of the GNU General Public License 00012 as published by the Free Software Foundation; either version 2 00013 of the License, or (at your option) any later version. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 */ 00024 00025 #include <stdio.h> 00026 #include <stdlib.h> 00027 #include <string.h> 00028 #include <mysql/mysql.h> 00029 #include <libmysqlwrapped.h> 00030 #ifndef WIN32 00031 #include <stdint.h> 00032 #endif 00033 #include <map> 00034 00035 #include <vector> 00036 #include <string> 00037 00038 #ifndef _LIBFD_H 00039 #define _LIBFD_H 00040 00041 #ifdef _WIN32 00042 #define strncasecmp strnicmp 00043 #define strcasecmp stricmp 00044 #endif // _WIN32 00045 00050 namespace db 00051 { 00052 class Category { 00053 public: 00054 Category(Database *); 00055 Category(Database *,const std::string& ); 00056 Category(Database *,Query *,int = 0 /* offset */); 00057 Category(Database&,long num); 00058 ~Category(); 00059 my_ulonglong insert(); 00060 void update(); 00061 void save(); 00062 void erase(); 00063 std::string xml(); 00064 std::string xml(const std::string& ,const std::string& ); 00065 size_t num_cols(); 00066 00067 // table columns 00068 long num; // int(11) 00069 std::string name; // varchar(255) 00070 00071 private: 00072 void clear(); 00073 void spawn(const std::string& ); 00074 void spawn(Query *,int = 0 /* offset */); 00075 void select(const std::string& ); 00076 void update(long num); 00077 // 00078 Database *database; 00079 short new_object; 00080 }; // End of class 'Category' 00081 00082 } // end of namespace 00083 00088 namespace db 00089 { 00090 class Item { 00091 // map for ENUM column typ 00092 std::map<std::string, uint64_t> mmap_typ; 00093 00094 public: 00095 Item(Database *); 00096 Item(Database *,const std::string& ); 00097 Item(Database *,Query *,int = 0 /* offset */); 00098 Item(Database&,long num); 00099 Item(Database&,long sz,const std::string& sha1); 00100 ~Item(); 00101 my_ulonglong insert(); 00102 void update(); 00103 void save(); 00104 void erase(); 00105 std::string xml(); 00106 std::string xml(const std::string& ,const std::string& ); 00107 size_t num_cols(); 00108 00109 // table columns 00110 long num; // int(11) 00111 enum_t typ; // enum('File','URL') 00112 long category; // int(11) 00113 std::string name; // varchar(255) 00114 std::vector<std::string> data; // mediumtext 00115 long sz; // int(11) 00116 std::string sha1; // varchar(40) 00117 00118 private: 00119 void clear(); 00120 void spawn(const std::string& ); 00121 void spawn(Query *,int = 0 /* offset */); 00122 void select(const std::string& ); 00123 void update(long num); 00124 // 00125 Database *database; 00126 short new_object; 00127 }; // End of class 'Item' 00128 00129 } // end of namespace 00130 00135 namespace db 00136 { 00137 class Linkitemtag { 00138 public: 00139 Linkitemtag(Database *); 00140 Linkitemtag(Database *,const std::string& ); 00141 Linkitemtag(Database *,Query *,int = 0 /* offset */); 00142 Linkitemtag(Database&,long item,long tag); 00143 ~Linkitemtag(); 00144 my_ulonglong insert(); 00145 void update(); 00146 void save(); 00147 void erase(); 00148 std::string xml(); 00149 std::string xml(const std::string& ,const std::string& ); 00150 size_t num_cols(); 00151 00152 // table columns 00153 long item; // int(11) 00154 long tag; // int(11) 00155 00156 private: 00157 void clear(); 00158 void spawn(const std::string& ); 00159 void spawn(Query *,int = 0 /* offset */); 00160 void select(const std::string& ); 00161 void update(long item,long tag); 00162 // 00163 Database *database; 00164 short new_object; 00165 }; // End of class 'Linkitemtag' 00166 00167 } // end of namespace 00168 00173 namespace db 00174 { 00175 class Tag { 00176 public: 00177 Tag(Database *); 00178 Tag(Database *,const std::string& ); 00179 Tag(Database *,Query *,int = 0 /* offset */); 00180 Tag(Database&,long num); 00181 ~Tag(); 00182 my_ulonglong insert(); 00183 void update(); 00184 void save(); 00185 void erase(); 00186 std::string xml(); 00187 std::string xml(const std::string& ,const std::string& ); 00188 size_t num_cols(); 00189 00190 // table columns 00191 long num; // int(11) 00192 std::string name; // varchar(255) 00193 00194 private: 00195 void clear(); 00196 void spawn(const std::string& ); 00197 void spawn(Query *,int = 0 /* offset */); 00198 void select(const std::string& ); 00199 void update(long num); 00200 // 00201 Database *database; 00202 short new_object; 00203 }; // End of class 'Tag' 00204 00205 } // end of namespace 00206 #endif // _LIBFD_H

Generated on Thu Feb 10 22:42:34 2005 for Distributed URL Classification Tool by doxygen 1.3.7