|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __SIPURIPARSER_H__ |
|
17 #define __SIPURIPARSER_H__ |
|
18 |
|
19 #include "GenericUriParser.h" |
|
20 |
|
21 /** |
|
22 enum TSipDelimiterSearchFlag |
|
23 Enum defining a set of flags used for search delimiter searching. |
|
24 */ |
|
25 enum TSipDelimiterSearchFlag |
|
26 { |
|
27 // Specifier for colon delimiter |
|
28 ESipColonDelimiterFlag = 0x001, |
|
29 // Specifier for semicolon delimiter |
|
30 ESipSemiColonDelimiterFlag = 0x002, |
|
31 // Specifier for query/header delimiter |
|
32 ESipQueryDelimiterFlag = 0x004, |
|
33 // Specifier for path delimiter seacrh |
|
34 ESipPathDelimiterSearch = ESipQueryDelimiterFlag, |
|
35 // Specifier for authority delimiter search |
|
36 ESipAuthDelimiterSearch = ESipPathDelimiterSearch | ESipSemiColonDelimiterFlag, |
|
37 // Specifier for scheme delimiter seacrh |
|
38 ESipSchemeDelimiterSearch = ESipAuthDelimiterSearch | ESipColonDelimiterFlag |
|
39 }; |
|
40 |
|
41 /** |
|
42 Dependencies : CUriParserBase. |
|
43 Comments : Provides Parsing functionality for the Sip Uri objects. |
|
44 This is implemented as per RFC3261 for Parsing of Uris. |
|
45 It uses 8-bit descriptors. |
|
46 |
|
47 @internalComponent |
|
48 @released |
|
49 */ |
|
50 class CSIPUriParser: public CGenericUriParser |
|
51 { |
|
52 public: |
|
53 |
|
54 static CSIPUriParser* NewL(); |
|
55 virtual ~CSIPUriParser(); |
|
56 |
|
57 private: |
|
58 |
|
59 CSIPUriParser(); |
|
60 void ConstructL(); |
|
61 |
|
62 TInt ParseScheme(const TPtrC8& aUri, TPtrC8& aScheme); |
|
63 TInt ParseAuthority(const TPtrC8& aUri, TPtrC8& aUserinfo, TPtrC8& aHost, TPtrC8& aPort, TBool aUseNetworkDelimiter); |
|
64 TInt ParsePath(const TPtrC8& aUri, TPtrC8& aPath); |
|
65 TInt ParseQuery(const TPtrC8& aUri, TPtrC8& aQuery); |
|
66 TInt ParseFragment(const TPtrC8& aUri, TPtrC8& aFragment); |
|
67 |
|
68 //Internal Supporting method for Parsing |
|
69 TInt FindFirstUriDelimiter(const TPtrC8& aString, TSipDelimiterSearchFlag aSearchFlag); |
|
70 }; |
|
71 |
|
72 #endif // __SIPURIPARSER_H__ |
|
73 |
|
74 |