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: Declaration for TMMCScBkupArchiveVector |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef __TMMCSCBKUPARCHIVEVECTOR_H__ |
|
20 #define __TMMCSCBKUPARCHIVEVECTOR_H__ |
|
21 |
|
22 // System includes |
|
23 #include <s32strm.h> |
|
24 #include <f32file.h> |
|
25 |
|
26 |
|
27 /** |
|
28 * |
|
29 * |
|
30 * @since 3.0 |
|
31 */ |
|
32 NONSHARABLE_CLASS(TMMCScBkupArchiveVector) |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * C++ default constructor |
|
38 */ |
|
39 inline TMMCScBkupArchiveVector() |
|
40 { Reset(); } |
|
41 |
|
42 /** |
|
43 * C++ default constructor |
|
44 */ |
|
45 inline TMMCScBkupArchiveVector( TInt aOffset, TInt aLength ) |
|
46 : iOffset( aOffset ), iLength( aLength ) |
|
47 {} |
|
48 |
|
49 /** |
|
50 * C++ copy constructor |
|
51 */ |
|
52 inline TMMCScBkupArchiveVector( const TMMCScBkupArchiveVector& aVector ) |
|
53 : iOffset( aVector.Offset() ), iLength( aVector.Length() ) |
|
54 {} |
|
55 |
|
56 public: |
|
57 |
|
58 /** |
|
59 * |
|
60 */ |
|
61 inline TInt Offset() const { return iOffset; } |
|
62 |
|
63 /** |
|
64 * |
|
65 */ |
|
66 inline void SetOffset( TInt aOffset ) { iOffset = aOffset; } |
|
67 |
|
68 /** |
|
69 * |
|
70 */ |
|
71 inline TInt Length() const { return iLength; } |
|
72 |
|
73 /** |
|
74 * |
|
75 */ |
|
76 inline void SetLength( TInt aLength ) { iLength = aLength; } |
|
77 |
|
78 /** |
|
79 * |
|
80 */ |
|
81 inline TInt EndOffset() const { return (iOffset + iLength); } |
|
82 |
|
83 /** |
|
84 * |
|
85 */ |
|
86 inline void AdjustByDelta( TInt aOffsetDelta ) { iOffset += aOffsetDelta; } |
|
87 |
|
88 /** |
|
89 * |
|
90 */ |
|
91 static TInt ExternalizedSize(); |
|
92 |
|
93 public: |
|
94 |
|
95 /** |
|
96 * |
|
97 */ |
|
98 inline void Reset() { iLength = iOffset = 0; } |
|
99 |
|
100 /** |
|
101 * |
|
102 */ |
|
103 void ExternalizeL( RWriteStream& aStream ) const; |
|
104 |
|
105 /** |
|
106 * |
|
107 */ |
|
108 void InternalizeL( RReadStream& aStream ); |
|
109 |
|
110 private: // Internal enumerations |
|
111 enum |
|
112 { |
|
113 EStreamFormatVersion1 = 1 |
|
114 }; |
|
115 |
|
116 private: // Member data |
|
117 |
|
118 /** |
|
119 * |
|
120 */ |
|
121 TInt iOffset; |
|
122 |
|
123 /** |
|
124 * |
|
125 */ |
|
126 TInt iLength; |
|
127 }; |
|
128 |
|
129 |
|
130 |
|
131 /** |
|
132 * |
|
133 * @since 3.0 |
|
134 */ |
|
135 NONSHARABLE_CLASS(TMMCScBkupArchiveDriveAndVector) |
|
136 { |
|
137 public: |
|
138 |
|
139 /** |
|
140 * C++ default constructor |
|
141 */ |
|
142 inline TMMCScBkupArchiveDriveAndVector() : iDrive( EDriveC ) { } |
|
143 |
|
144 /** |
|
145 * C++ default constructor |
|
146 */ |
|
147 inline TMMCScBkupArchiveDriveAndVector( TDriveNumber aDrive, const TMMCScBkupArchiveVector& aVector ) : iDrive( aDrive), iVector( aVector ) { } |
|
148 |
|
149 public: |
|
150 |
|
151 /** |
|
152 * Internalize object from stream |
|
153 */ |
|
154 void InternalizeL( RReadStream& aStream ); |
|
155 |
|
156 /** |
|
157 * Externalize object to stream |
|
158 */ |
|
159 void ExternalizeL( RWriteStream& aStream ) const; |
|
160 |
|
161 private: // Internal enumerations |
|
162 enum |
|
163 { |
|
164 EStreamFormatVersion1 = 1 |
|
165 }; |
|
166 |
|
167 public: // Data members |
|
168 TDriveNumber iDrive; |
|
169 TMMCScBkupArchiveVector iVector; |
|
170 }; |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 #endif // __TMMCSCBKUPARCHIVEVECTOR_H__ |
|
176 |
|
177 //End of File |
|