|
1 /* |
|
2 * Copyright (c) 2003-2009 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: |
|
15 * Name : TTCPMsgState.h |
|
16 * Part of : ConnectionMgr |
|
17 * Version : SIP/4.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 #ifndef __TTCPMSGSTATE_H__ |
|
29 #define __TTCPMSGSTATE_H__ |
|
30 |
|
31 // INCLUDES |
|
32 #include <e32base.h> |
|
33 |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class MMsgAssemblerContext; |
|
37 |
|
38 /* |
|
39 * Base class for all TCP message states. |
|
40 */ |
|
41 class TTCPMsgState |
|
42 { |
|
43 public: |
|
44 virtual ~TTCPMsgState() {}; |
|
45 |
|
46 protected: |
|
47 |
|
48 TTCPMsgState(MMsgAssemblerContext& aMsgAssembler); |
|
49 |
|
50 public: |
|
51 |
|
52 virtual void DataReceivedL( TPtr8 aData, TUint& aNextLength ) = 0; |
|
53 |
|
54 protected: |
|
55 |
|
56 /** |
|
57 * find first sip message start position from the parameter data, |
|
58 * |
|
59 * @param aData TCP messages data received. |
|
60 * @return sip message header start postion if it could be found, |
|
61 * otherwise KErrNotFound. |
|
62 */ |
|
63 TInt FindHeaderStartPosition( TDesC8& aData ); |
|
64 |
|
65 /** |
|
66 * find first sip message end position from the parameter data, |
|
67 * |
|
68 * @param aData TCP messages data received. |
|
69 * @return sip message header end postion if it could be found, |
|
70 * otherwise KErrNotFound. |
|
71 */ |
|
72 TInt FindHeaderEndPosition( TDesC8& aData ); |
|
73 |
|
74 /** get header end position by compare it with the new header end |
|
75 * position currentlly found. |
|
76 */ |
|
77 void GetHeaderPartEndPosition ( TInt aEndMarkPosition, |
|
78 TInt aEndMarkLength, |
|
79 TInt& aHeaderEndPosition ); |
|
80 |
|
81 protected: |
|
82 MMsgAssemblerContext& iMsgAssembler; |
|
83 |
|
84 #ifdef CPPUNIT_TEST |
|
85 friend class CTCPMsgStatesTest; |
|
86 #endif |
|
87 }; |
|
88 |
|
89 #endif // end of __TTCPMSGSTATE_H__ |
|
90 |
|
91 // end of file |