installationservices/swi/source/sisfile/sislogo.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * Definition of the Swi::Sis::CLogo
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file sislogo.cpp
       
    22 */
       
    23 
       
    24 #include "sislogo.h"
       
    25 #include "sisfiledescription.h"
       
    26 
       
    27 using namespace Swi::Sis;
       
    28 
       
    29 EXPORT_C /*static*/ CLogo* CLogo::NewLC(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour)
       
    30 	{
       
    31 	CLogo* self = new(ELeave) CLogo();
       
    32 	CleanupStack::PushL(self);
       
    33 	self->ConstructL(aDataProvider, aBytesRead, aTypeReadBehaviour);
       
    34 	return self;
       
    35 	}
       
    36 
       
    37 EXPORT_C /*static*/ CLogo* CLogo::NewL(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour)
       
    38 	{
       
    39 	CLogo* self = NewLC(aDataProvider, aBytesRead, aTypeReadBehaviour);
       
    40 	CleanupStack::Pop(self);
       
    41 	return self;
       
    42 	}
       
    43 	
       
    44 EXPORT_C CLogo* CLogo::NewLC(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour)
       
    45 	{
       
    46 	CLogo* self = new (ELeave) CLogo;
       
    47 	CleanupStack::PushL(self);
       
    48 	self->ConstructL(aDataProvider, aBytesRead, aTypeReadBehaviour);
       
    49 	return self;
       
    50 	}
       
    51 
       
    52 EXPORT_C CLogo* CLogo::NewL(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour)
       
    53 	{
       
    54 	CLogo* self = CLogo::NewLC(aDataProvider, aBytesRead, aTypeReadBehaviour);
       
    55 	CleanupStack::Pop(self);
       
    56 	return self;
       
    57 	}
       
    58 
       
    59 CLogo::CLogo()
       
    60 	{
       
    61 	}
       
    62 
       
    63 EXPORT_C CLogo::~CLogo()
       
    64 	{
       
    65 	delete iFileDescription;
       
    66 	}
       
    67 
       
    68 void CLogo::ConstructL(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour)
       
    69 	{
       
    70 	TInt64 fieldOffset = aBytesRead;
       
    71 	
       
    72 	CField::ConstructL(aDataProvider, EFieldTypeLogo, aBytesRead, aTypeReadBehaviour);
       
    73 
       
    74 	iFileDescription=CFileDescription::NewL(aDataProvider, aBytesRead);
       
    75 	
       
    76 	CField::SkipUnknownFieldsL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour);
       
    77 	CField::EnsureAlignedL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour);
       
    78 	}
       
    79 	
       
    80 void CLogo::ConstructL(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour)
       
    81 	{
       
    82 	TInt64 fieldOffset = aBytesRead;
       
    83 	
       
    84 	CField::ConstructL(aDataProvider, EFieldTypeLogo, aBytesRead, aTypeReadBehaviour);
       
    85 
       
    86 	iFileDescription=CFileDescription::NewL(aDataProvider, aBytesRead);
       
    87 	
       
    88 	CField::SkipUnknownFieldsL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour);
       
    89 	CField::EnsureAlignedL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour);
       
    90 	}
       
    91