|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @publishedPartner |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef TMTPTYPEUINT128_H |
|
23 #define TMTPTYPEUINT128_H |
|
24 |
|
25 #include <e32std.h> |
|
26 #include <mtp/mmtptype.h> |
|
27 #include <mtp/mtpdatatypeconstants.h> |
|
28 |
|
29 /** |
|
30 Defines the MTP unsigned 128-bit integer data type. |
|
31 @publishedPartner |
|
32 @released |
|
33 */ |
|
34 class TMTPTypeUint128 : public MMTPType |
|
35 { |
|
36 |
|
37 public: |
|
38 |
|
39 IMPORT_C TMTPTypeUint128(); |
|
40 IMPORT_C TMTPTypeUint128(const TPtrC8& aData); |
|
41 IMPORT_C TMTPTypeUint128(const TUint64 aUpperValue, const TUint64 aLowerValue); |
|
42 |
|
43 IMPORT_C void Set(TUint64 aUpperValue, TUint64 aLowerValue); |
|
44 IMPORT_C TUint64 LowerValue() const; |
|
45 IMPORT_C TUint64 UpperValue() const; |
|
46 |
|
47 public: // From MMTPType |
|
48 |
|
49 IMPORT_C TInt FirstReadChunk(TPtrC8& aChunk) const; |
|
50 IMPORT_C TInt NextReadChunk(TPtrC8& aChunk) const; |
|
51 IMPORT_C TInt FirstWriteChunk(TPtr8& aChunk); |
|
52 IMPORT_C TInt NextWriteChunk(TPtr8& aChunk); |
|
53 IMPORT_C TUint64 Size() const; |
|
54 IMPORT_C TUint Type() const; |
|
55 |
|
56 IMPORT_C TBool Equal(const TMTPTypeUint128& aR) const; |
|
57 IMPORT_C TInt Compare(const TMTPTypeUint128& aR) const; |
|
58 IMPORT_C TInt Compare(const TUint64 aRUpper, const TUint64 aRLower) const; |
|
59 |
|
60 private: |
|
61 |
|
62 /** |
|
63 Least significant 64-bit buffer offset. |
|
64 */ |
|
65 static const TInt KMTPTypeUint128OffsetLS = 0; |
|
66 |
|
67 /** |
|
68 Most significant 64-bit buffer offset. |
|
69 */ |
|
70 static const TInt KMTPTypeUint128OffsetMS = 8; |
|
71 |
|
72 protected: |
|
73 /** |
|
74 The data buffer. |
|
75 */ |
|
76 TBuf8<KMTPTypeUINT128Size> iData; |
|
77 }; |
|
78 |
|
79 #endif // TMTPTYPEUINT128_H |