os/ossrv/genericservices/httputils/Test/t_uriparser/UriAndAuthorityTestCommon.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2001-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 #ifndef __URIANDAUTHORITYTESTCOMMON_H__
    17 #define __URIANDAUTHORITYTESTCOMMON_H__
    18 
    19 // System includes
    20 //
    21 #include <e32base.h>
    22 
    23 template<class TUriParserType, class TDesCType>
    24 TInt DoUriComponentExtraction(const TDesCType& aUri, const TDesCType& aScheme,
    25 									  const TDesCType& aUserinfo, const TDesCType& aHost,
    26 									  const TDesCType& aPort, const TDesCType& aPath,
    27 									  const TDesCType& aQuery, const TDesCType& aFragment);
    28 
    29 void DoUriComponentExtractionL(const TDesC& aUri, const TDesC& aScheme,
    30 									  const TDesC& aUserinfo, const TDesC& aHost,
    31 									  const TDesC& aPort, const TDesC& aPath,
    32 									  const TDesC& aQuery, const TDesC& aFragment);
    33 
    34 template<class TAuthorityParserType, class TDesCType>
    35 TInt DoAuthorityComponentExtraction(const TDesCType& aAuthority, const TDesCType& aUserInfo, 
    36 											 const TDesCType& aHost, const TDesCType& aPort);
    37 
    38 void DoAuthorityComponentExtractionL(const TDesC& aAuthority, const TDesC& aUserInfo, 
    39 											 const TDesC& aHost, const TDesC& aPort);
    40 
    41 
    42 template<class TUriParserType, class CUriType, class TDesCType>
    43 TInt DoTestResolve(const TDesCType& aBase, const TDesCType& aReference, const TDesCType& aExpected);
    44 
    45 template<class TUriParserType, class TDesCType>
    46 TInt DoUriCompare(const TDesCType& aUri1, const TDesCType& aUri2, TInt aMatchFlags);
    47 
    48 // Compares the specific component against what is expected. The parser object is
    49 // assumed to the been parsed already, otherwise it panics.
    50 //
    51 // In:
    52 // aParser			- parsed parser object
    53 // aExpected		- the expected component value
    54 // aComponent		- the specific component
    55 //
    56 // Rtn: the result of the comparision - 0 is a match, non-zero is not a match.
    57 //
    58 template<class TParserType, class TDesCType, class TComponentType>
    59 TInt TestComponent(const TParserType& aParser, const TDesCType& aExpected, TComponentType aComponent);
    60 
    61 template<class TParserType, class TComponentType>
    62 TInt TestCompare(const TParserType& aFull, const TParserType& aPartial, TComponentType aComponent);
    63 
    64 template<class TAuthorityParserType, class TDesCType>
    65 TInt DoAuthorityCompare(const TDesCType& aAuthority1, const TDesCType& aAuthority2, TInt aMatchFlags);
    66 
    67 template<class TUriParserType, class TDesCType>
    68 TInt DoUriComponentPresence(const TDesCType& aUri, TInt aPresenceFlags);
    69 
    70 template<class TAuthorityParserType, class TDesCType>
    71 TInt DoAuthorityComponentPresence(const TDesCType& aAuthority, TInt aPresenceFlags);
    72 
    73 template<class TParserType, class TComponentType>
    74 TInt TestPresence(const TParserType& aData, TComponentType aComponent, TBool aExpectedPresence);
    75 
    76 template<class TUriParserType, class TDesCType>
    77 TInt DoUriDes(const TDesCType& aUri);
    78 
    79 void DoUriDesL(const TDesC& aUri);
    80 
    81 template<class TUriParserType, class TDesCType>
    82 TInt DoCompareUriDes(const TUriParserType& aParser, const TDesCType& aExpected);
    83 
    84 template<class TAuthorityParserType, class TDesCType>
    85 TInt DoAuthorityDes(const TDesCType& aAuthority);
    86 
    87 void DoAuthorityDesL(const TDesC& aAuthority);
    88 
    89 template<class TUriParserType, class TDesCType>
    90 TInt DoUriSchemeValidation(const TDesCType& aUri, TBool aValidScheme);
    91 
    92 template<class TUriParserType, class TPtrCType, class TDesCType>
    93 TInt DoUriWithoutFragment(const TDesCType& aUri, const TDesCType& aExpected);
    94 
    95 template<class CUriType, class TDesCType>
    96 TInt DoUriConstruction(const TDesCType& aUri_Scheme, const TDesCType& aUri_Host, const TDesCType& aUri_Userinfo, 
    97 							   const TDesCType& aUri_Port, const TDesCType& aUri_Path, const TDesCType& aUri_Query, 
    98 							   const TDesCType& aUri_Fragment, const TDesCType& aScheme, const TDesCType& aHost, 
    99 							   const TDesCType& aUserinfo, const TDesCType& aPort, const TDesCType& aPath, 
   100 							   const TDesCType& aQuery, const TDesCType& aFragment);
   101 
   102 template<class CUriType,  class TDesCType>
   103 TInt DoUriSetAndCompareComponent(CUriType aUri, TUriComponent aComponent, const TDesCType& aData, const TDesCType& aExpected);
   104 
   105 template<class CUriType, class TUriParserType, class TDesCType>
   106 TInt DoUriDestruction(const TDesCType& aUri_NoScheme, const TDesCType& aUri_NoHost, const TDesCType& aUri_NoUserinfo, 
   107 							  const TDesCType& aUri_NoPort, const TDesCType& aUri_NoPath, const TDesCType& aUri_NoQuery, 
   108 							  const TDesCType& aUri_NoFragment, const TDesCType& aUri_Whole);
   109 
   110 template<class CUriType, class TDesCType>
   111 TInt DoUriRemoveAndCompareComponent(CUriType* aUri, TUriComponent aComponent, const TDesCType& aExpected);
   112 
   113 template<class CAuthorityType, class TDesCType>
   114 TInt DoAuthorityConstruction(const TDesCType& aAuthority_Host, const TDesCType& aAuthority_Userinfo, const TDesCType& aAuthority_Port, 
   115 							   const TDesCType& aHost, const TDesCType& aUserinfo, const TDesCType& aPort);
   116 
   117 template<class CAuthorityType, class TDesCType>
   118 TInt DoAuthoritySetAndCompareComponent(CAuthorityType* aUri, TAuthorityComponent aComponent, const TDesCType& aData, const TDesCType& aExpected);
   119 
   120 template<class CAuthorityType, class TDesCType>
   121 TInt DoAuthorityEscapedConstruction(const TDesCType& aAuthority_Host, const TDesCType& aAuthority_Userinfo, const TDesCType& aAuthority_Port, 
   122 											const TDesCType& aHost, const TDesCType& aUserinfo, const TDesCType& aPort);
   123 
   124 template<class CAuthorityType, class TDesCType>
   125 TInt DoAuthoritySetAndEscapeAndCompareComponent(CAuthorityType* aAuthority, TAuthorityComponent aComponent, const TDesCType& aData, const TDesCType& aExpected);
   126 
   127 template<class CAuthorityType, class TAuthorityParserType, class TDesCType>
   128 TInt DoAuthorityDestruction(const TDesCType& aAuthority_NoHost, const TDesCType& aAuthority_NoUserinfo, 
   129 									const TDesCType& aAuthority_NoPort, const TDesCType& aAuthority_Whole);
   130 
   131 template<class CAuthorityType, class TDesCType>
   132 TInt DoAuthorityRemoveAndCompareComponent(CAuthorityType* aAuthority, TAuthorityComponent aComponent, const TDesCType& aExpected);
   133 
   134 #endif	// __URIANDAUTHORITYTESTCOMMON_H__