libfd.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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 );
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
00068 long num;
00069 std::string
name;
00070
00071
private:
00072
void clear();
00073
void spawn(
const std::string& );
00074
void spawn(Query *,
int = 0 );
00075
void select(
const std::string& );
00076
void update(
long num);
00077
00078 Database *
database;
00079 short new_object;
00080 };
00081
00082 }
00083
00088
namespace db
00089 {
00090 class Item {
00091
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 );
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
00110 long num;
00111 enum_t
typ;
00112 long category;
00113 std::string
name;
00114 std::vector<std::string>
data;
00115 long sz;
00116 std::string
sha1;
00117
00118
private:
00119
void clear();
00120
void spawn(
const std::string& );
00121
void spawn(Query *,
int = 0 );
00122
void select(
const std::string& );
00123
void update(
long num);
00124
00125 Database *
database;
00126 short new_object;
00127 };
00128
00129 }
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 );
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
00153 long item;
00154 long tag;
00155
00156
private:
00157
void clear();
00158
void spawn(
const std::string& );
00159
void spawn(Query *,
int = 0 );
00160
void select(
const std::string& );
00161
void update(
long item,
long tag);
00162
00163 Database *
database;
00164 short new_object;
00165 };
00166
00167 }
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 );
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
00191 long num;
00192 std::string
name;
00193
00194
private:
00195
void clear();
00196
void spawn(
const std::string& );
00197
void spawn(Query *,
int = 0 );
00198
void select(
const std::string& );
00199
void update(
long num);
00200
00201 Database *
database;
00202 short new_object;
00203 };
00204
00205 }
00206
#endif // _LIBFD_H
Generated on Thu Feb 10 22:42:34 2005 for Distributed URL Classification Tool by
1.3.7