|
1 /* |
|
2 * Copyright (c) 2005-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: |
|
15 * Name : CSIPParam.h |
|
16 * Part of : SIP Codec |
|
17 * Version : SIP/4.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 |
|
29 #ifndef CSIPPARAM_H |
|
30 #define CSIPPARAM_H |
|
31 |
|
32 #include <e32base.h> |
|
33 #include <s32mem.h> |
|
34 #include <stringpool.h> |
|
35 #include "_sipcodecdefs.h" |
|
36 |
|
37 /** |
|
38 * General class for SIP-URI- and header-parameter manipulation. |
|
39 * Class provides functions for setting and getting SIP parameter |
|
40 * as name/value pairs. |
|
41 */ |
|
42 class CSIPParam : public CBase |
|
43 { |
|
44 public: |
|
45 |
|
46 static CSIPParam* DecodeL (const TDesC8& aValue); |
|
47 static TBool ParseL(const TDesC8& aInput, TPtrC8& aName, TPtrC8& aValue); |
|
48 |
|
49 static CSIPParam* NewL (RStringF aName); |
|
50 static CSIPParam* NewLC (RStringF aName); |
|
51 |
|
52 static CSIPParam* NewL (const TDesC8& aName); |
|
53 static CSIPParam* NewLC (const TDesC8& aName); |
|
54 |
|
55 static CSIPParam* NewL (RStringF aName, RStringF aValue); |
|
56 static CSIPParam* NewLC (RStringF aName, RStringF aValue); |
|
57 |
|
58 static CSIPParam* NewL (RStringF aName, const TDesC8& aValue); |
|
59 static CSIPParam* NewLC (RStringF aName, const TDesC8& aValue); |
|
60 |
|
61 static CSIPParam* NewL (const TDesC8& aName, const TDesC8& aValue); |
|
62 static CSIPParam* NewLC (const TDesC8& aName, const TDesC8& aValue); |
|
63 |
|
64 static CSIPParam* NewL (const CSIPParam& aSIPParam); |
|
65 static CSIPParam* NewLC (const CSIPParam& aSIPParam); |
|
66 |
|
67 ~CSIPParam(); |
|
68 |
|
69 RStringF Name () const; |
|
70 TBool HasValue () const; |
|
71 RStringF Value() const; |
|
72 const TDesC8& DesValue() const; |
|
73 void SetValueL(const TDesC8& aValue, TBool aAddQuotesWhenEncoding); |
|
74 |
|
75 TBool operator==(const CSIPParam& aSIPParam) const; |
|
76 |
|
77 HBufC8* ToTextLC () const; |
|
78 |
|
79 static CSIPParam* InternalizeL (RReadStream& aReadStream); |
|
80 void ExternalizeL (RWriteStream& aWriteStream) const; |
|
81 |
|
82 private: |
|
83 |
|
84 CSIPParam (); |
|
85 CSIPParam (const CSIPParam& aSIPParam); |
|
86 void ConstructL (RStringF aName); |
|
87 void ConstructL (const TDesC8& aName); |
|
88 void ConstructL (RStringF aName, RStringF aValue); |
|
89 void ConstructL (RStringF aName, const TDesC8& aValue); |
|
90 void ConstructL (const TDesC8& aName, const TDesC8& aValue); |
|
91 void ConstructL (const CSIPParam& aSIPParam); |
|
92 void DoInternalizeL (RReadStream& aReadStream); |
|
93 void SetL(RStringF& aString, |
|
94 const TDesC8& aDes, |
|
95 TBool aCheckLength=ETrue); |
|
96 |
|
97 private: // Data |
|
98 |
|
99 RStringF iName; |
|
100 RStringF iValue; |
|
101 TBool iHasValue; |
|
102 HBufC8* iDesValue; |
|
103 TBool iAddQuotesWhenEncoding; |
|
104 |
|
105 UNIT_TEST(CSIPParamTest) |
|
106 }; |
|
107 |
|
108 #endif // CSIPPARAM_H |
|
109 |
|
110 // End of File |