|
1 /* |
|
2 * Copyright (c) 2009 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 // INCLUDE FILES |
|
19 |
|
20 #include <s32strm.h> |
|
21 #include "menuengobjectattr.h" |
|
22 |
|
23 // ================= MEMBER FUNCTIONS ======================= |
|
24 |
|
25 // --------------------------------------------------------- |
|
26 // CMenuEngObjectAttr::~CMenuEngObjectAttr |
|
27 // --------------------------------------------------------- |
|
28 // |
|
29 CMenuEngObjectAttr::~CMenuEngObjectAttr() |
|
30 { |
|
31 iName.Close(); |
|
32 iValue.Close(); |
|
33 } |
|
34 |
|
35 // --------------------------------------------------------- |
|
36 // CMenuEngObjectAttr::NewL |
|
37 // --------------------------------------------------------- |
|
38 // |
|
39 CMenuEngObjectAttr* CMenuEngObjectAttr::NewL( const TDesC& aName ) |
|
40 { |
|
41 CMenuEngObjectAttr* attr = NewLC( aName ); |
|
42 CleanupStack::Pop( attr ); |
|
43 return attr; |
|
44 } |
|
45 |
|
46 // --------------------------------------------------------- |
|
47 // CMenuEngObjectAttr::NewLC |
|
48 // --------------------------------------------------------- |
|
49 // |
|
50 CMenuEngObjectAttr* CMenuEngObjectAttr::NewLC( const TDesC& aName ) |
|
51 { |
|
52 CMenuEngObjectAttr* attr = new (ELeave) CMenuEngObjectAttr(); |
|
53 CleanupStack::PushL( attr ); |
|
54 attr->ConstructL( aName ); |
|
55 return attr; |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------- |
|
59 // CMenuEngObjectAttr::CMenuEngObjectAttr |
|
60 // --------------------------------------------------------- |
|
61 // |
|
62 CMenuEngObjectAttr::CMenuEngObjectAttr() |
|
63 { |
|
64 } |
|
65 |
|
66 // --------------------------------------------------------- |
|
67 // CMenuEngObjectAttr::ConstructL |
|
68 // --------------------------------------------------------- |
|
69 // |
|
70 void CMenuEngObjectAttr::ConstructL( const TDesC& aName ) |
|
71 { |
|
72 iName.CreateL( aName ); |
|
73 } |
|
74 |
|
75 // --------------------------------------------------------- |
|
76 // CMenuEngObjectAttr::SetValueL |
|
77 // --------------------------------------------------------- |
|
78 // |
|
79 void CMenuEngObjectAttr::SetValueL( const TDesC& aValue ) |
|
80 { |
|
81 iValue.Close(); |
|
82 iValue.CreateL( aValue ); |
|
83 } |
|
84 |
|
85 // --------------------------------------------------------- |
|
86 // RMenuEngObjectAttrArray::Find |
|
87 // --------------------------------------------------------- |
|
88 // |
|
89 TInt RMenuEngObjectAttrArray::Find( const TDesC& aName ) const |
|
90 { |
|
91 for ( TInt i = 0; i < Count(); i++ ) |
|
92 { |
|
93 if ( !aName.Compare( operator[]( i )->Name() ) ) |
|
94 { |
|
95 return i; |
|
96 } |
|
97 } |
|
98 return KErrNotFound; |
|
99 } |
|
100 |
|
101 // End of File |