calendarengines/versit2/src/ICalValue.cpp
changeset 51 0b38fc5b94c6
parent 0 f979ecb2b13e
child 89 b57382753122
equal deleted inserted replaced
46:ecd7b9840282 51:0b38fc5b94c6
    24 #include "calendarengines_debug.h"
    24 #include "calendarengines_debug.h"
    25 
    25 
    26 // User includes.
    26 // User includes.
    27 #include "ICalKeyWords.h"		// Literals
    27 #include "ICalKeyWords.h"		// Literals
    28 #include "ICalRuleSegment.h"	// CICalRuleSegment
    28 #include "ICalRuleSegment.h"	// CICalRuleSegment
       
    29 #include "CleanupPointerArray.h"	// For TCleanupPointerArray
    29 
    30 
    30 // Constants.
    31 // Constants.
    31 
    32 
    32 // Maximum number of characters to use for storing TInt.
    33 // Maximum number of characters to use for storing TInt.
    33 // (The maximum number of characters for storing a decimal representation of
    34 // (The maximum number of characters for storing a decimal representation of
   812 		// This means there is only one segment, pretend the semicolon exists at the end of the buffer
   813 		// This means there is only one segment, pretend the semicolon exists at the end of the buffer
   813 		nextSemiColon = iValue->Length();
   814 		nextSemiColon = iValue->Length();
   814 		}
   815 		}
   815 		
   816 		
   816 	TUint charNum(0);
   817 	TUint charNum(0);
   817 	
   818 	CleanupPointerArrayPushL(aRuleSegmentArray);
   818 	do
   819 	do
   819 		{
   820 		{
   820 		// Create a rule segment from characters charNum to nextSemiColon
   821 		// Create a rule segment from characters charNum to nextSemiColon
   821 		CICalRuleSegment* theRule = CICalRuleSegment::NewLC(iValue->Mid(charNum, nextSemiColon - charNum));
   822 		CICalRuleSegment* theRule = CICalRuleSegment::NewLC(iValue->Mid(charNum, nextSemiColon - charNum));
   822 		User::LeaveIfError(aRuleSegmentArray.Append(theRule));	// Takes ownership.
   823 		User::LeaveIfError(aRuleSegmentArray.Append(theRule));	// Takes ownership.
   845 				}
   846 				}
   846 			}
   847 			}
   847 		}
   848 		}
   848 	while (charNum < iValue->Length());
   849 	while (charNum < iValue->Length());
   849 	
   850 	
       
   851 	CleanupStack::Pop(&aRuleSegmentArray);
   850 	TRACE_EXIT_POINT;
   852 	TRACE_EXIT_POINT;
   851 	}
   853 	}
   852 
   854 
   853 /**
   855 /**
   854 Sets a complete RRULE as a descriptor value. Note that this is no different
   856 Sets a complete RRULE as a descriptor value. Note that this is no different