|
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::CProperties |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file sisproperties.cpp |
|
22 */ |
|
23 |
|
24 #include "sisproperties.h" |
|
25 #include "sissupportedoption.h" |
|
26 #include "sisproperty.h" |
|
27 |
|
28 using namespace Swi::Sis; |
|
29 |
|
30 |
|
31 EXPORT_C /*static*/ CProperties* CProperties::NewLC(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) |
|
32 { |
|
33 CProperties* self = new(ELeave) CProperties(); |
|
34 CleanupStack::PushL(self); |
|
35 self->ConstructL(aDataProvider, aBytesRead, aTypeReadBehaviour); |
|
36 return self; |
|
37 } |
|
38 |
|
39 EXPORT_C /*static*/ CProperties* CProperties::NewL(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) |
|
40 { |
|
41 CProperties* self = NewLC(aDataProvider, aBytesRead, aTypeReadBehaviour); |
|
42 CleanupStack::Pop(self); |
|
43 return self; |
|
44 } |
|
45 |
|
46 EXPORT_C CProperties* CProperties::NewLC(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) |
|
47 { |
|
48 CProperties* self = new (ELeave) CProperties; |
|
49 CleanupStack::PushL(self); |
|
50 self->ConstructL(aDataProvider, aBytesRead, aTypeReadBehaviour); |
|
51 return self; |
|
52 } |
|
53 |
|
54 EXPORT_C CProperties* CProperties::NewL(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) |
|
55 { |
|
56 CProperties* self = CProperties::NewLC(aDataProvider, aBytesRead, aTypeReadBehaviour); |
|
57 CleanupStack::Pop(self); |
|
58 return self; |
|
59 } |
|
60 |
|
61 CProperties::CProperties() |
|
62 { |
|
63 } |
|
64 |
|
65 EXPORT_C CProperties::~CProperties() |
|
66 { |
|
67 iProperties.ResetAndDestroy(); |
|
68 } |
|
69 |
|
70 void CProperties::ConstructL(MSisDataProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) |
|
71 { |
|
72 TInt64 fieldOffset = aBytesRead; |
|
73 |
|
74 CField::ConstructL(aDataProvider, EFieldTypeProperties, aBytesRead, aTypeReadBehaviour); |
|
75 |
|
76 ReadMemberArrayL(aDataProvider, iProperties, EFieldTypeProperty, aBytesRead); |
|
77 |
|
78 CField::SkipUnknownFieldsL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour); |
|
79 CField::EnsureAlignedL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour); |
|
80 } |
|
81 |
|
82 void CProperties::ConstructL(TPtrProvider& aDataProvider, TInt64& aBytesRead, TReadTypeBehaviour aTypeReadBehaviour) |
|
83 { |
|
84 TInt64 fieldOffset = aBytesRead; |
|
85 |
|
86 CField::ConstructL(aDataProvider, EFieldTypeProperties, aBytesRead, aTypeReadBehaviour); |
|
87 |
|
88 ReadMemberArrayL(aDataProvider, iProperties, EFieldTypeProperty, aBytesRead); |
|
89 |
|
90 CField::SkipUnknownFieldsL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour); |
|
91 CField::EnsureAlignedL(aDataProvider, aBytesRead - fieldOffset, aBytesRead, aTypeReadBehaviour); |
|
92 } |
|
93 |
|
94 |