|
1 /* |
|
2 * Copyright (c) 2006 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "ncd_cp_serverdetailsimpl.h" |
|
20 #include "ncd_cp_detail.h" |
|
21 #include "ncdprotocolutils.h" |
|
22 |
|
23 void CNcdConfigurationProtocolServerDetailsImpl::ConstructL() |
|
24 { |
|
25 NcdProtocolUtils::AssignEmptyDesL( iVersion ); |
|
26 } |
|
27 |
|
28 CNcdConfigurationProtocolServerDetailsImpl::~CNcdConfigurationProtocolServerDetailsImpl() |
|
29 { |
|
30 delete iVersion; |
|
31 if( iCapabilities ) |
|
32 { |
|
33 iCapabilities->ResetAndDestroy(); |
|
34 delete iCapabilities; |
|
35 iCapabilities = 0; |
|
36 } |
|
37 iDetails.ResetAndDestroy(); |
|
38 } |
|
39 |
|
40 const TDesC& CNcdConfigurationProtocolServerDetailsImpl::Version() const |
|
41 { |
|
42 return *iVersion; |
|
43 } |
|
44 |
|
45 TInt CNcdConfigurationProtocolServerDetailsImpl::DetailCount() const |
|
46 { |
|
47 return iDetails.Count(); |
|
48 } |
|
49 |
|
50 const MNcdConfigurationProtocolDetail& |
|
51 CNcdConfigurationProtocolServerDetailsImpl::DetailL( TInt aIndex ) const |
|
52 { |
|
53 if ( aIndex < 0 || aIndex >= iDetails.Count() ) |
|
54 { |
|
55 User::Leave( KErrArgument ); |
|
56 } |
|
57 return *iDetails[aIndex]; |
|
58 } |
|
59 |
|
60 TInt CNcdConfigurationProtocolServerDetailsImpl::CapabilityCount() const |
|
61 { |
|
62 if( iCapabilities ) |
|
63 { |
|
64 return iCapabilities->Count(); |
|
65 } |
|
66 else |
|
67 { |
|
68 return 0; |
|
69 } |
|
70 } |
|
71 |
|
72 const TDesC& CNcdConfigurationProtocolServerDetailsImpl::CapabilityL( TInt aIndex ) const |
|
73 { |
|
74 if ( aIndex < 0 || aIndex >= iCapabilities->Count() ) |
|
75 { |
|
76 User::Leave( KErrArgument ); |
|
77 } |
|
78 return *iCapabilities->At( aIndex ); |
|
79 } |