#include <NetServeurCom.h>
Fonctions membres publiques | |
ServeurCom () | |
~ServeurCom () | |
int | Start (char *NomFichier) |
int | Stop () |
int | Parse (char *Buffer) |
char * | GetData () |
Fonctions membres privées | |
int | SetTable (char *Buffer) |
int | SetId (char *Buffer) |
int | SetData (char *Buffer) |
int | Insert (char *Buffer) |
int | Delet (char *Buffer) |
int | Select (char *Buffer) |
int | NbEntry (char *Buffer) |
int | WorkWithSql () |
int | WorkWithFile () |
int | FileToSql () |
int | SqlToFile () |
Attributs privés | |
DataBase | Base |
int | Requette |
int | Table |
int | Id |
char * | Data |
char * | DataOut |
int | Last |
int | Running |
|
Définition à la ligne 14 du fichier NetServeurCom.cpp. 00015 { 00016 Requette= 0; 00017 Table = 0; 00018 Id = 0; 00019 Data = NULL; 00020 DataOut = NULL; 00021 Last = 0; 00022 Running = 0; 00023 }
|
|
Définition à la ligne 25 du fichier NetServeurCom.cpp.
|
|
Définition à la ligne 180 du fichier NetServeurCom.cpp. 00181 { 00182 BEGIN 00183 00184 TRY if(Running == 1) 00185 { 00186 CERROR = SetTable(Buffer); 00187 00188 if(Table == 0) 00189 { 00190 delete [] DataOut; 00191 00192 DataOut = new char[8]; 00193 sprintf(DataOut, "%i", ERR_TABLE); 00194 } 00195 else 00196 { 00197 TRY CERROR = SetId(Buffer); 00198 00199 if(Id == 0) 00200 { 00201 delete [] DataOut; 00202 00203 DataOut = new char[8]; 00204 sprintf(DataOut, "%i", ERR_ID); 00205 } 00206 else 00207 { 00208 TRY CERROR = Base.Remove(Table, Id); 00209 00210 TRY CERROR = Base.Read(Table); 00211 00212 TRY 00213 { 00214 delete [] DataOut; 00215 00216 DataOut = new char[32]; 00217 sprintf(DataOut, "%i %i %i", NBENTRY, Table, Base.GetNbData()); 00218 } 00219 } 00220 } 00221 } 00222 ENDTRY(16) 00223 00224 ENDBEGIN 00225 }
|
|
|
|
Définition à la ligne 78 du fichier NetServeurCom.h. 00079 {
00080 return DataOut;
00081 };
|
|
Définition à la ligne 141 du fichier NetServeurCom.cpp. 00142 { 00143 BEGIN 00144 00145 TRY if(Running == 1) 00146 { 00147 CERROR = SetTable(Buffer); 00148 00149 if(Table == 0) 00150 { 00151 delete [] DataOut; 00152 00153 DataOut = new char[8]; 00154 sprintf(DataOut, "%i", ERR_TABLE); 00155 } 00156 else 00157 { 00158 TRY CERROR = SetId(Buffer); 00159 00160 TRY CERROR = SetData(Buffer); 00161 00162 TRY CERROR = Base.GetTable(Table).GetEntry(Id).SetDatas(Data); 00163 00164 TRY CERROR = Base.GetTable(Table).GetEntry(Id).GetDatas(); 00165 00166 TRY 00167 { 00168 delete [] DataOut; 00169 00170 DataOut = new char[strlen(Base.GetData()) + 16]; 00171 sprintf(DataOut, "%i %i %s", DATA, Table, Base.GetData()); 00172 } 00173 } 00174 } 00175 ENDTRY(16) 00176 00177 ENDBEGIN 00178 }
|
|
Définition à la ligne 227 du fichier NetServeurCom.cpp. 00228 { 00229 BEGIN 00230 00231 TRY if(Running == 1) 00232 { 00233 CERROR = SetTable(Buffer); 00234 00235 if(Table == 0) 00236 { 00237 delete [] DataOut; 00238 00239 DataOut = new char[8]; 00240 sprintf(DataOut, "%i", ERR_TABLE); 00241 } 00242 else 00243 { 00244 TRY CERROR = Base.Read(Table); 00245 00246 TRY 00247 { 00248 delete [] DataOut; 00249 00250 DataOut = new char[32]; 00251 sprintf(DataOut, "%i %i %i", NBENTRY, Table, Base.GetNbData()); 00252 } 00253 } 00254 } 00255 ENDTRY(16) 00256 00257 ENDBEGIN 00258 }
|
|
Définition à la ligne 65 du fichier NetServeurCom.cpp. 00066 { 00067 BEGIN 00068 00069 TRY if(Running == 1) 00070 { 00071 TRY if(isnumber(gettok(Buffer, 0, " \n"))) 00072 { 00073 Requette = AtoD(gettok(Buffer, 0, " \n")); 00074 00075 switch(Requette) 00076 { 00077 case INSERT : 00078 Last = 0; 00079 CERROR = Insert(Buffer); 00080 break; 00081 00082 case DELET : 00083 Last = 0; 00084 CERROR = Delet(Buffer); 00085 break; 00086 00087 case NBENTRY : 00088 Last = 0; 00089 CERROR = NbEntry(Buffer); 00090 break; 00091 00092 case SELECT : 00093 Last = 0; 00094 CERROR = Select(Buffer); 00095 break; 00096 00097 case OK : 00098 if(Last) 00099 CERROR = Select(Buffer); 00100 else 00101 CERROR = 13; 00102 break; 00103 00104 case ERR_REFU: 00105 if(Last) 00106 Last = 0; 00107 else 00108 CERROR = 13; 00109 break; 00110 00111 case ERR_NB : 00112 if(Last) 00113 Last = 0; 00114 else 00115 CERROR = 13; 00116 break; 00117 00118 default : 00119 CERROR = 13; 00120 break; 00121 } 00122 } 00123 ENDTRY(13) 00124 00125 if(CERROR == 13) 00126 { 00127 delete [] DataOut; 00128 00129 DataOut = new char[8]; 00130 sprintf(DataOut, "%i", ERR_PROT); 00131 00132 CERROR = 0; 00133 } 00134 00135 } 00136 ENDTRY(16) 00137 00138 ENDBEGIN 00139 }
|
|
Définition à la ligne 260 du fichier NetServeurCom.cpp. 00261 { 00262 BEGIN 00263 00264 TRY if(Running == 1) 00265 { 00266 CERROR = SetTable(Buffer); 00267 00268 if(Table == 0) 00269 { 00270 delete [] DataOut; 00271 00272 DataOut = new char[8]; 00273 sprintf(DataOut, "%i", ERR_TABLE); 00274 } 00275 else 00276 { 00277 TRY CERROR = SetId(Buffer); 00278 00279 TRY CERROR = Base.Read(Table); 00280 00281 TRY 00282 { 00283 delete [] DataOut; 00284 00285 if(Last == 0) 00286 { 00287 DataOut = new char[32]; 00288 sprintf(DataOut, "%i %i %i", NBENTRY, Table, Base.GetNbData()); 00289 00290 Last = 1; 00291 } 00292 else if(Last <= Base.GetNbData()) 00293 { 00294 DataOut = new char[strlen(Base.GetData(Last - 1)) + 16]; 00295 sprintf(DataOut, "%i %i %s", DATA, Table, Base.GetData(Last - 1)); 00296 00297 Last++; 00298 } 00299 else TRY if(Last > Base.GetNbData()) 00300 { 00301 DataOut = new char[8]; 00302 sprintf(DataOut, "%i", OK); 00303 00304 Last = 0; 00305 } 00306 ENDTRY(13) 00307 } 00308 } 00309 } 00310 ENDTRY(16) 00311 00312 ENDBEGIN 00313 }
|
|
Définition à la ligne 348 du fichier NetServeurCom.cpp. 00349 { 00350 BEGIN 00351 00352 TRY if(Running == 1) 00353 { 00354 TRY if(gettok2(Buffer, 1, ":\n")) 00355 { 00356 delete [] Data; 00357 00358 Data = new char[strlen(gettok2(Buffer, 1, ":\n"))]; 00359 strcpy(Data, gettok2(Buffer, 1, ":\n")); 00360 } 00361 ENDTRY(13) 00362 } 00363 ENDTRY(16) 00364 00365 ENDBEGIN 00366 }
|
|
Définition à la ligne 332 du fichier NetServeurCom.cpp. 00333 { 00334 BEGIN 00335 00336 TRY if(Running == 1) 00337 { 00338 Id = 0; 00339 00340 if(isnumber(gettok2(Buffer, 2, " \n"))) 00341 Id = AtoD(gettok2(Buffer, 2, " \n")); 00342 } 00343 ENDTRY(16) 00344 00345 ENDBEGIN 00346 }
|
|
Définition à la ligne 315 du fichier NetServeurCom.cpp. 00316 { 00317 BEGIN 00318 00319 TRY if(Running == 1) 00320 { 00321 Table = 0; 00322 00323 TRY if(isnumber(gettok2(Buffer, 1, " \n"))) 00324 Table = AtoD(gettok2(Buffer, 1, " \n")); 00325 ENDTRY(13) 00326 } 00327 ENDTRY(16) 00328 00329 ENDBEGIN 00330 }
|
|
|
|
Définition à la ligne 31 du fichier NetServeurCom.cpp. 00032 { 00033 BEGIN 00034 00035 TRY if(Running == 0) 00036 Running = 1; 00037 ENDTRY(15) 00038 00039 if(CERROR) 00040 Stop(); 00041 00042 ENDBEGIN 00043 }
|
|
Définition à la ligne 45 du fichier NetServeurCom.cpp. 00046 { 00047 BEGIN 00048 00049 TRY if(Running == 1) 00050 { 00051 Running = 0; 00052 00053 Requette= 0; 00054 Table = 0; 00055 Id = 0; 00056 delete [] Data; 00057 delete [] DataOut; 00058 Last = 0; 00059 } 00060 ENDTRY(16) 00061 00062 ENDBEGIN 00063 }
|
|
|
|
|
|
Définition à la ligne 23 du fichier NetServeurCom.h. |
|
Définition à la ligne 35 du fichier NetServeurCom.h. |
|
Définition à la ligne 38 du fichier NetServeurCom.h. |
|
Définition à la ligne 32 du fichier NetServeurCom.h. |
|
Définition à la ligne 41 du fichier NetServeurCom.h. |
|
Définition à la ligne 26 du fichier NetServeurCom.h. |
|
Définition à la ligne 44 du fichier NetServeurCom.h. |
|
Définition à la ligne 29 du fichier NetServeurCom.h. |