tools.h

Go to the documentation of this file.
00001 /*
00002 #########################################################################
00003 #
00004 #  This file is part of trustyRC.
00005 #
00006 #  trustyRC, fully modular IRC robot 
00007 #  Copyright (C) 2006-2008 Nicoleau Fabien 
00008 #
00009 #  trustyRC is free software: you can redistribute it and/or modify
00010 #  it under the terms of the GNU General Public License as published by
00011 #  the Free Software Foundation, either version 3 of the License, or
00012 #  (at your option) any later version.
00013 #
00014 #  trustyRC is distributed in the hope that it will be useful,
00015 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 #  GNU General Public License for more details.
00018 #
00019 #  You should have received a copy of the GNU General Public License
00020 #  along with trustyRC.  If not, see <http://www.gnu.org/licenses/>.
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

Generated on Sun Aug 16 15:28:29 2009 for trustyRC by  doxygen 1.5.8