/**
Removes no dir markers from source text.
*/
void CResourceLoader::RemoveNoDirMarkers(TDes& aText)
    {
    TInt nextkey(0);
    while (nextkey < aText.Length())
        {
        nextkey = aText.Locate(KDirNotFound);
        if (nextkey != KErrNotFound)
            {
            aText.Delete(nextkey, 1);
            nextkey++;    
            }
        else
            {
            break;
            }     
        }
    }
Ejemplo n.º 2
0
// This function is used to update month and day in aBufLocalTime
// to actual month and day to be passed to TTime() constructor.
// Remember using TTime::FormatL() in thelpers.cpp 
// has added extra month and a day to aBufLocalTime.
// aBufLocalTime is in format YYMMDD:HHMMSS.MMMMMM
// see TTime::Set() for aBufLocalTime expected format details.
TInt UpdateToActualMonthAndDay(TDes& aBufUTCTime)
	{	
	TInt mVal 	= 0;
	TInt dVal 	= 0;
	
	TBuf <4> tempBuf;
	_LIT(KFormat, "%02d");
	
	//Get the position of colon separator	
	TInt colon 	= aBufUTCTime.Locate(':');
		
	// Get Month & Day if Present	
	switch(colon)
		{
		case 0: break;
		case 8:
			{
			TLex month 	= aBufUTCTime.Mid(4,2);
			TLex day 	= aBufUTCTime.Mid(6,2);
			month.Val(mVal);
			day.Val(dVal);			
			}
			break;
		default:
			{
			// If the colon is at the wrong position
			return (KErrArgument);
			}
				
		}
		
		// Deduct extra month and a day and update aBufLocalTime
		if(mVal > 0 && dVal > 0)
			{
			mVal-=1;
			dVal-=1;
				
			tempBuf.Format(KFormat, mVal);
			aBufUTCTime.Replace(4,2, tempBuf);
				
			tempBuf.Format(KFormat, dVal);
			aBufUTCTime.Replace(6,2, tempBuf);				
			}
			
		return(KErrNone);		
	}