+ seekCount++;
+
+ }
+
+ if (dataFound == false){
+
+ finalNameValue.name = inputData;
+
+ }
+
+ // Check if the value has quotes at the start and end.
+ // Remove them if this is the case.
+
+ if (finalNameValue.value.front() == '\"' &&
+ finalNameValue.value.back() == '\"'){
+
+ finalNameValue.value.erase(0, 1);
+ finalNameValue.value.erase((finalNameValue.value.size() - 1), 1);
+
+ }
+
+ return finalNameValue;
+
+}
+
+bool HexToInt(std::string *hexString, int *number){
+
+ // Check that each character in the string is a number
+ // or a letter (a-f/A-F).
+
+ char charLetter = 0;
+ int charNum = 0;
+
+ for (int charSeek = 0;
+ charSeek < hexString->size(); charSeek++){
+
+ // Check if character is a number (0-9).
+
+ charLetter = hexString->at(charSeek);
+ charNum = charLetter;
+
+ if (charNum >= 48 &&
+ charNum <= 57){
+
+ continue;
+
+ }
+
+ // Check if character is a letter (A-F)
+
+ if (charNum >= 65 &&
+ charNum <= 70){
+
+ continue;
+
+ }
+
+ // Check if character is a letter (a-f).
+
+ if (charNum >= 97 &&
+ charNum <= 102){
+
+ continue;
+
+ }
+
+ // Exit from subroutine as character is invalid.
+
+ return false;
+
+ }
+
+ // Convert a Hex value that is in string to integer.
+
+ try {
+
+ *number = stoi((*hexString), nullptr, 16);
+
+ }
+
+ catch (const std::invalid_argument &err){
+
+ return false;
+
+ }
+
+ catch (const std::out_of_range &err){
+
+ return false;
+
+ }
+
+ return true;
+
+}
+
+bool IntToHex(int *number, std::string *hexString, int hexFill){
+
+ stringstream stringData;
+ stringData << setfill('0') << hex << setw(hexFill) << (*number);
+ (*hexString) = stringData.str();
+
+ return true;
+
+}
+
+void SplitPathFilename(string *calendarEntryHREF, string *entryURIPath,
+ string *entryFilename){
+
+ // Look for the last forward slash.
+
+ int lastForwardSlash = -1;
+ int charSeek = 0;
+ string stringIterChar = "";
+
+ for (string::iterator stringIter = calendarEntryHREF->begin();
+ stringIter != calendarEntryHREF->end(); stringIter++){
+
+ stringIterChar = *stringIter;
+
+ if (stringIterChar == "/"){
+ lastForwardSlash = charSeek;
+ }
+
+ charSeek++;
+
+ }
+
+ if (lastForwardSlash == -1){
+
+ return;