|
1 /* |
|
2 * Copyright (c) 2005 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: DM Utilities |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __NSMLDMURI_H |
|
20 #define __NSMLDMURI_H |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 #include <e32def.h> |
|
25 |
|
26 |
|
27 const TUint8 KNSmlDMUriSeparator = 0x2f; //forward slash |
|
28 |
|
29 _LIT8(KNSmlDmRootUri, "."); |
|
30 _LIT8(KNSmlDmUriDotSlash, "./"); |
|
31 _LIT8( KNSmlDmQuestionMark, "?" ); |
|
32 |
|
33 // =========================================================================== |
|
34 // NSmlDmURI |
|
35 // =========================================================================== |
|
36 /** |
|
37 * NSmlDmURI contains just static methods for parsing URIs |
|
38 * |
|
39 * @since |
|
40 */ |
|
41 class NSmlDmURI |
|
42 { |
|
43 public: |
|
44 /** |
|
45 * Return the parent URI of given URI |
|
46 * @param aURI Uri |
|
47 * @return Parent URI |
|
48 */ |
|
49 static TPtrC8 ParentURI(const TDesC8& aURI); |
|
50 |
|
51 /** |
|
52 * Return the last URI segment of given URI |
|
53 * @param aURI Uri |
|
54 * @return Last URI segment |
|
55 */ |
|
56 static TPtrC8 LastURISeg(const TDesC8& aURI); |
|
57 |
|
58 /** |
|
59 * Return the URI without ./ at the beginning, if those exist |
|
60 * @param aURI Uri |
|
61 * @return Uri without ./ |
|
62 */ |
|
63 static TPtrC8 RemoveDotSlash(const TDesC8& aURI); |
|
64 |
|
65 /** |
|
66 * Return the URI without property info at the end (?prop=...) |
|
67 * @param aURI Uri |
|
68 * @return Uri without property info |
|
69 */ |
|
70 static TPtrC8 RemoveProp(const TDesC8& aURI); |
|
71 |
|
72 /** |
|
73 * Return the URI without last segment |
|
74 * @param aURI Uri |
|
75 * @return URI without last uri segment |
|
76 */ |
|
77 static TPtrC8 RemoveLastSeg(const TDesC8& aURI); |
|
78 |
|
79 /** |
|
80 * Return the aLocationth URI segment. |
|
81 * @param aURI Uri |
|
82 * @param aLocation The wanted segment number |
|
83 * @return The aLocationth URI segment |
|
84 */ |
|
85 static TPtrC8 URISeg(const TDesC8& aURI,TInt aLocation); |
|
86 |
|
87 /** |
|
88 * Return the number of URI segments of given URI |
|
89 * @param aURI Uri |
|
90 * @return Number of segments |
|
91 */ |
|
92 static TInt NumOfURISegs(const TDesC8& aURI); |
|
93 }; |
|
94 |
|
95 #endif // __NSMLDMURI_H |