Main Page | Class Hierarchy | Class List | File List | Class Members

Utils.h

00001 // This is part of tacppd project (extended tacacs++ daemon)
00002 // (c) Copyright in 2000-2004 by tacppd team and contributors
00003 // see http://tacppd.org for more information
00004 //
00005 // file: Utils.h
00006 // description: set of some useful utilities
00007 
00008 //  This program is free software; you can redistribute it and/or modify
00009 //  it under the terms of the GNU General Public License as published by
00010 //  the Free Software Foundation; either version 2 of the License, or
00011 //  (at your option) any later version.
00012 //
00013 //  This program is distributed in the hope that it will be useful,
00014 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 //  GNU General Public License for more details.
00017 //
00018 //  You should have received a copy of the GNU General Public License
00019 //  along with this program; if not, write to the Free Software
00020 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 
00022 // modifications:
00023 //
00024 
00025 // all comments which start from /** - this is comments for KDoc */
00026 //  for classes
00027 //    @short [short description of the class]
00028 //    @author [class author]
00029 //    @version [class version]
00030 //    @see [references to other classes or methods]
00031 //  for methods
00032 //    @see [references]
00033 //    @return [sentence describing the return value]
00034 //    @exception [list the exeptions that could be thrown]
00035 //    @param [name id] [description]    - can be multiple
00036 
00037 #ifndef __UTILS_H__
00038 #define __UTILS_H__
00039 
00040 #include "global.h"
00041 
00042 namespace tacpp {
00043 
00044 namespace utl {
00045   bool scomp(const char*, const char*);
00048   bool scomp(const char*, const char*, int);
00051 //  string lower(const char*);
00054   string lower(const string);
00057 //  string upper(const char*);
00060   string upper(const string);
00063   char *newstr(char*);
00066 //  char *strip(char*);
00069   string time2iso(time_t);
00072   time_t iso2time(const char*);
00075   string time2sql(time_t);
00078   string h323time2iso(const char*);
00081   /*char *h323time2sql(const char*);*/
00084   time_t h323time2time(const char*);
00085   int get_digit(const char*);
00086   bool cron_parse(const char*,int);
00087   bool check_time(const char*);
00088   int getDigitFromIp(const char*,const int);
00089   bool isIp(const char*);
00092   void delstr(char*);
00095   bool match(const char*,const char*);
00096   bool matchNstrict(const char *b,const char *mask);
00099   bool isCorrespondW(const char * pDesc,const char * str);
00102   string vmatch(const char*,const char*);
00105   string splitId(const char*,const int);
00108   string split(const char*,const int);
00111   string getAvpName(const char*);
00114   string getAvpValue(const char*);
00117   string getAvpMod(const char*);
00120   //char *inssym(const char*,char,int);
00123   //char *delsym(const char*,int);
00126   string base64Encode(const char*);
00129   string base64Decode(const char*);
00132   string toString(int);
00135   string toString(unsigned int);
00138   string toString(unsigned long);
00141   string toString(float);
00144   string toString(double);
00147   string toString(time_t,int);
00150   string toSQL(string);
00153   string portConvert(const string);
00156   string sip(long unsigned int);    // show ip addr string from Bit32
00157 }; // utl
00158 
00159 }; // tacpp
00160 
00161 #endif // __UTILS_H__

Generated on Thu Jul 21 23:09:46 2005 for tacppd.kdevelop by doxygen 1.3.5