diff -r 000000000000 -r ba25891c3a9e installationservices/swi/source/sisfile/sistime.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/installationservices/swi/source/sisfile/sistime.cpp Thu Dec 17 08:51:10 2009 +0200 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definition of the Swi::Sis::CTime +* +*/ + + +/** + @file sistime.cpp +*/ + +#include "sistime.h" + +using namespace Swi::Sis; + +EXPORT_C /*static*/ CTime* CTime::NewLC(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) + { + CTime* self = new(ELeave) CTime(); + CleanupStack::PushL(self); + self->ConstructL(aDataProvider, aBytesRead, aTypeReadBehaviour); + return self; + } + +EXPORT_C /*static*/ CTime* CTime::NewL(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) + { + CTime* self = NewLC(aDataProvider, aBytesRead, aTypeReadBehaviour); + CleanupStack::Pop(self); + return self; + } + +EXPORT_C CTime* CTime::NewLC(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) + { + CTime* self = new(ELeave) CTime; + CleanupStack::PushL(self); + self->ConstructL(aDataProvider, aBytesRead, aTypeReadBehaviour); + return self; + } + +EXPORT_C CTime* CTime::NewL(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) + { + CTime* self = NewLC(aDataProvider, aBytesRead, aTypeReadBehaviour); + CleanupStack::Pop(self); + return self; + } + +CTime::CTime() + { + } + +EXPORT_C CTime::~CTime() + { + } + +void CTime::ConstructL(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) + { + TInt64 fieldOffset = aBytesRead; + + CField::ConstructL(aDataProvider, EFieldTypeTime, aBytesRead, aTypeReadBehaviour); + + CField::ReadTTypeL(aDataProvider, iHours, aBytesRead); + CField::ReadTTypeL(aDataProvider, iMinutes, aBytesRead); + CField::ReadTTypeL(aDataProvider, iSeconds, aBytesRead); + + CField::SkipUnknownFieldsL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour); + CField::EnsureAlignedL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour); + } + +void CTime::ConstructL(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) + { + TInt64 fieldOffset = aBytesRead; + + CField::ConstructL(aDataProvider, EFieldTypeTime, aBytesRead, aTypeReadBehaviour); + + CField::ReadTTypeL(aDataProvider, iHours, aBytesRead); + CField::ReadTTypeL(aDataProvider, iMinutes, aBytesRead); + CField::ReadTTypeL(aDataProvider, iSeconds, aBytesRead); + + CField::SkipUnknownFieldsL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour); + CField::EnsureAlignedL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour); + } +