|
1 // Copyright (c) 2006-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 #include "cimapmimeheaderfieldsparser.h" |
|
17 #include "cimapfetchbodyresponse.h" |
|
18 #include "cimapmimeheaderfields.h" |
|
19 |
|
20 CImapMimeHeaderFieldsParser* CImapMimeHeaderFieldsParser::NewL(CImapFetchBodyResponse& aFetchBodyResponse, TInt aLogId) |
|
21 { |
|
22 CImapMimeHeaderFieldsParser* self = NewLC(aFetchBodyResponse, aLogId); |
|
23 CleanupStack::Pop(); |
|
24 return self; |
|
25 } |
|
26 |
|
27 CImapMimeHeaderFieldsParser* CImapMimeHeaderFieldsParser::NewLC(CImapFetchBodyResponse& aFetchBodyResponse, TInt aLogId) |
|
28 { |
|
29 CImapMimeHeaderFieldsParser* self = new (ELeave) CImapMimeHeaderFieldsParser(aFetchBodyResponse, aLogId); |
|
30 CleanupStack::PushL(self); |
|
31 self->ConstructL(); |
|
32 return self; |
|
33 } |
|
34 |
|
35 CImapMimeHeaderFieldsParser::CImapMimeHeaderFieldsParser(CImapFetchBodyResponse& aFetchBodyResponse, TInt aLogId) : |
|
36 CImapHeaderFieldsParser(aLogId), |
|
37 iFetchBodyResponse(aFetchBodyResponse) |
|
38 { |
|
39 } |
|
40 |
|
41 void CImapMimeHeaderFieldsParser::ConstructL() |
|
42 { |
|
43 CImapMimeHeaderFields* headerFields = CImapMimeHeaderFields::NewL(); |
|
44 |
|
45 // Pass ownership of headerFields to base class |
|
46 CImapHeaderFieldsParser::Construct(headerFields); |
|
47 } |
|
48 |
|
49 CImapMimeHeaderFieldsParser::~CImapMimeHeaderFieldsParser() |
|
50 { |
|
51 } |
|
52 |
|
53 void CImapMimeHeaderFieldsParser::HeaderFieldsComplete(CImapHeaderFields* aHeaderFields) |
|
54 { |
|
55 iFetchBodyResponse.SetHeaderFields(static_cast<CImapMimeHeaderFields*> (aHeaderFields)); |
|
56 } |