|
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: Implementation of terminalsecurity components |
|
15 * |
|
16 */ |
|
17 #ifndef _TPTRC8I_H_INCLUDED_ |
|
18 #define _TPTRC8I_H_INCLUDED_ |
|
19 |
|
20 class TPtrC8I : public TPtrC8 |
|
21 { |
|
22 public: |
|
23 |
|
24 inline TPtrC8I( const TDesC8 &aDes ): TPtrC8( aDes ) |
|
25 { |
|
26 } |
|
27 |
|
28 inline TBool operator==( const TDesC8 &aDes ) |
|
29 { |
|
30 HBufC8* copyThis = this->Alloc(); |
|
31 TPtr8 ptrThis = copyThis->Des(); |
|
32 |
|
33 HBufC8* copyParam = aDes.Alloc(); |
|
34 TPtr8 ptrParam = copyParam->Des(); |
|
35 |
|
36 ptrThis.LowerCase(); |
|
37 ptrThis.TrimAll(); |
|
38 ptrParam.LowerCase(); |
|
39 ptrParam.TrimAll(); |
|
40 TBool ret = ptrParam == ptrThis; |
|
41 delete copyParam; |
|
42 delete copyThis; |
|
43 |
|
44 return ret; |
|
45 } |
|
46 }; |
|
47 |
|
48 class TPtrC16I : public TPtrC16 |
|
49 { |
|
50 public: |
|
51 |
|
52 inline TPtrC16I( const TDesC16 &aDes ): TPtrC16( aDes ) |
|
53 { |
|
54 } |
|
55 |
|
56 inline TBool operator==( const TDesC16 &aDes ) |
|
57 { |
|
58 HBufC16* copyThis = this->Alloc(); |
|
59 TPtr16 ptrThis = copyThis->Des(); |
|
60 |
|
61 HBufC16* copyParam = aDes.Alloc(); |
|
62 TPtr16 ptrParam = copyParam->Des(); |
|
63 |
|
64 ptrThis.LowerCase(); |
|
65 ptrThis.TrimAll(); |
|
66 ptrParam.LowerCase(); |
|
67 ptrParam.TrimAll(); |
|
68 TBool ret = ptrParam == ptrThis; |
|
69 delete copyParam; |
|
70 delete copyThis; |
|
71 |
|
72 return ret; |
|
73 } |
|
74 }; |
|
75 |
|
76 #endif //_TPTRC8I_H_INCLUDED_ |