|
1 // Copyright (c) 2004-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 // Name : CSIPAuthenticationInfoHeader.cpp |
|
15 // Part of : SIP Codec |
|
16 // Version : SIP/4.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #include "sipauthenticationinfoheader.h" |
|
23 #include "CSIPAuthenticationInfoHeaderParams.h" |
|
24 #include "sipcodecerr.h" |
|
25 #include "CSIPTokenizer.h" |
|
26 #include "sipstrings.h" |
|
27 #include "sipstrconsts.h" |
|
28 #include "_sipcodecdefs.h" |
|
29 |
|
30 |
|
31 // ---------------------------------------------------------------------------- |
|
32 // CSIPAuthenticationInfoHeader::DecodeL |
|
33 // ---------------------------------------------------------------------------- |
|
34 // |
|
35 EXPORT_C CSIPAuthenticationInfoHeader* |
|
36 CSIPAuthenticationInfoHeader::DecodeL (const TDesC8& aValue) |
|
37 { |
|
38 CSIPAuthenticationInfoHeader* header = |
|
39 new(ELeave)CSIPAuthenticationInfoHeader; |
|
40 CleanupStack::PushL (header); |
|
41 header->ConstructL(aValue); |
|
42 CleanupStack::Pop(header); |
|
43 return header; |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CSIPAuthenticationInfoHeader::CSIPAuthenticationInfoHeader |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 CSIPAuthenticationInfoHeader::CSIPAuthenticationInfoHeader() |
|
51 { |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CSIPAuthenticationInfoHeader::ConstructL |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 void CSIPAuthenticationInfoHeader::ConstructL(const TDesC8& aValue) |
|
59 { |
|
60 iParams = new(ELeave)CSIPAuthenticationInfoHeaderParams; |
|
61 iParams->ParseL(aValue); |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // CSIPAuthenticationInfoHeader::ConstructL |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 void CSIPAuthenticationInfoHeader::ConstructL ( |
|
69 const CSIPAuthenticationInfoHeader& aHeader) |
|
70 { |
|
71 iParams = CSIPAuthenticationInfoHeaderParams::NewL(*(aHeader.iParams)); |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // CSIPAuthenticationInfoHeader::~CSIPAuthenticationInfoHeader |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 EXPORT_C CSIPAuthenticationInfoHeader::~CSIPAuthenticationInfoHeader() |
|
79 { |
|
80 delete iParams; |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // CSIPAuthenticationInfoHeader::Value |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 EXPORT_C RStringF CSIPAuthenticationInfoHeader::Value(RStringF aParam) const |
|
88 { |
|
89 return iParams->ParamValue(aParam); |
|
90 } |
|
91 |
|
92 // ----------------------------------------------------------------------------- |
|
93 // CSIPAuthenticationInfoHeader::DesValue |
|
94 // ----------------------------------------------------------------------------- |
|
95 // |
|
96 EXPORT_C const TDesC8& CSIPAuthenticationInfoHeader::DesValue( |
|
97 RStringF aParam) const |
|
98 { |
|
99 return iParams->DesParamValue(aParam); |
|
100 } |
|
101 |
|
102 // ----------------------------------------------------------------------------- |
|
103 // CSIPAuthenticationInfoHeader::CloneL |
|
104 // From CSIPHeaderBase: |
|
105 // ----------------------------------------------------------------------------- |
|
106 // |
|
107 EXPORT_C CSIPHeaderBase* CSIPAuthenticationInfoHeader::CloneL () const |
|
108 { |
|
109 CSIPAuthenticationInfoHeader* clone = |
|
110 new (ELeave) CSIPAuthenticationInfoHeader; |
|
111 CleanupStack::PushL(clone); |
|
112 clone->ConstructL(*this); |
|
113 CleanupStack::Pop(clone); |
|
114 return clone; |
|
115 } |
|
116 |
|
117 // ----------------------------------------------------------------------------- |
|
118 // CSIPAuthenticationInfoHeader::Name |
|
119 // From CSIPHeaderBase: |
|
120 // ----------------------------------------------------------------------------- |
|
121 // |
|
122 EXPORT_C RStringF CSIPAuthenticationInfoHeader::Name() const |
|
123 { |
|
124 return SIPStrings::StringF(SipStrConsts::EAuthenticationInfoHeader); |
|
125 } |
|
126 |
|
127 // ----------------------------------------------------------------------------- |
|
128 // CSIPAuthenticationInfoHeader::ExternalizeSupported |
|
129 // From CSIPHeaderBase: |
|
130 // ----------------------------------------------------------------------------- |
|
131 // |
|
132 EXPORT_C TBool CSIPAuthenticationInfoHeader::ExternalizeSupported () const |
|
133 { |
|
134 return EFalse; |
|
135 } |
|
136 |
|
137 // ----------------------------------------------------------------------------- |
|
138 // CSIPAuthenticationInfoHeader::ToTextValueL |
|
139 // From CSIPHeaderBase: |
|
140 // ----------------------------------------------------------------------------- |
|
141 // |
|
142 EXPORT_C HBufC8* CSIPAuthenticationInfoHeader::ToTextValueL () const |
|
143 { |
|
144 HBufC8* value = iParams->ToTextLC(); |
|
145 CleanupStack::Pop(value); |
|
146 return value; |
|
147 } |
|
148 |
|
149 // ----------------------------------------------------------------------------- |
|
150 // CSIPAuthenticationInfoHeader::BaseDecodeL |
|
151 // ----------------------------------------------------------------------------- |
|
152 // |
|
153 RPointerArray<CSIPHeaderBase> |
|
154 CSIPAuthenticationInfoHeader::BaseDecodeL(const TDesC8& aValue) |
|
155 { |
|
156 CSIPAuthenticationInfoHeader* header = |
|
157 new(ELeave)CSIPAuthenticationInfoHeader; |
|
158 CleanupStack::PushL(header); |
|
159 header->ConstructL(aValue); |
|
160 RPointerArray<CSIPHeaderBase> headers; |
|
161 User::LeaveIfError (headers.Append(header)); |
|
162 CleanupStack::Pop(header); |
|
163 return headers; |
|
164 } |
|
165 |
|
166 // ----------------------------------------------------------------------------- |
|
167 // CSIPAuthenticationInfoHeader::EncodeMultipleToOneLine |
|
168 // From CSIPHeaderBase: |
|
169 // ----------------------------------------------------------------------------- |
|
170 // |
|
171 TBool CSIPAuthenticationInfoHeader::EncodeMultipleToOneLine() const |
|
172 { |
|
173 return EFalse; |
|
174 } |
|
175 |
|
176 // ----------------------------------------------------------------------------- |
|
177 // CSIPAuthenticationInfoHeader::PreferredPlaceInMessage |
|
178 // From CSIPHeaderBase: |
|
179 // ----------------------------------------------------------------------------- |
|
180 // |
|
181 CSIPHeaderBase::TPreferredPlace |
|
182 CSIPAuthenticationInfoHeader::PreferredPlaceInMessage () const |
|
183 { |
|
184 return CSIPHeaderBase::EMiddleBottom; |
|
185 } |