X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Flibraries%2FCalendarDataStorage%2FCalendarDataStorage.cpp;h=4a690b21dfe8edb2409d276642647cb44d4cb352;hb=1fe6e43892e5c572949a293a9e19704b5debadad;hp=c18a85bdb23fa7b4875789fc89e20dee164c31dd;hpb=cba151c4b833a26c63984769f921bab5e755decd;p=xestiacalendar%2F.git diff --git a/source/libraries/CalendarDataStorage/CalendarDataStorage.cpp b/source/libraries/CalendarDataStorage/CalendarDataStorage.cpp index c18a85b..4a690b2 100644 --- a/source/libraries/CalendarDataStorage/CalendarDataStorage.cpp +++ b/source/libraries/CalendarDataStorage/CalendarDataStorage.cpp @@ -20,8 +20,6 @@ #define CDS_RANDOMPOW 24 -#include - using namespace std; static int callback(void *NotUsed, int argc, char **argv, char **azColName){ @@ -976,14 +974,14 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file // Start Date. - if (eventData.DateTimeStartData.size() < 16){ + if (eventData.dateTimeStartData.size() < 16){ addResult.addEventResult = CDSENTRY_INVALIDFILE; return addResult; } - eventString = eventData.DateTimeStartData.substr(0,4); + eventString = eventData.dateTimeStartData.substr(0,4); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -996,7 +994,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file } - eventString = eventData.DateTimeStartData.substr(4,2); + eventString = eventData.dateTimeStartData.substr(4,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1009,7 +1007,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file } - eventString = eventData.DateTimeStartData.substr(6,2); + eventString = eventData.dateTimeStartData.substr(6,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1022,7 +1020,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file } - eventString = eventData.DateTimeStartData.substr(9,2); + eventString = eventData.dateTimeStartData.substr(9,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1035,7 +1033,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file } - eventString = eventData.DateTimeStartData.substr(11,2); + eventString = eventData.dateTimeStartData.substr(11,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1048,7 +1046,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file } - eventString = eventData.DateTimeStartData.substr(13,2); + eventString = eventData.dateTimeStartData.substr(13,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1073,16 +1071,16 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file int eventEndSecond = 0; int eventEndDuration = 0; - if (eventData.DateTimeEndData != ""){ + if (eventData.dateTimeEndData != ""){ - if (eventData.DateTimeEndData.size() < 16){ + if (eventData.dateTimeEndData.size() < 16){ addResult.addEventResult = CDSENTRY_INVALIDFILE; return addResult; } - eventString = eventData.DateTimeEndData.substr(0,4); + eventString = eventData.dateTimeEndData.substr(0,4); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1095,7 +1093,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file } - eventString = eventData.DateTimeEndData.substr(4,2); + eventString = eventData.dateTimeEndData.substr(4,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1108,7 +1106,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file } - eventString = eventData.DateTimeEndData.substr(6,2); + eventString = eventData.dateTimeEndData.substr(6,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1121,7 +1119,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file } - eventString = eventData.DateTimeEndData.substr(9,2); + eventString = eventData.dateTimeEndData.substr(9,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1134,7 +1132,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file } - eventString = eventData.DateTimeEndData.substr(11,2); + eventString = eventData.dateTimeEndData.substr(11,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1147,7 +1145,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file } - eventString = eventData.DateTimeEndData.substr(13,2); + eventString = eventData.dateTimeEndData.substr(13,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1162,7 +1160,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file } - eventString = eventData.DurationData; + eventString = eventData.durationData; // Process the duration data. @@ -1174,22 +1172,22 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file // Get the duration (if DTEND hasn't been specified). - if (eventData.DurationData.size() > 0){ + if (eventData.durationData.size() > 0){ bool FoundP = false; bool FoundW = false; bool DateTimeMode = false; - std::string::iterator eventDataChar = eventData.DurationData.begin(); + std::string::iterator eventDataChar = eventData.durationData.begin(); std::string currentValue = ""; if (*eventDataChar != 'P'){ - eventDataChar = eventData.DurationData.end(); + eventDataChar = eventData.durationData.end(); } - for(eventDataChar; eventDataChar != eventData.DurationData.end(); eventDataChar++){ + for(eventDataChar; eventDataChar != eventData.durationData.end(); eventDataChar++){ // Check if value is a digit. @@ -1258,7 +1256,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file // Process Entry Name. - resultCode = sqlite3_bind_text(statementHandle, 2, eventData.SummaryData.c_str(), -1, SQLITE_STATIC); + resultCode = sqlite3_bind_text(statementHandle, 2, eventData.summaryData.c_str(), -1, SQLITE_STATIC); if (resultCode != 0){ addResult.addEventResult = CDSENTRY_FAILED; @@ -1270,7 +1268,7 @@ CDSAddEntryResult CalendarDataStorage::AddEvent(int calendarID, std::string file string eventDescription; try { - eventDescription = eventData.DescriptionList.at(0); + eventDescription = eventData.descriptionList.at(0); } catch (out_of_range &err){ @@ -1507,14 +1505,14 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil // Start Date. - if (eventData.DateTimeStartData.size() < 16){ + if (eventData.dateTimeStartData.size() < 16){ editResult.editEventResult = CDSENTRY_INVALIDFILE; return editResult; } - eventString = eventData.DateTimeStartData.substr(0,4); + eventString = eventData.dateTimeStartData.substr(0,4); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1527,7 +1525,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil } - eventString = eventData.DateTimeStartData.substr(4,2); + eventString = eventData.dateTimeStartData.substr(4,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1540,7 +1538,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil } - eventString = eventData.DateTimeStartData.substr(6,2); + eventString = eventData.dateTimeStartData.substr(6,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1553,7 +1551,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil } - eventString = eventData.DateTimeStartData.substr(9,2); + eventString = eventData.dateTimeStartData.substr(9,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1566,7 +1564,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil } - eventString = eventData.DateTimeStartData.substr(11,2); + eventString = eventData.dateTimeStartData.substr(11,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1579,7 +1577,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil } - eventString = eventData.DateTimeStartData.substr(13,2); + eventString = eventData.dateTimeStartData.substr(13,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1604,16 +1602,16 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil int eventEndSecond = 0; int eventEndDuration = 0; - if (eventData.DateTimeEndData != ""){ + if (eventData.dateTimeEndData != ""){ - if (eventData.DateTimeEndData.size() < 16){ + if (eventData.dateTimeEndData.size() < 16){ editResult.editEventResult = CDSENTRY_INVALIDFILE; return editResult; } - eventString = eventData.DateTimeEndData.substr(0,4); + eventString = eventData.dateTimeEndData.substr(0,4); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1626,7 +1624,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil } - eventString = eventData.DateTimeEndData.substr(4,2); + eventString = eventData.dateTimeEndData.substr(4,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1639,7 +1637,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil } - eventString = eventData.DateTimeEndData.substr(6,2); + eventString = eventData.dateTimeEndData.substr(6,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1652,7 +1650,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil } - eventString = eventData.DateTimeEndData.substr(9,2); + eventString = eventData.dateTimeEndData.substr(9,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1665,7 +1663,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil } - eventString = eventData.DateTimeEndData.substr(11,2); + eventString = eventData.dateTimeEndData.substr(11,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1678,7 +1676,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil } - eventString = eventData.DateTimeEndData.substr(13,2); + eventString = eventData.dateTimeEndData.substr(13,2); if (all_of(eventString.begin(), eventString.end(), ::isdigit)){ @@ -1693,7 +1691,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil } - eventString = eventData.DurationData; + eventString = eventData.durationData; // Process the duration data. @@ -1705,22 +1703,22 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil // Get the duration (if DTEND hasn't been specified). - if (eventData.DurationData.size() > 0){ + if (eventData.durationData.size() > 0){ bool FoundP = false; bool FoundW = false; bool DateTimeMode = false; - std::string::iterator eventDataChar = eventData.DurationData.begin(); + std::string::iterator eventDataChar = eventData.durationData.begin(); std::string currentValue = ""; if (*eventDataChar != 'P'){ - eventDataChar = eventData.DurationData.end(); + eventDataChar = eventData.durationData.end(); } - for(eventDataChar; eventDataChar != eventData.DurationData.end(); eventDataChar++){ + for(eventDataChar; eventDataChar != eventData.durationData.end(); eventDataChar++){ // Check if value is a digit. @@ -1787,7 +1785,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil // Process Entry Name. - resultCode = sqlite3_bind_text(statementHandle, 2, eventData.SummaryData.c_str(), -1, SQLITE_STATIC); + resultCode = sqlite3_bind_text(statementHandle, 2, eventData.summaryData.c_str(), -1, SQLITE_STATIC); if (resultCode != 0){ editResult.editEventResult = CDSENTRY_FAILED; @@ -1799,7 +1797,7 @@ CDSEditEntryResult CalendarDataStorage::UpdateEvent(int eventID, std::string fil string eventDescription; try { - eventDescription = eventData.DescriptionList.at(0); + eventDescription = eventData.descriptionList.at(0); } catch (out_of_range &err){