|
1 /* |
|
2 * Copyright (c) 2008 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: Class ChspsPluginIdList is a HSPS utility class for passing |
|
15 * plugin ids from a client process to the server process. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #include "hspspluginidlist.h" |
|
22 |
|
23 #include <s32mem.h> |
|
24 |
|
25 // ============================ MEMBER FUNCTIONS =============================== |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // ChspsPluginIdList::ChspsPluginIdList() |
|
29 // C++ default constructor can NOT contain any code, that |
|
30 // might leave. |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 EXPORT_C ChspsPluginIdList::ChspsPluginIdList( TInt aGranularity ) : CArrayFixFlat( aGranularity ) |
|
34 { |
|
35 } |
|
36 |
|
37 // Destructor |
|
38 EXPORT_C ChspsPluginIdList::~ChspsPluginIdList() |
|
39 { |
|
40 } |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // ChspsPluginIdList::ExternalizeL() |
|
44 // (other items were commented in a header). |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 EXPORT_C void ChspsPluginIdList::ExternalizeL( RDesWriteStream& aStream ) const |
|
48 { |
|
49 const TInt count = Count(); |
|
50 aStream.WriteUint32L( (TUint)count ); |
|
51 for( TInt i=0; i< count; i++ ) |
|
52 { |
|
53 aStream.WriteUint32L( (TUint)At(i) ); |
|
54 } |
|
55 } |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // ChspsPluginIdList::InternalizeL() |
|
59 // (other items were commented in a header). |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 EXPORT_C void ChspsPluginIdList::InternalizeL( RDesReadStream& aStream ) |
|
63 { |
|
64 TInt count = aStream.ReadUint32L(); |
|
65 for( TInt i=0; i< count; i++ ) |
|
66 { |
|
67 AppendL( aStream.ReadUint32L() ); |
|
68 } |
|
69 } |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // ChspsPluginIdList::GetDataLength() |
|
73 // (other items were commented in a header). |
|
74 // ----------------------------------------------------------------------------- |
|
75 // |
|
76 EXPORT_C TInt ChspsPluginIdList::GetDataLength() |
|
77 { |
|
78 TInt len = sizeof( TUint ) + Count() * sizeof( TUint ); |
|
79 return len; |
|
80 } |
|
81 |
|
82 // End of File |