--- /dev/null
+#include "CalendarFreeBusy.h"
+
+using namespace std;
+
+CalendarObjectValidResult CalendarFreeBusyObject::ValidObject(){
+
+ bool ValidBegin = false;
+ bool ValidEnd = false;
+ bool ValidDateTimeStamp = false;
+ bool ValidUniqueID = false;
+ bool ValidDateTimeStart = false;
+ int SeekCount = 0;
+ string PropertyName;
+
+ // Look for BEGIN:VFREEBUSY.
+
+ for (vector<string>::iterator iter = ObjectName.begin();
+ iter != ObjectName.end(); iter++){
+
+ if (ObjectName[SeekCount] == "BEGIN" &&
+ ObjectData[SeekCount] == "VFREEBUSY"){
+
+ if (ValidBegin == false){
+ ValidBegin = true;
+ } else {
+ return CALENDAROBJECTVALID_INVALIDFORMAT;
+ }
+
+ }
+
+ if (ObjectName[SeekCount] == "END" &&
+ ObjectData[SeekCount] == "VFREEBUSY" &&
+ ValidBegin == false){
+
+ return CALENDAROBJECTVALID_INVALIDFORMAT;
+
+ }
+
+ SeekCount++;
+
+ }
+
+ SeekCount = 0;
+
+ // Look for DTSTAMP.
+
+ for (vector<string>::iterator iter = ObjectName.begin();
+ iter != ObjectName.end(); iter++){
+
+ try{
+ PropertyName = ObjectName[SeekCount].substr(0,7);
+ }
+
+ catch(const out_of_range& oor){
+ continue;
+ }
+
+ if (PropertyName == "DTSTAMP"){
+
+ if (ValidDateTimeStamp == false){
+ ValidDateTimeStamp = true;
+ } else {
+ return CALENDAROBJECTVALID_INVALIDFORMAT;
+ }
+
+ }
+
+ SeekCount++;
+
+ }
+
+ SeekCount = 0;
+
+ // Look for UID.
+
+ for (vector<string>::iterator iter = ObjectName.begin();
+ iter != ObjectName.end(); iter++){
+
+ try{
+ PropertyName = ObjectName[SeekCount].substr(0,3);
+ }
+
+ catch(const out_of_range& oor){
+ continue;
+ }
+
+ if (PropertyName == "UID"){
+
+ if (ValidUniqueID == false){
+ ValidUniqueID = true;
+ } else {
+ return CALENDAROBJECTVALID_INVALIDFORMAT;
+ }
+
+ }
+
+ SeekCount++;
+
+ }
+
+ SeekCount = 0;
+
+ // Look for END:VFREEBUSY.
+
+ for (vector<string>::iterator iter = ObjectName.begin();
+ iter != ObjectName.end(); iter++){
+
+ if (ObjectName[SeekCount] == "END" &&
+ ObjectData[SeekCount] == "VFREEBUSY"){
+
+ if (ValidEnd == false){
+ ValidEnd = true;
+ } else {
+ return CALENDAROBJECTVALID_INVALIDFORMAT;
+ }
+
+ }
+
+ SeekCount++;
+
+ }
+
+ // Check if the VEVENT is valid.
+
+ if (ValidBegin == true &&
+ ValidEnd == true &&
+ ValidDateTimeStamp == true &&
+ ValidUniqueID == true){
+
+ return CALENDAROBJECTVALID_OK;
+
+ } else {
+
+ return CALENDAROBJECTVALID_INVALIDFORMAT;
+
+ }
+
+}
+
+void CalendarFreeBusyObject::ProcessData(){
+
+ // Process the data.
+
+ multimap<string,string> DataReceived;
+ map<string,string> PropertyData;
+ string *PropertyNameData = nullptr;
+ int ObjectSeekCount = 0;
+
+}
\ No newline at end of file