99 // |
99 // |
100 const TDesC8& CRoapResponse::ProtocolUnit() const |
100 const TDesC8& CRoapResponse::ProtocolUnit() const |
101 { |
101 { |
102 return *iPdu; |
102 return *iPdu; |
103 } |
103 } |
104 |
104 |
105 // ----------------------------------------------------------------------------- |
105 // ----------------------------------------------------------------------------- |
106 // CRoapResponse::PduFileName() |
106 // CRoapResponse::PduFileName() |
107 // ----------------------------------------------------------------------------- |
107 // ----------------------------------------------------------------------------- |
108 // |
108 // |
109 const TFileName& CRoapResponse::DcfFileName() const |
109 const TFileName& CRoapResponse::DcfFileName() const |
110 { |
110 { |
111 return iDcfFileName; |
111 return iDcfFileName; |
112 } |
112 } |
113 |
113 |
114 // ----------------------------------------------------------------------------- |
114 // ----------------------------------------------------------------------------- |
115 // CRoapResponse::SetPduFileName() |
115 // CRoapResponse::SetPduFileName() |
116 // ----------------------------------------------------------------------------- |
116 // ----------------------------------------------------------------------------- |
117 // |
117 // |
118 void CRoapResponse::SetDcfPathL( |
118 void CRoapResponse::SetDcfPathL( |
119 const TPath& aPath ) |
119 const TPath& aPath ) |
120 { |
120 { |
121 LOG( _L("CRoapResponse::SetDcfPathL->") ); |
121 LOG( _L("CRoapResponse::SetDcfPathL->") ); |
122 |
122 |
123 RFs fs; |
123 RFs fs; |
124 RFile file; |
124 RFile file; |
125 User::LeaveIfError( fs.Connect() ); |
125 User::LeaveIfError( fs.Connect() ); |
126 CleanupClosePushL( fs ); |
126 CleanupClosePushL( fs ); |
127 |
127 |
128 if ( aPath.Length() > 3 ) |
128 if ( aPath.Length() > 3 ) |
129 { |
129 { |
130 User::LeaveIfError( file.Temp( fs, aPath, iDcfFileName, |
130 User::LeaveIfError( file.Temp( fs, aPath, iDcfFileName, |
131 EFileShareExclusive | EFileWrite ) ); |
131 EFileShareExclusive | EFileWrite ) ); |
132 } |
132 } |
133 else |
133 else |
134 { |
134 { |
135 |
135 |
136 #ifndef RD_MULTIPLE_DRIVE |
136 #ifndef RD_MULTIPLE_DRIVE |
137 |
137 |
138 User::LeaveIfError( file.Temp( fs, KMultipartPduTempPath(), iDcfFileName, |
138 User::LeaveIfError( file.Temp( fs, KMultipartPduTempPath(), iDcfFileName, |
139 EFileShareExclusive | EFileWrite ) ); |
139 EFileShareExclusive | EFileWrite ) ); |
140 |
140 |
141 #else //RD_MULTIPLE_DRIVE |
141 #else //RD_MULTIPLE_DRIVE |
142 |
142 |
143 _LIT( KDriveRoot, "%c:\\"); |
143 _LIT( KDriveRoot, "%c:\\"); |
144 TInt driveNumber( -1 ); |
144 TInt driveNumber( -1 ); |
145 TChar driveLetter; |
145 TChar driveLetter; |
146 DriveInfo::GetDefaultDrive( DriveInfo::EDefaultSystem, driveNumber ); |
146 DriveInfo::GetDefaultDrive( DriveInfo::EDefaultSystem, driveNumber ); |
147 fs.DriveToChar( driveNumber, driveLetter ); |
147 fs.DriveToChar( driveNumber, driveLetter ); |
148 |
148 |
149 TFileName multipartTemp; |
149 TFileName multipartTemp; |
150 multipartTemp.Format( KDriveRoot, (TUint)driveLetter ); |
150 multipartTemp.Format( KDriveRoot, (TUint)driveLetter ); |
151 |
151 |
152 User::LeaveIfError( file.Temp( fs, multipartTemp, iDcfFileName, |
152 User::LeaveIfError( file.Temp( fs, multipartTemp, iDcfFileName, |
153 EFileShareExclusive | EFileWrite ) ); |
153 EFileShareExclusive | EFileWrite ) ); |
154 |
154 |
155 #endif |
155 #endif |
156 } |
156 } |
157 LOG2( _L("iDcfFileName: %S"), &iDcfFileName ); |
157 LOG2( _L("iDcfFileName: %S"), &iDcfFileName ); |
158 |
158 |
159 file.Close(); |
159 file.Close(); |
160 CleanupStack::PopAndDestroy(); |
160 CleanupStack::PopAndDestroy(); |
161 LOG( _L("CRoapResponse::SetDcfFileName <-") ); |
161 LOG( _L("CRoapResponse::SetDcfFileName <-") ); |
162 } |
162 } |
163 |
163 |
164 // ----------------------------------------------------------------------------- |
164 // ----------------------------------------------------------------------------- |
165 // CRoapResponse::AppendPduFileDataL() |
165 // CRoapResponse::AppendPduFileDataL() |
166 // ----------------------------------------------------------------------------- |
166 // ----------------------------------------------------------------------------- |
167 // |
167 // |
168 void CRoapResponse::AppendMultipartDataL( |
168 void CRoapResponse::AppendMultipartDataL( |
169 const TDesC8& aData ) |
169 const TDesC8& aData ) |
170 { |
170 { |
171 WriteL( aData ); |
171 WriteL( aData ); |
172 } |
172 } |
173 |
173 |
174 // --------------------------------------------------------- |
174 // --------------------------------------------------------- |
175 // CRoapResponse::DataType() |
175 // CRoapResponse::DataType() |
176 // --------------------------------------------------------- |
176 // --------------------------------------------------------- |
177 // |
177 // |
178 const TDataType& CRoapResponse::DataType() const |
178 const TDataType& CRoapResponse::DataType() const |
238 LOG( _L("CRoapResponse::StartBodyPartL <-") ); |
238 LOG( _L("CRoapResponse::StartBodyPartL <-") ); |
239 } |
239 } |
240 |
240 |
241 // ----------------------------------------------------------------------------- |
241 // ----------------------------------------------------------------------------- |
242 // CRoapResponse::EndBodyPartL |
242 // CRoapResponse::EndBodyPartL |
243 // |
243 // |
244 // ----------------------------------------------------------------------------- |
244 // ----------------------------------------------------------------------------- |
245 // |
245 // |
246 void CRoapResponse::EndBodyPartL() |
246 void CRoapResponse::EndBodyPartL() |
247 { |
247 { |
248 LOG( _L("CRoapResponse::EndBodyPartL ->") ); |
248 LOG( _L("CRoapResponse::EndBodyPartL ->") ); |
249 LOG( _L("CRoapResponse::EndBodyPartL <-") ); |
249 LOG( _L("CRoapResponse::EndBodyPartL <-") ); |
250 } |
250 } |
251 |
251 |
252 // ----------------------------------------------------------------------------- |
252 // ----------------------------------------------------------------------------- |
253 // CRoapResponse::SetContentNameL |
253 // CRoapResponse::SetContentNameL |
254 // |
254 // |
255 // ----------------------------------------------------------------------------- |
255 // ----------------------------------------------------------------------------- |
256 // |
256 // |
257 void CRoapResponse::SetContentNameL( const TDes& aName ) |
257 void CRoapResponse::SetContentNameL( const TDes& aName ) |
258 { |
258 { |
259 LOG( _L("CRoapResponse::SetContentNameL") ); |
259 LOG( _L("CRoapResponse::SetContentNameL") ); |
260 |
260 |
261 delete iContentName; |
261 delete iContentName; |
262 iContentName = NULL; |
262 iContentName = NULL; |
263 |
263 |
264 iContentName = aName.AllocL(); |
264 iContentName = aName.AllocL(); |
265 } |
265 } |
266 |
266 |
267 |
267 |
268 // ----------------------------------------------------------------------------- |
268 // ----------------------------------------------------------------------------- |
269 // CRoapResponse::GetContentNameLC |
269 // CRoapResponse::GetContentNameLC |
270 // |
270 // |
271 // ----------------------------------------------------------------------------- |
271 // ----------------------------------------------------------------------------- |
272 // |
272 // |
273 void CRoapResponse::GetContentNameLC( HBufC*& aName ) const |
273 void CRoapResponse::GetContentNameLC( HBufC*& aName ) const |
274 { |
274 { |
275 LOG( _L("CRoapResponse::GetContentName") ); |
275 LOG( _L("CRoapResponse::GetContentName") ); |
276 |
276 |
277 if ( iContentName ) |
277 if ( iContentName ) |
278 aName = iContentName->AllocLC(); |
278 aName = iContentName->AllocLC(); |
279 else |
279 else |
280 aName = NULL; |
280 aName = NULL; |
281 } |
281 } |
282 // ----------------------------------------------------------------------------- |
282 // ----------------------------------------------------------------------------- |
283 // CRoapResponse::SetMaxSize |
283 // CRoapResponse::SetMaxSize |
284 // |
284 // |
285 // ----------------------------------------------------------------------------- |
285 // ----------------------------------------------------------------------------- |
286 // |
286 // |
287 void CRoapResponse::SetMaxSize( const TInt& aSize ) |
287 void CRoapResponse::SetMaxSize( const TInt& aSize ) |
288 { |
288 { |
289 LOG( _L("CRoapResponse::SetMaxSize") ); |
289 LOG( _L("CRoapResponse::SetMaxSize") ); |
290 |
290 |
291 iMaxSize = aSize; |
291 iMaxSize = aSize; |
292 } |
292 } |
293 |
293 |
294 |
294 |
295 // ----------------------------------------------------------------------------- |
295 // ----------------------------------------------------------------------------- |
296 // CRoapResponse::MaxSize |
296 // CRoapResponse::MaxSize |
297 // |
297 // |
298 // ----------------------------------------------------------------------------- |
298 // ----------------------------------------------------------------------------- |
299 // |
299 // |
300 TInt CRoapResponse::MaxSize() const |
300 TInt CRoapResponse::MaxSize() const |
301 { |
301 { |
302 LOG( _L("CRoapResponse::MaxSize") ); |
302 LOG( _L("CRoapResponse::MaxSize") ); |
303 |
303 |
304 return iMaxSize; |
304 return iMaxSize; |
305 } |
305 } |