00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __VCALCONVERTER_H__
00025 #define __VCALCONVERTER_H__
00026
00027 #include "Common.h"
00028 #include "ICalConverter.h"
00029 #include <vector>
00030 #include <string>
00031 using namespace std;
00032 extern "C" {
00033 #include <libical/ical.h>
00034 #include <libical/icalcomponent.h>
00035 #include <libical/icalenums.h>
00036 #include "stdlib.h"
00037 #include "stdio.h"
00038 }
00039
00040 using std::string;
00046 class VCalConverter
00047 {
00048 public:
00052 VCalConverter();
00056 ~VCalConverter();
00057
00064 FileType checkContentsType(string szContents);
00065
00073 string vCalToICalRule(string vcal);
00074
00082 string iCalToVCalRule(string ical, time_t startTime);
00083
00091 string vCalToICalDate(string vcal);
00092
00100 string iCalToVCalDate(string ical);
00108 string vCalToICalAlarm(string vCalAlarm);
00116 string iCalToVCalAlarm(string iCalAlarm);
00123 vector<string> getTokens(string str, string delimiter);
00124
00132 string getTranspFromVcal(string szContents);
00133
00141 icaltimetype getCreatedTimeFromVcal(string szContents);
00142
00150 int getStatusFromVcal(string szContents);
00158 icalproperty* getVcalTransp(string szTransp);
00166 string getVcalStatus(statusParam iStatus);
00174 int getParticipationRoleFromVcal(string szAtten);
00182 string getVcalPartRole(int iRole);
00191 string getVcalCreatedTime(string szTime,string szContents);
00199 icalparameter* getVcalRSVP(bool fRSVP);
00207 bool getRSVPFromVcal(string szContents);
00208
00209 private:
00219 void Tokenize(const string & str,
00220 vector <string> &tokens,
00221 string delimiters = " ");
00230 string getNoDelimiterString(string str, string delimiters, string repStr);
00231
00237 void initRecurrenceItem(RecurrenceItem* item);
00238
00246 int getDay(string vcal, bool opFlag);
00247
00254 string getByMonthFromVcal(string vcal);
00255
00262 string getByDayFromVcal(string vcal);
00263
00270 string getDurationFromVcal(string vcal);
00271
00279 string getFrequency(vector<string> tokens, int index);
00280
00288 string getInterval(vector<string> tokens, int index);
00289
00297 string getCount(vector<string> tokens, int index);
00298
00306 string getUntil(vector<string> tokens, int index);
00307
00315 string getByDayFromIcal(vector<string> tokens, int index);
00316
00324 string getByMonthFromIcal(vector<string> tokens, int index);
00325
00332 time_t tzStringTogmtime(string strIcalComp);
00333
00341 string gmttimeToTZString(time_t tTime, bool onlyDate);
00342
00350 string getVCalDate(vector<string> tokens, int index, int type);
00351
00358 string getAudioAlarm(string alarm);
00359 };
00360 #endif