1 /* |
|
2 * Copyright (c) 2009-2010 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: Utilities class for VoIP XML processor |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef VOIPXMLUTILS_H |
|
20 #define VOIPXMLUTILS_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 /** |
|
25 * Cleanup item for deleting contents of RPointerArray. |
|
26 * |
|
27 * @lib voipxmlprocessor.lib |
|
28 * @since S60 v5.0 |
|
29 */ |
|
30 template <class T> |
|
31 class CleanupResetAndDestroy |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Pushes aRef to cleanup stack using TCleanupItem (and ResetAndDestroy). |
|
37 * |
|
38 * @since S60 v5.0 |
|
39 * @param aRef Reference to object to be pushed to cleanup stack. |
|
40 */ |
|
41 inline static void PushL( T& aRef ); |
|
42 |
|
43 private: |
|
44 |
|
45 /** |
|
46 * Method for TCleanupItem used in PushL. |
|
47 * |
|
48 * @since S60 v5.0 |
|
49 * @param aPtr Pointer to be cleaned up. |
|
50 */ |
|
51 inline static void ResetAndDestroy( TAny *aPtr ); |
|
52 }; |
|
53 |
|
54 template <class T> |
|
55 inline void CleanupResetAndDestroyL( T& aRef ); |
|
56 |
|
57 |
|
58 /** |
|
59 * Utilities class for VoIP XML processor. |
|
60 * Provides common methods for VoIP XML processor classes. |
|
61 * |
|
62 * @lib voipxmlprocessor.lib |
|
63 * @since S60 v5.0 |
|
64 */ |
|
65 class VoipXmlUtils |
|
66 { |
|
67 #ifdef _DEBUG |
|
68 friend class UT_VoipXmlUtils; |
|
69 #endif |
|
70 |
|
71 public: |
|
72 |
|
73 /** |
|
74 * Converts a descriptor to integer. |
|
75 * |
|
76 * @since S60 v5.0 |
|
77 * @param aDesValue Descriptor value. |
|
78 * @param aIntValue Interger value (this will hold the converted value). |
|
79 * @return Error code. |
|
80 */ |
|
81 static TInt DesToInt( const TDesC& aDesValue, TInt& aIntValue ); |
|
82 |
|
83 /** |
|
84 * Converts an 8 bit descriptor to integer. |
|
85 * |
|
86 * @since S60 v5.0 |
|
87 * @param aDesValue Descriptor value. |
|
88 * @param aIntValue Interger value (this will hold the converted value). |
|
89 * @return Error code. |
|
90 */ |
|
91 static TInt Des8ToInt( const TDesC8& aDesValue, TInt& aIntValue ); |
|
92 }; |
|
93 |
|
94 #include "voipxmlutils.inl" |
|
95 |
|
96 #endif // VOIPXMLUTILS_H |
|
97 |
|
98 // End of file. |
|
99 |
|