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