|
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: Simple Engine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 |
|
23 #include <e32std.h> |
|
24 |
|
25 // own simple |
|
26 #include "simplecommon.h" |
|
27 #include "simpleutils.h" |
|
28 |
|
29 |
|
30 // ================= MEMBER FUNCTIONS ======================= |
|
31 // |
|
32 |
|
33 |
|
34 EXPORT_C TPtrC8 TSimpleUtils::NsUriL( |
|
35 const TDesC8& aPrefix ) |
|
36 { |
|
37 if ( !aPrefix.CompareF( KSimpleDefault ) ) |
|
38 { |
|
39 return TPtrC8(KSimpleNsDefault); |
|
40 } |
|
41 else if ( !aPrefix.CompareF( KSimplePDM ) ) |
|
42 { |
|
43 return TPtrC8(KSimpleNsPDM); |
|
44 } |
|
45 else if ( !aPrefix.CompareF( KSimpleRPID ) ) |
|
46 { |
|
47 return TPtrC8(KSimpleNsRPID); |
|
48 } |
|
49 else if ( !aPrefix.CompareF( KSimpleOP ) ) |
|
50 { |
|
51 return TPtrC8(KSimpleNsOP); |
|
52 } |
|
53 else if ( !aPrefix.CompareF( KSimpleCL ) ) |
|
54 { |
|
55 return TPtrC8(KSimpleNsCL); |
|
56 } |
|
57 else if ( !aPrefix.CompareF( KSimpleGML ) ) |
|
58 { |
|
59 return TPtrC8(KSimpleNsGML); |
|
60 } |
|
61 else |
|
62 { |
|
63 User::Leave( KErrNotFound ); |
|
64 } |
|
65 return TPtrC8(); |
|
66 } |
|
67 |
|
68 EXPORT_C TPtrC8 TSimpleUtils::NsPrefixL( |
|
69 const TDesC8& aURI ) |
|
70 { |
|
71 if ( !aURI.CompareF( KSimpleNsDefault ) ) |
|
72 { |
|
73 return TPtrC8(KSimpleDefault); |
|
74 } |
|
75 else if ( !aURI.CompareF( KSimpleNsPDM ) ) |
|
76 { |
|
77 return TPtrC8(KSimplePDM); |
|
78 } |
|
79 else if ( !aURI.CompareF( KSimpleNsRPID ) ) |
|
80 { |
|
81 return TPtrC8(KSimpleRPID); |
|
82 } |
|
83 else if ( !aURI.CompareF( KSimpleNsOP ) ) |
|
84 { |
|
85 return TPtrC8(KSimpleOP); |
|
86 } |
|
87 else if ( !aURI.CompareF( KSimpleNsCL ) ) |
|
88 { |
|
89 return TPtrC8(KSimpleCL); |
|
90 } |
|
91 else if ( !aURI.CompareF( KSimpleNsGML ) ) |
|
92 { |
|
93 return TPtrC8(KSimpleGML); |
|
94 } |
|
95 else |
|
96 { |
|
97 User::Leave( KErrNotFound ); |
|
98 } |
|
99 return TPtrC8(); |
|
100 } |
|
101 |
|
102 |