1 /* |
|
2 * Copyright (c) 2005 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 "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: CMMCScBkupArchiveHeader Implementation |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 #include "CMMCScBkupArchiveHeader.h" |
|
20 |
|
21 // User includes |
|
22 #include "MMCScBkupArchiveUtils.h" |
|
23 |
|
24 /** |
|
25 * NB. See MMCScBkupArchiveUtils.cpp for archive header file format. |
|
26 */ |
|
27 |
|
28 |
|
29 // ========================= MEMBER FUNCTIONS ================================ |
|
30 |
|
31 // --------------------------------------------------------------------------- |
|
32 // CMMCScBkupArchiveHeader::CMMCScBkupArchiveHeader() |
|
33 // |
|
34 // C++ constructor. |
|
35 // --------------------------------------------------------------------------- |
|
36 CMMCScBkupArchiveHeader::CMMCScBkupArchiveHeader( MMMCScBkupArchiveDataInterface& aDataInterface, MMMCScBkupDriver& aDriver ) |
|
37 : iDataInterface( aDataInterface ), iDriver( aDriver ) |
|
38 { |
|
39 } |
|
40 |
|
41 |
|
42 // --------------------------------------------------------------------------- |
|
43 // CMMCScBkupArchiveHeader::~CMMCScBkupArchiveHeader() |
|
44 // |
|
45 // Destructor. |
|
46 // --------------------------------------------------------------------------- |
|
47 CMMCScBkupArchiveHeader::~CMMCScBkupArchiveHeader() |
|
48 { |
|
49 delete iPhoneModelIdentifier; |
|
50 } |
|
51 |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // CMMCScBkupArchiveHeader::ConstructL() |
|
55 // |
|
56 // |
|
57 // --------------------------------------------------------------------------- |
|
58 void CMMCScBkupArchiveHeader::ConstructL() |
|
59 { |
|
60 iPhoneModelIdentifier = KNullDesC8().AllocL(); |
|
61 } |
|
62 |
|
63 |
|
64 // --------------------------------------------------------------------------- |
|
65 // CMMCScBkupArchiveHeader::NewL() |
|
66 // |
|
67 // |
|
68 // --------------------------------------------------------------------------- |
|
69 CMMCScBkupArchiveHeader* CMMCScBkupArchiveHeader::NewL( MMMCScBkupArchiveDataInterface& aDataInterface, MMMCScBkupDriver& aDriver ) |
|
70 { |
|
71 CMMCScBkupArchiveHeader* self = new(ELeave) CMMCScBkupArchiveHeader( aDataInterface, aDriver ); |
|
72 CleanupStack::PushL(self); |
|
73 self->ConstructL(); |
|
74 CleanupStack::Pop(self); |
|
75 return self; |
|
76 } |
|
77 |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // CMMCScBkupArchiveHeader::StoreL() |
|
81 // |
|
82 // |
|
83 // --------------------------------------------------------------------------- |
|
84 void CMMCScBkupArchiveHeader::StoreL(TBitFlags aCategory) |
|
85 { |
|
86 MMCScBkupArchiveUtils::WriteHeaderL( iDataInterface, aCategory ); |
|
87 } |
|
88 |
|
89 |
|
90 // --------------------------------------------------------------------------- |
|
91 // CMMCScBkupArchiveHeader::RestoreL() |
|
92 // |
|
93 // |
|
94 // --------------------------------------------------------------------------- |
|
95 void CMMCScBkupArchiveHeader::RestoreL() |
|
96 { |
|
97 MMCScBkupArchiveUtils::ReadHeaderL( iDataInterface, *this ); |
|
98 } |
|
99 |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // CMMCScBkupArchiveHeader::SetPhoneModelIdentifierL() |
|
103 // |
|
104 // |
|
105 // --------------------------------------------------------------------------- |
|
106 void CMMCScBkupArchiveHeader::SetPhoneModelIdentifierL( const TDesC8& aModel ) |
|
107 { |
|
108 HBufC8* model = aModel.AllocL(); |
|
109 delete iPhoneModelIdentifier; |
|
110 iPhoneModelIdentifier = model; |
|
111 } |
|