sl@0
|
1 |
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __URIANDAUTHORITYTESTCOMMON_H__
|
sl@0
|
17 |
#define __URIANDAUTHORITYTESTCOMMON_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
// System includes
|
sl@0
|
20 |
//
|
sl@0
|
21 |
#include <e32base.h>
|
sl@0
|
22 |
|
sl@0
|
23 |
template<class TUriParserType, class TDesCType>
|
sl@0
|
24 |
TInt DoUriComponentExtraction(const TDesCType& aUri, const TDesCType& aScheme,
|
sl@0
|
25 |
const TDesCType& aUserinfo, const TDesCType& aHost,
|
sl@0
|
26 |
const TDesCType& aPort, const TDesCType& aPath,
|
sl@0
|
27 |
const TDesCType& aQuery, const TDesCType& aFragment);
|
sl@0
|
28 |
|
sl@0
|
29 |
void DoUriComponentExtractionL(const TDesC& aUri, const TDesC& aScheme,
|
sl@0
|
30 |
const TDesC& aUserinfo, const TDesC& aHost,
|
sl@0
|
31 |
const TDesC& aPort, const TDesC& aPath,
|
sl@0
|
32 |
const TDesC& aQuery, const TDesC& aFragment);
|
sl@0
|
33 |
|
sl@0
|
34 |
template<class TAuthorityParserType, class TDesCType>
|
sl@0
|
35 |
TInt DoAuthorityComponentExtraction(const TDesCType& aAuthority, const TDesCType& aUserInfo,
|
sl@0
|
36 |
const TDesCType& aHost, const TDesCType& aPort);
|
sl@0
|
37 |
|
sl@0
|
38 |
void DoAuthorityComponentExtractionL(const TDesC& aAuthority, const TDesC& aUserInfo,
|
sl@0
|
39 |
const TDesC& aHost, const TDesC& aPort);
|
sl@0
|
40 |
|
sl@0
|
41 |
|
sl@0
|
42 |
template<class TUriParserType, class CUriType, class TDesCType>
|
sl@0
|
43 |
TInt DoTestResolve(const TDesCType& aBase, const TDesCType& aReference, const TDesCType& aExpected);
|
sl@0
|
44 |
|
sl@0
|
45 |
template<class TUriParserType, class TDesCType>
|
sl@0
|
46 |
TInt DoUriCompare(const TDesCType& aUri1, const TDesCType& aUri2, TInt aMatchFlags);
|
sl@0
|
47 |
|
sl@0
|
48 |
// Compares the specific component against what is expected. The parser object is
|
sl@0
|
49 |
// assumed to the been parsed already, otherwise it panics.
|
sl@0
|
50 |
//
|
sl@0
|
51 |
// In:
|
sl@0
|
52 |
// aParser - parsed parser object
|
sl@0
|
53 |
// aExpected - the expected component value
|
sl@0
|
54 |
// aComponent - the specific component
|
sl@0
|
55 |
//
|
sl@0
|
56 |
// Rtn: the result of the comparision - 0 is a match, non-zero is not a match.
|
sl@0
|
57 |
//
|
sl@0
|
58 |
template<class TParserType, class TDesCType, class TComponentType>
|
sl@0
|
59 |
TInt TestComponent(const TParserType& aParser, const TDesCType& aExpected, TComponentType aComponent);
|
sl@0
|
60 |
|
sl@0
|
61 |
template<class TParserType, class TComponentType>
|
sl@0
|
62 |
TInt TestCompare(const TParserType& aFull, const TParserType& aPartial, TComponentType aComponent);
|
sl@0
|
63 |
|
sl@0
|
64 |
template<class TAuthorityParserType, class TDesCType>
|
sl@0
|
65 |
TInt DoAuthorityCompare(const TDesCType& aAuthority1, const TDesCType& aAuthority2, TInt aMatchFlags);
|
sl@0
|
66 |
|
sl@0
|
67 |
template<class TUriParserType, class TDesCType>
|
sl@0
|
68 |
TInt DoUriComponentPresence(const TDesCType& aUri, TInt aPresenceFlags);
|
sl@0
|
69 |
|
sl@0
|
70 |
template<class TAuthorityParserType, class TDesCType>
|
sl@0
|
71 |
TInt DoAuthorityComponentPresence(const TDesCType& aAuthority, TInt aPresenceFlags);
|
sl@0
|
72 |
|
sl@0
|
73 |
template<class TParserType, class TComponentType>
|
sl@0
|
74 |
TInt TestPresence(const TParserType& aData, TComponentType aComponent, TBool aExpectedPresence);
|
sl@0
|
75 |
|
sl@0
|
76 |
template<class TUriParserType, class TDesCType>
|
sl@0
|
77 |
TInt DoUriDes(const TDesCType& aUri);
|
sl@0
|
78 |
|
sl@0
|
79 |
void DoUriDesL(const TDesC& aUri);
|
sl@0
|
80 |
|
sl@0
|
81 |
template<class TUriParserType, class TDesCType>
|
sl@0
|
82 |
TInt DoCompareUriDes(const TUriParserType& aParser, const TDesCType& aExpected);
|
sl@0
|
83 |
|
sl@0
|
84 |
template<class TAuthorityParserType, class TDesCType>
|
sl@0
|
85 |
TInt DoAuthorityDes(const TDesCType& aAuthority);
|
sl@0
|
86 |
|
sl@0
|
87 |
void DoAuthorityDesL(const TDesC& aAuthority);
|
sl@0
|
88 |
|
sl@0
|
89 |
template<class TUriParserType, class TDesCType>
|
sl@0
|
90 |
TInt DoUriSchemeValidation(const TDesCType& aUri, TBool aValidScheme);
|
sl@0
|
91 |
|
sl@0
|
92 |
template<class TUriParserType, class TPtrCType, class TDesCType>
|
sl@0
|
93 |
TInt DoUriWithoutFragment(const TDesCType& aUri, const TDesCType& aExpected);
|
sl@0
|
94 |
|
sl@0
|
95 |
template<class CUriType, class TDesCType>
|
sl@0
|
96 |
TInt DoUriConstruction(const TDesCType& aUri_Scheme, const TDesCType& aUri_Host, const TDesCType& aUri_Userinfo,
|
sl@0
|
97 |
const TDesCType& aUri_Port, const TDesCType& aUri_Path, const TDesCType& aUri_Query,
|
sl@0
|
98 |
const TDesCType& aUri_Fragment, const TDesCType& aScheme, const TDesCType& aHost,
|
sl@0
|
99 |
const TDesCType& aUserinfo, const TDesCType& aPort, const TDesCType& aPath,
|
sl@0
|
100 |
const TDesCType& aQuery, const TDesCType& aFragment);
|
sl@0
|
101 |
|
sl@0
|
102 |
template<class CUriType, class TDesCType>
|
sl@0
|
103 |
TInt DoUriSetAndCompareComponent(CUriType aUri, TUriComponent aComponent, const TDesCType& aData, const TDesCType& aExpected);
|
sl@0
|
104 |
|
sl@0
|
105 |
template<class CUriType, class TUriParserType, class TDesCType>
|
sl@0
|
106 |
TInt DoUriDestruction(const TDesCType& aUri_NoScheme, const TDesCType& aUri_NoHost, const TDesCType& aUri_NoUserinfo,
|
sl@0
|
107 |
const TDesCType& aUri_NoPort, const TDesCType& aUri_NoPath, const TDesCType& aUri_NoQuery,
|
sl@0
|
108 |
const TDesCType& aUri_NoFragment, const TDesCType& aUri_Whole);
|
sl@0
|
109 |
|
sl@0
|
110 |
template<class CUriType, class TDesCType>
|
sl@0
|
111 |
TInt DoUriRemoveAndCompareComponent(CUriType* aUri, TUriComponent aComponent, const TDesCType& aExpected);
|
sl@0
|
112 |
|
sl@0
|
113 |
template<class CAuthorityType, class TDesCType>
|
sl@0
|
114 |
TInt DoAuthorityConstruction(const TDesCType& aAuthority_Host, const TDesCType& aAuthority_Userinfo, const TDesCType& aAuthority_Port,
|
sl@0
|
115 |
const TDesCType& aHost, const TDesCType& aUserinfo, const TDesCType& aPort);
|
sl@0
|
116 |
|
sl@0
|
117 |
template<class CAuthorityType, class TDesCType>
|
sl@0
|
118 |
TInt DoAuthoritySetAndCompareComponent(CAuthorityType* aUri, TAuthorityComponent aComponent, const TDesCType& aData, const TDesCType& aExpected);
|
sl@0
|
119 |
|
sl@0
|
120 |
template<class CAuthorityType, class TDesCType>
|
sl@0
|
121 |
TInt DoAuthorityEscapedConstruction(const TDesCType& aAuthority_Host, const TDesCType& aAuthority_Userinfo, const TDesCType& aAuthority_Port,
|
sl@0
|
122 |
const TDesCType& aHost, const TDesCType& aUserinfo, const TDesCType& aPort);
|
sl@0
|
123 |
|
sl@0
|
124 |
template<class CAuthorityType, class TDesCType>
|
sl@0
|
125 |
TInt DoAuthoritySetAndEscapeAndCompareComponent(CAuthorityType* aAuthority, TAuthorityComponent aComponent, const TDesCType& aData, const TDesCType& aExpected);
|
sl@0
|
126 |
|
sl@0
|
127 |
template<class CAuthorityType, class TAuthorityParserType, class TDesCType>
|
sl@0
|
128 |
TInt DoAuthorityDestruction(const TDesCType& aAuthority_NoHost, const TDesCType& aAuthority_NoUserinfo,
|
sl@0
|
129 |
const TDesCType& aAuthority_NoPort, const TDesCType& aAuthority_Whole);
|
sl@0
|
130 |
|
sl@0
|
131 |
template<class CAuthorityType, class TDesCType>
|
sl@0
|
132 |
TInt DoAuthorityRemoveAndCompareComponent(CAuthorityType* aAuthority, TAuthorityComponent aComponent, const TDesCType& aExpected);
|
sl@0
|
133 |
|
sl@0
|
134 |
#endif // __URIANDAUTHORITYTESTCOMMON_H__
|