#include <string.h>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
Aller au code source de ce fichier.
Macros | |
| #define | TOOL_BUFFER 1024 |
| #define | TOOL_CONV 16 |
Fonctions | |
| char * | gettok (const char *pData, unsigned int iPos, const char *pCar) |
| Retourne un mots d'une phrase. | |
| char * | ItoA (int iNbr) |
| Convertie un nombre en carracteres. | |
| int | AtoI (const char *pNbr) |
| Convertie une chaine de carracteres en un nombre. | |
| char * | FtoA (float fNbr) |
| Convertie un nombre flotant en carracteres. | |
| float | AtoF (const char *pNbr) |
| Convertie une chaine de carracteres en un nombre flotant. | |
| unsigned int | IsUInt (const char *pBuf) |
| Vérifie si une chaine de carracteres est un nombre. | |
| unsigned int | IsAlphaNum (const char *pBuf) |
| Vérifie si une chaine de carracteres est alphanumérique. | |
| unsigned int | IsAlphaNumCar (char cCar) |
| Vérifie si un carractere est alphanumérique. | |
| unsigned int | IsIn (char cCar, const char *pBuf) |
| Vérifie si un carractére se trouve dans une chaine. | |
| unsigned int | Replace (char cCar, char cNew, char *pBuf) |
| Remplace des carractéres se trouvant dans une chaine. | |
| char * | Strstr (const char *pFind, const char *pBuf) |
| Recherche une chaine dans une chaine. | |
Définition dans le fichier Tools.h.
|
|
taille du buffer utiliser pour le parsage |
|
|
taille du buffer utiliser pour les conversions |
|
|
Convertie une chaine de carracteres ASCII en un nombre flotant signer.
Définition à la ligne 72 du fichier Tools.cpp. 00073 {
00074 return atof(pNbr);
00075 }
|
|
|
Convertie une chaine de carracteres ASCII en un nombre décimal signer.
Définition à la ligne 58 du fichier Tools.cpp. Référencé par ModuleDynamiqueModule::Load(). 00059 {
00060 return atoi(pNbr);
00061 }
|
|
|
Convertie un nombre flotant signer en carracteres ASCII.
Définition à la ligne 63 du fichier Tools.cpp. Références TOOL_CONV. 00064 {
00065 static char buffer[TOOL_CONV];
00066
00067 snprintf(buffer, TOOL_CONV, "%f", fNbr);
00068
00069 return buffer;
00070 }
|
|
||||||||||||||||
|
Retourne le mots à la position Pos dans une phrase pData avec comme carracteres entre les mots pCar.
Définition à la ligne 14 du fichier Tools.cpp. Référencé par Error::SetLangue(). 00015 {
00016 static char Data[TOOL_BUFFER];
00017 unsigned int c = 0, n = 0, l = 0;
00018 const char *ppCar;
00019
00020 while(*pData && (n <= iPos))
00021 {
00022 ppCar = pCar;
00023 while(*ppCar && (*ppCar != *pData))
00024 ppCar++;
00025
00026 if(*ppCar)
00027 {
00028 if(!l)
00029 {
00030 l = 1;
00031 n++;
00032 }
00033 }
00034 else
00035 {
00036 l = 0;
00037 if(iPos == n)
00038 Data[c++] = *pData;
00039 }
00040
00041 pData++;
00042 }
00043
00044 Data[c] = 0;
00045
00046 return Data;
00047 }
|
|
|
Vérifie si une chaine de carracteres ASCII est une uniquement alphanumérique.
Définition à la ligne 88 du fichier Tools.cpp. Référencé par Ini::Load(). 00089 {
00090 unsigned int i;
00091
00092 if(!(*pBuf))
00093 return 0;
00094
00095 for(i = 0; pBuf[i]; i++)
00096 {
00097 if((pBuf[i] < 'a') || (pBuf[i] > 'z'))
00098 if((pBuf[i] < 'A') || (pBuf[i] > 'Z'))
00099 if((pBuf[i] < '0') || (pBuf[i] > '9'))
00100 return 0;
00101 }
00102
00103 return 1;
00104 }
|
|
|
Vérifie si un carractere ASCII est une uniquement alphanumérique.
Définition à la ligne 106 du fichier Tools.cpp. Référencé par Parser< T >::Parse(). 00107 {
00108 if(!cCar)
00109 return 0;
00110
00111 if((cCar < 'a') || (cCar > 'z'))
00112 if((cCar < 'A') || (cCar > 'Z'))
00113 if((cCar < '0') || (cCar > '9'))
00114 return 0;
00115
00116 return 1;
00117 }
|
|
||||||||||||
|
Vérifie si le carractére cCar se trouve dans la chaine pBuf.
Définition à la ligne 119 du fichier Tools.cpp. 00120 {
00121 unsigned int i;
00122
00123 for(i = 0; pBuf[i]; i++)
00124 if(cCar == pBuf[i])
00125 return 1;
00126
00127 return 0;
00128 }
|
|
|
Vérifie si une chaine de carracteres ASCII est un nombre décimal non signer et entier.
Définition à la ligne 77 du fichier Tools.cpp. 00078 {
00079 unsigned int i;
00080
00081 for(i = 0; pBuf[i]; i++)
00082 if((pBuf[i] < '0') || (pBuf[i] > '9'))
00083 return 0;
00084
00085 return 1;
00086 }
|
|
|
Convertie un nombre décimal signer en carracteres ASCII.
Définition à la ligne 49 du fichier Tools.cpp. Références TOOL_CONV. Référencé par NetServer::WaitClient(). 00050 {
00051 static char buffer[TOOL_CONV];
00052
00053 snprintf(buffer, TOOL_CONV, "%d", iNbr);
00054
00055 return buffer;
00056 }
|
|
||||||||||||||||
|
Remplace tous les carractéres cCar par le carractére cNew se trouve dans la chaine pBuf.
Définition à la ligne 130 du fichier Tools.cpp. 00131 {
00132 unsigned int j = 0, i;
00133
00134 for(i = 0; pBuf[i]; i++)
00135 {
00136 if(cCar == pBuf[i])
00137 {
00138 pBuf[i] = cNew;
00139 j++;
00140 }
00141 }
00142
00143 return i;
00144 }
|
|
||||||||||||
|
Recherche la chaine pFind dans la chaine pBuf.
|
1.3.9.1