00001 #ifndef __UTILITY_H__
00002 #define __UTILITY_H__
00003
00004
00005 #include <string>
00006 #include <vector>
00007 #include "Common.h"
00008 extern "C" {
00009 #include <libical/ical.h>
00010 }
00011
00012 class CProperties;
00013
00014 class CUtility{
00015 public:
00016
00017
00018 time_t getDateFromTime(time_t startDate);
00022 vector <string> parseIds(string szIds);
00023
00024
00025
00026 bool isEncodingRequired(string szInput, bool syncing);
00027
00028
00029 bool stringReplaceOne(string &toChange, const char *changeThis,
00030 const char *toThis);
00031
00032
00033
00034 string encodeQuotedPrintable(string szInput);
00035
00036 void releasePropertiesVector(std::vector <CProperties*> vec);
00037 std::vector < time_t > getRecurrentTimes(std::string szRRule,
00038 icaltimetype iDtStart,
00039 time_t iViewEnd,
00040 icaltimezone *pTz,
00041 int& pErrorCode);
00042 icaltimezone* getSystemTimeZoneAsIcalTimeZone();
00043 std::string getSystemTimeZone();
00044 string getApplicationName();
00045 void setApplicationName(string ApplicationName);
00046
00047 CUtility();
00048 ~CUtility();
00049 static CUtility *Instance();
00050
00051
00052 private :
00053
00054 string AppName;
00055 static CUtility *pUt;
00056 };
00057
00058 #endif