|
1 /* |
|
2 * Copyright (c) 2002-2004 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: Private, Accessory Policy Capability Subblock Name Array Serialization |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <s32mem.h> |
|
21 #include <AccPolCommonNameValuePairs.h> |
|
22 #include "AccPolCapsSubblockNameArraySerial.h" |
|
23 #include "AccPolSubblockNameArrayAccessor.h" |
|
24 #include "acc_debug.h" |
|
25 |
|
26 |
|
27 // EXTERNAL DATA STRUCTURES |
|
28 |
|
29 // EXTERNAL FUNCTION PROTOTYPES |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 // MACROS |
|
34 |
|
35 // LOCAL CONSTANTS AND MACROS |
|
36 |
|
37 // MODULE DATA STRUCTURES |
|
38 |
|
39 // LOCAL FUNCTION PROTOTYPES |
|
40 |
|
41 // FORWARD DECLARATIONS |
|
42 |
|
43 // ============================ MEMBER FUNCTIONS =============================== |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // TAccPolCapsSubblockNameArraySerial::InternalizeL |
|
47 // Internalize name array data from the read stream. |
|
48 // (other items were commented in a header). |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 EXPORT_C void TAccPolCapsSubblockNameArraySerial::InternalizeL( |
|
52 RReadStream& aStream, |
|
53 CAccPolSubblockNameArray& aArray) |
|
54 { |
|
55 COM_TRACE_( "[AccFW: ACCPOLICY] TAccPolCapsSubblockNameArraySerial::InternalizeL()" ); |
|
56 |
|
57 TUint16 count( aStream.ReadUint16L() ); |
|
58 TAccPolSubblockNameArrayAccessor::ResetArray( aArray ); |
|
59 for ( TInt i( 0 ); i < count; ++i ) |
|
60 { |
|
61 TUint16 name( ); |
|
62 TAccPolSubblockNameArrayAccessor::AppendNameL( aArray, aStream.ReadUint16L() ); |
|
63 } |
|
64 |
|
65 COM_TRACE_( "[AccFW: ACCPOLICY] TAccPolCapsSubblockNameArraySerial::InternalizeL() - return void" ); |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // TAccPolCapsSubblockNameArraySerial::ExternalizeL |
|
70 // Externalize name array data to the write stream. |
|
71 // (other items were commented in a header). |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 EXPORT_C void TAccPolCapsSubblockNameArraySerial::ExternalizeL( |
|
75 const CAccPolSubblockNameArray& aArray, |
|
76 RWriteStream& aStream ) |
|
77 { |
|
78 COM_TRACE_( "[AccFW: ACCPOLICY] TAccPolCapsSubblockNameArraySerial::ExternalizeL()" ); |
|
79 |
|
80 TUint16 count( TAccPolSubblockNameArrayAccessor::GetCount( aArray ) ); |
|
81 aStream.WriteUint16L( count ); |
|
82 for ( TInt16 i( 0 ); i < count; ++i ) |
|
83 { |
|
84 TUint32 name; |
|
85 TAccPolSubblockNameArrayAccessor::GetName( aArray, i, name ); |
|
86 aStream.WriteUint16L( name ); |
|
87 } |
|
88 |
|
89 COM_TRACE_( "[AccFW: ACCPOLICY] TAccPolCapsSubblockNameArraySerial::ExternalizeL() - return void" ); |
|
90 } |
|
91 |
|
92 // End of File |