tools.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
00029 #ifndef TOOLS_H
00030 #define TOOLS_H
00031 #include <time.h>
00032 #include <sstream>
00033 #include <fstream>
00034 #include <vector>
00035 #include <string>
00036 #include <stdlib.h>
00037 #include <fnmatch.h>
00038 using namespace std;
00039
00047 class Tools
00048 {
00049 public :
00051 Tools();
00053 ~Tools();
00055 static string asciiToHexa(string);
00057 static string hexaToAscii(string);
00059 static string intToStr(int);
00061 static string doubleToStr(double);
00063 static double strToDouble(string);
00065 static int strToInt(string);
00067 static unsigned int strToUnsignedInt(string);
00069 static unsigned int strtimeToSeconds(string);
00071 static string to_lower(string);
00073 static string to_upper(string);
00075 static int random(int min,int max);
00077 static string vectorToString(vector<string>,string,unsigned int start = 0);
00079 static vector<string> stringToVector(string,string,unsigned int start = 0);
00081 static vector<string> gatherVectorElements(vector<string>,string,unsigned int);
00083 static string escapeChar(string,char);
00085 static void log(string,string,bool timestamp=true,bool truncate=false);
00087 static string urlencode (string);
00089 static string clearAccents(string);
00091 static string cleanHTML(string);
00093 static bool isInVector(vector<string>,string);
00095 static void delStrFromVector(vector<string>*,string);
00097 static string parseQ3Colors(string);
00099 static bool ircMaskMatch(string,string);
00101 static int masksMatch(char*,char*);
00103 static bool copyFile(string,string);
00104 };
00105
00106 #endif