22 body +=
"BEGIN:VCALENDAR\n";
23 body +=
"VERSION:2.0\n";
24 body +=
"PRODID:-//"+name+
"//"+motif+
"/\n";
32 return "END:VCALENDAR\n\n";
41 std::stringstream timeStr;
42 timeStr << date.
getYear() << std::setfill(
'0') << std::setw(2) << date.
getMonth() << std::setfill(
'0') << std::setw(2) << date.
getDay();
43 timeStr <<
"T" << std::setfill(
'0') << std::setw(2) << texTime.
getHour() << std::setfill(
'0') << std::setw(2) << texTime.
getMinute() <<
"00";
51 time_t timestamp = time(NULL);
52 struct tm * currentDate = localtime(×tamp);
53 std::stringstream timeStr;
54 timeStr << (currentDate->tm_year + 1900) << std::setfill(
'0') << std::setw(2) << (currentDate->tm_mon + 1) << std::setfill(
'0') << std::setw(2) << currentDate->tm_mday;
55 timeStr <<
"T" << std::setfill(
'0') << std::setw(2) << (currentDate->tm_hour - currentDate->tm_gmtoff/3600) << std::setfill(
'0') << std::setw(2) << currentDate->tm_min <<
"00";
67 body +=
"BEGIN:VEVENT\n";
68 body +=
"CLASS:PUBLIC\n";
69 body +=
"DTSTAMP:"+currentTimeStamp+
"\n";
71 std::stringstream uidStr;
72 uidStr << std::setfill(
'0') << std::setw(4) << counter;
74 body +=
"UID:TH8WMR_PNR"+uidStr.str()+
"_"+currentTimeStamp+
"\n";
83 body +=
"BEGIN:VALARM\n";
84 body +=
"TRIGGER:-PT10M\n";
85 body +=
"ACTION:DISPLAY\n";
86 body +=
"DESCRIPTION:Reminder\n";
87 body +=
"END:VALARM\n";
88 body +=
"END:VEVENT\n";
99 const std::map<PString, PTimeTableBlock> & mapBlock = day.
mapBlock;
100 for(std::map<PString, PTimeTableBlock>::const_iterator it(mapBlock.begin()); it != mapBlock.end(); ++it){
113 const std::map<PString, TexDay> & mapDay = week.
mapDay;
114 for(std::map<PString, TexDay>::const_iterator it(mapDay.begin()); it != mapDay.end(); ++it){
127 const std::vector<TexWeek> & vecWeek = texTimeTable.
vecWeek;
128 for(std::vector<TexWeek>::const_iterator it(vecWeek.begin()); it != vecWeek.end(); ++it){
144 const std::vector<TexWeek> & vecWeek = timetable.
vecWeek;
145 for(std::vector<TexWeek>::const_iterator itWeek(vecWeek.begin()); itWeek != vecWeek.end(); ++itWeek){
146 const std::map<PString, TexDay> & mapDay = itWeek->mapDay;
147 for(std::map<PString, TexDay>::const_iterator itDay(mapDay.begin()); itDay != mapDay.end(); ++itDay){
148 const std::map<PString, PTimeTableBlock> & mapBlock = itDay->second.mapBlock;
149 for(std::map<PString, PTimeTableBlock>::const_iterator it(mapBlock.begin()); it != mapBlock.end(); ++it){
150 if(it->second.getInvitation() !=
""){
155 if(itDay->second.invitation !=
""){
160 if(itWeek->invitation !=
""){
182 const std::vector<TexWeek> & vecWeek = timetable.
vecWeek;
183 for(std::vector<TexWeek>::const_iterator itWeek(vecWeek.begin()); itWeek != vecWeek.end(); ++itWeek){
184 const std::map<PString, TexDay> & mapDay = itWeek->mapDay;
185 for(std::map<PString, TexDay>::const_iterator itDay(mapDay.begin()); itDay != mapDay.end(); ++itDay){
186 if(itDay->second.invitation !=
""){
191 if(itWeek->invitation !=
""){
208 const std::vector<TexWeek> & vecWeek = timetable.
vecWeek;
209 for(std::vector<TexWeek>::const_iterator itWeek(vecWeek.begin()); itWeek != vecWeek.end(); ++itWeek){
210 const std::map<PString, TexDay> & mapDay = itWeek->mapDay;
211 for(std::map<PString, TexDay>::const_iterator itDay(mapDay.begin()); itDay != mapDay.end(); ++itDay){
212 const std::map<PString, PTimeTableBlock> & mapBlock = itDay->second.mapBlock;
213 for(std::map<PString, PTimeTableBlock>::const_iterator it(mapBlock.begin()); it != mapBlock.end(); ++it){
214 if(it->second.getInvitation() !=
""){
215 mapInviteVecBlock[it->second.getInvitation()].push_back(it->second);
231 const std::map<
PString, std::vector<PTimeTableBlock> > & mapInviteVecBlock,
235 for(std::map<
PString, std::vector<PTimeTableBlock> >::const_iterator itInvite(mapInviteVecBlock.begin()); itInvite != mapInviteVecBlock.end(); ++itInvite){
237 const std::vector<PTimeTableBlock> & vecBlock = itInvite->second;
238 for(std::vector<PTimeTableBlock>::const_iterator it(vecBlock.begin()); it != vecBlock.end(); ++it){
241 fullInvitation += eevt;
242 PPath outputFile(outputDirectory +
PPath(
"/") + itInvite->first +
PPath(
".ics"));
254 std::map<PString, std::vector<PTimeTableBlock>> mapInviteVecBlock;
size_t getMonth() const
Gets the month of the PLatexDate.
size_t getYear() const
Gets the year of the PLatexDate.
size_t getDay() const
Gets the day of the PLatexDate.
size_t getMinute() const
Gets the minute of the PLatexTime.
size_t getHour() const
Gets the hour of the PLatexTime.
Path of a directory or a file.
bool saveFileContent(const PString &content) const
Save a PString in a file.
bool createDirectory(mode_t mode=0755) const
Create the current directory.
PString platexobj_rawtext(const std::vector< PLatexObj > &vecObj)
Convert a PLatexObj in text.
std::map< PString, PTimeTableBlock > mapBlock
Map of the block of a day (time format hour:minute)
PString invitation
Invitation of the full event.
std::vector< TexWeek > vecWeek
Vector of week.
std::map< PString, TexDay > mapDay
Map of hte day in the week (date format: year-month-day)