|
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 the License "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: Common utilities for ServiceRegistry Service API |
|
15 * THIS FILE IS GENERATED - DO NOT MODIFY!!! |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include <liwcommon.h> |
|
21 |
|
22 #include "serviceregistryutilities.h" |
|
23 #include "serviceregistryservice.hrh" |
|
24 |
|
25 |
|
26 // ======== MEMBER FUNCTIONS ======== |
|
27 |
|
28 // --------------------------------------------------------------------------- |
|
29 // TServiceRegistryUtilities::ConvertInputInt32L |
|
30 // Converts LIW type input Int32 into Symbian type. |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 TInt32 TServiceRegistryUtilities::ConvertInputInt32L( const CLiwGenericParamList& aInParamList, |
|
34 const TDesC8& aName, |
|
35 const TInt aParamIndex ) |
|
36 { |
|
37 // Local parameter storage |
|
38 TLiwGenericParam inParam; |
|
39 // Storage for return value |
|
40 TInt32 retInt32( 0 ); |
|
41 // Default start position for Find |
|
42 TInt FindStartIndex = 0; |
|
43 // Get input parameter |
|
44 aInParamList.FindFirst( FindStartIndex, aName ); |
|
45 if ( FindStartIndex < 0 ) |
|
46 { |
|
47 // Using position based parsing, if param was not found by name. |
|
48 if ( aParamIndex != -1 && aInParamList.Count() > aParamIndex ) |
|
49 { |
|
50 inParam = aInParamList[aParamIndex]; |
|
51 } |
|
52 else |
|
53 { |
|
54 |
|
55 User::Leave( SErrMissingArgument ); |
|
56 } |
|
57 } |
|
58 else |
|
59 { |
|
60 inParam = aInParamList[FindStartIndex]; |
|
61 } |
|
62 |
|
63 // Check variant type |
|
64 if ( inParam.Value().TypeId() != LIW::EVariantTypeTInt32 ) |
|
65 { |
|
66 |
|
67 User::Leave( SErrBadArgumentType ); |
|
68 } |
|
69 inParam.Value().Get( retInt32 ); |
|
70 return retInt32; |
|
71 } |
|
72 |