52 #include "mysql_com.h"
55 #include "StDbBufferI.h"
57 enum myctype{_char,_uchar,_short,_ushort,_int,_uint,_long,_ulong,_longlong,_float,_double,_ascii,_string};
59 const int mycsize[]={
sizeof(char),
sizeof(
unsigned char),
sizeof(short),
sizeof(
unsigned short),
sizeof(int),
sizeof(
unsigned int),
sizeof(long),
sizeof(
unsigned long),
sizeof(
long long),
sizeof(
float),
sizeof(double),
sizeof(
char*),
sizeof(
char*)};
61 #if defined(__sun) && !defined(__i386) || defined(__hpux) || defined(__alpha) && !defined(linux)
62 const int mycswapl[]={1,1,1,1,4,4,4,4,8,4,8,1,1};
64 const int mycswapl[]={1,1,1,1,1,1,1,1,1,1,1,1,1};
73 enum BuffMode{Auto,Client,Storage};
86 void zeroColumn(
int istart,
int iend);
100 Init( anum_fields,acol);}
102 void Init(
unsigned int anum_fields,
column * acol){
109 virtual void SetClientMode() {mMode=Client;};
110 virtual void SetStorageMode() {mMode=Storage;};
111 virtual bool IsClientMode() {
return (mMode==Client) ?
true :
false;};
112 virtual bool IsStorageMode() {
return (mMode==Storage) ?
true :
false;};
117 virtual char** WhatsIn();
119 virtual bool ReadScalar(
char &c,
const char *aName) ;
120 virtual bool ReadScalar(
unsigned char &c,
const char *) ;
121 virtual bool ReadScalar(
short &h,
const char *) ;
122 virtual bool ReadScalar(
unsigned short &h,
const char *) ;
123 virtual bool ReadScalar(
int &i,
const char *) ;
124 virtual bool ReadScalar(
unsigned int &i,
const char *) ;
125 virtual bool ReadScalar(
long &l,
const char *) ;
126 virtual bool ReadScalar(
unsigned long &l,
const char *) ;
127 virtual bool ReadScalar(
long long &l,
const char *) ;
128 virtual bool ReadScalar(
float &f,
const char *) ;
129 virtual bool ReadScalar(
double &d,
const char *) ;
130 virtual bool ReadScalar(
char *&c,
const char *) ;
132 virtual bool WriteScalar(
const char c,
const char *) ;
133 virtual bool WriteScalar(
const unsigned char c,
const char *) ;
134 virtual bool WriteScalar(
const short h,
const char *) ;
135 virtual bool WriteScalar(
const unsigned short h,
const char *) ;
136 virtual bool WriteScalar(
const int i,
const char *) ;
137 virtual bool WriteScalar(
const unsigned int i,
const char *) ;
138 virtual bool WriteScalar(
const long l,
const char *) ;
139 virtual bool WriteScalar(
const unsigned long l,
const char *) ;
140 virtual bool WriteScalar(
const long long l,
const char *) ;
141 virtual bool WriteScalar(
const float f,
const char *) ;
142 virtual bool WriteScalar(
const double d,
const char *) ;
143 virtual bool WriteScalar(
const char *c,
const char *);
145 virtual bool ReadArray(
char *&c,
int &len,
const char *);
146 virtual bool ReadArray(
unsigned char *&c,
int &len,
const char *);
147 virtual bool ReadArray(
short *&c,
int &len,
const char *);
148 virtual bool ReadArray(
unsigned short *&c,
int &len,
const char *);
149 virtual bool ReadArray(
int *&c,
int &len,
const char *);
150 virtual bool ReadArray(
unsigned int *&c,
int &len,
const char *);
151 virtual bool ReadArray(
long *&c,
int &len,
const char *);
152 virtual bool ReadArray(
unsigned long *&c,
int &len,
const char *);
153 virtual bool ReadArray(
long long *&c,
int &len,
const char *);
154 virtual bool ReadArray(
float *&c,
int &len,
const char *);
155 virtual bool ReadArray(
double *&c,
int &len,
const char *);
156 virtual bool ReadArray(
char **&c,
int &len,
const char *);
158 virtual bool WriteArray(
char *c,
int len,
const char *);
159 virtual bool WriteArray(
unsigned char *c,
int len,
const char *);
160 virtual bool WriteArray(
short *c,
int len,
const char *);
161 virtual bool WriteArray(
unsigned short *c,
int len,
const char *);
162 virtual bool WriteArray(
int *c,
int len,
const char *);
163 virtual bool WriteArray(
unsigned int *c,
int len,
const char *);
164 virtual bool WriteArray(
long *c,
int len,
const char *);
165 virtual bool WriteArray(
unsigned long *c,
int len,
const char *);
166 virtual bool WriteArray(
long long *c,
int len,
const char *);
167 virtual bool WriteArray(
float *c,
int len,
const char *);
168 virtual bool WriteArray(
double *c,
int len,
const char *);
169 virtual bool WriteArray(
char **c,
int len,
const char *);
176 bool Find_Col (
const char *aName);
177 void AddField(
const char *aName,
const myctype aTpe,
const void* aVal,
const int aLen);
178 void ChangeField(
const myctype aTpe,
const void* aVal,
const int aLen);
182 bool WriteMem(
char *s,
void* aVal, myctype type);
183 bool WriteMem(
unsigned char *s,
void* aVal, myctype type);
184 bool WriteMem(
short *s,
void* aVal, myctype type);
185 bool WriteMem(
unsigned short *s,
void* aVal, myctype type);
186 bool WriteMem(
int *s,
void* aVal, myctype type);
187 bool WriteMem(
unsigned int *s,
void* aVal, myctype type);
188 bool WriteMem(
long *s,
void* aVal, myctype type);
189 bool WriteMem(
unsigned long *s,
void* aVal, myctype type);
190 bool WriteMem(
long long *s,
void* aVal, myctype type);
191 bool WriteMem(
float *s,
void* aVal, myctype type);
192 bool WriteMem(
double *s,
void* aVal, myctype type);
193 bool WriteMem(
char **s,
void* aVal, myctype type);
195 void StrConv(
char* aVal,
char &s);
196 void StrConv(
char* aVal,
unsigned char &s);
197 void StrConv(
char* aVal,
short &s);
198 void StrConv(
char* aVal,
unsigned short &s);
199 void StrConv(
char* aVal,
int &s);
200 void StrConv(
char* aVal,
unsigned int &s);
201 void StrConv(
char* aVal,
long &s);
202 void StrConv(
char* aVal,
unsigned long &s);
203 void StrConv(
char* aVal,
long long &s);
204 void StrConv(
char* aVal,
float &s);
205 void StrConv(
char* aVal,
double &s);
206 void StrConv(
char* aVal,
char* &s);
208 void MemSwapCpy(
char* where,
char* from,
int len,
int swaplen,BuffMode mode);