|
1 /** @file |
|
2 * Copyright (c) 2007 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: Represents one header in transferred file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "httpheader.h" |
|
21 |
|
22 // ======== MEMBER FUNCTIONS ======== |
|
23 |
|
24 // -------------------------------------------------------------------------- |
|
25 // CHttpHeader::CHttpHeader() |
|
26 // -------------------------------------------------------------------------- |
|
27 // |
|
28 CHttpHeader::CHttpHeader() |
|
29 { |
|
30 iFieldName = NULL; |
|
31 iFieldValue = NULL; |
|
32 } |
|
33 |
|
34 // -------------------------------------------------------------------------- |
|
35 // CHttpHeader::~CHttpHeader() |
|
36 // -------------------------------------------------------------------------- |
|
37 // |
|
38 CHttpHeader::~CHttpHeader() |
|
39 { |
|
40 delete iFieldName; |
|
41 delete iFieldValue; |
|
42 } |
|
43 |
|
44 // -------------------------------------------------------------------------- |
|
45 // CHttpHeader::ConstructL() |
|
46 // -------------------------------------------------------------------------- |
|
47 // |
|
48 void CHttpHeader::ConstructL( const TDesC8& aFieldName, |
|
49 const TDesC8& aFieldValue ) |
|
50 { |
|
51 iFieldName = aFieldName.AllocL(); |
|
52 iFieldValue = aFieldValue.AllocL(); |
|
53 } |
|
54 |
|
55 // -------------------------------------------------------------------------- |
|
56 // CHttpHeader::NewL() |
|
57 // -------------------------------------------------------------------------- |
|
58 // |
|
59 CHttpHeader* CHttpHeader::NewL( const TDesC8& aFieldName, |
|
60 const TDesC8& aFieldValue ) |
|
61 { |
|
62 CHttpHeader* self = new( ELeave ) CHttpHeader(); |
|
63 CleanupStack::PushL( self ); |
|
64 self->ConstructL( aFieldName, aFieldValue ); |
|
65 CleanupStack::Pop( self ); |
|
66 return self; |
|
67 } |
|
68 |
|
69 // -------------------------------------------------------------------------- |
|
70 // CHttpHeader::FieldName() |
|
71 // -------------------------------------------------------------------------- |
|
72 // |
|
73 const TDesC8& CHttpHeader::FieldName() |
|
74 { |
|
75 return *iFieldName; |
|
76 } |
|
77 |
|
78 // -------------------------------------------------------------------------- |
|
79 // CHttpHeader::FieldValue() |
|
80 // -------------------------------------------------------------------------- |
|
81 // |
|
82 const TDesC8& CHttpHeader::FieldValue() |
|
83 { |
|
84 return *iFieldValue; |
|
85 } |
|
86 |
|
87 // end of file |