|
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 */ |
|
20 |
|
21 #include <mtp/mtpdatatypeconstants.h> |
|
22 #include <mtp/tmtptypeuintbase.h> |
|
23 |
|
24 EXPORT_C TInt TMTPTypeUintBase::FirstReadChunk(TPtrC8& aChunk) const |
|
25 { |
|
26 aChunk.Set(reinterpret_cast<const TUint8*>(&iData), iSize); |
|
27 return KMTPChunkSequenceCompletion; |
|
28 } |
|
29 |
|
30 EXPORT_C TInt TMTPTypeUintBase::NextReadChunk(TPtrC8& aChunk) const |
|
31 { |
|
32 aChunk.Set(NULL, 0); |
|
33 return KErrNotReady; |
|
34 } |
|
35 |
|
36 EXPORT_C TInt TMTPTypeUintBase::FirstWriteChunk(TPtr8& aChunk) |
|
37 { |
|
38 aChunk.Set(reinterpret_cast<TUint8*>(&iData), 0, iSize); |
|
39 return KMTPChunkSequenceCompletion; |
|
40 } |
|
41 |
|
42 EXPORT_C TInt TMTPTypeUintBase::NextWriteChunk(TPtr8& aChunk) |
|
43 { |
|
44 aChunk.Set(NULL, 0, 0); |
|
45 return KErrNotReady; |
|
46 } |
|
47 |
|
48 EXPORT_C TUint64 TMTPTypeUintBase::Size() const |
|
49 { |
|
50 return iSize; |
|
51 } |
|
52 |
|
53 EXPORT_C TUint TMTPTypeUintBase::Type() const |
|
54 { |
|
55 return iType; |
|
56 } |
|
57 |
|
58 /** |
|
59 Constructor. |
|
60 @param aData The UINT data with which the type is to be initialised. |
|
61 @param aSize The size of the UINT data type. |
|
62 @param aType The UINT data type code. |
|
63 */ |
|
64 EXPORT_C TMTPTypeUintBase::TMTPTypeUintBase(TUint aData, TUint aSize, TInt aType) : |
|
65 iData(aData), |
|
66 iSize(aSize), |
|
67 iType(aType) |
|
68 { |
|
69 |
|
70 } |
|
71 |