00001 #ifndef _GlobalFuncs_h
00002 #define _GlobalFuncs_h
00003
00004 #include <time.h>
00005 #include <stdio.h>
00006
00007 #include <string>
00008 #include <algorithm>
00009 #include <ctype.h>
00010
00011 using std::string;
00012 using std::transform;
00013
00015 static void GetCurrentDate(char *cDay, char *cMonth, char *cYear)
00016 {
00017 time_t rawtime;
00018 struct tm* timeinfo;
00019
00020 time(&rawtime);
00021 timeinfo = localtime(&rawtime);
00022 int iday = timeinfo->tm_mday;
00023 int imonth = timeinfo->tm_mon + 1;
00024
00025
00026
00027
00028 if( iday < 10 )
00029 sprintf(cDay, "0%i",iday);
00030 else
00031 sprintf(cDay, "%i",iday);
00032
00033 if(imonth < 10)
00034 sprintf(cMonth, "0%i",imonth);
00035 else
00036 sprintf(cMonth, "%i",imonth);
00037
00038
00039 sprintf(cYear, "%i",timeinfo->tm_year + 1900);
00040 }
00041
00042
00043 static void UpperCase(string &rstr)
00044 {
00045 transform(rstr.begin(), rstr.end(),
00046 rstr.begin(),
00047 toupper);
00048 }
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 #endif // _GlobalFuncs_h