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