1.1 --- a/epoc32/include/authority8.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/authority8.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,178 @@
1.4 -authority8.h
1.5 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +// This file contains the API definition for the classes TAuthorityC8 and
1.19 +// CAuthority8. These classes provide non-modifying (TAuthorityC8) and
1.20 +// modifying (CAuthority8) functionality for the components of an
1.21 +// Authority as described in RFC2396.
1.22 +//
1.23 +//
1.24 +
1.25 +
1.26 +
1.27 +/**
1.28 + @file Authority8.h
1.29 + @publishedAll
1.30 + @released
1.31 +*/
1.32 +
1.33 +#ifndef __AUTHORITY8_H__
1.34 +#define __AUTHORITY8_H__
1.35 +
1.36 +// System includes
1.37 +//
1.38 +#include <e32base.h>
1.39 +#include <authoritycommon.h>
1.40 +
1.41 +
1.42 +/**
1.43 +Dependencies : TAuthorityComponent.
1.44 +Comments : Provides non-modifying functionality on the components of an authority
1.45 +object as defined in RFC2396. There are 3 components; userinfo, host and port.
1.46 +
1.47 +The object holds descriptor pointers to the parsed authority components and a descriptor
1.48 +pointer to the authority. It is non-owning. It uses 8-bit descriptors.
1.49 +
1.50 +The functionality provided by this API allows the authority components to be extracted
1.51 +from the parsed authority, checked for their presence in the authority and be compared
1.52 +with those in another TAuthorityC8 object.
1.53 +@publishedAll
1.54 +@released
1.55 +@since 6.0
1.56 +*/
1.57 +class TAuthorityC8
1.58 + {
1.59 +public: // Methods
1.60 +
1.61 + IMPORT_C const TDesC8& Extract(TAuthorityComponent aComponent) const;
1.62 + IMPORT_C TBool IsPresent(TAuthorityComponent aComponent) const;
1.63 + IMPORT_C TInt Compare(const TAuthorityC8& aAuthority, TAuthorityComponent aComponent) const;
1.64 + IMPORT_C const TDesC8& AuthorityDes() const;
1.65 + IMPORT_C HBufC* DisplayFormL(TAuthorityComponent aComponent = EAuthorityComplete ) const;
1.66 +
1.67 +protected: // Methods
1.68 +
1.69 + IMPORT_C TAuthorityC8();
1.70 + void Reset();
1.71 +
1.72 +protected: // Attributes
1.73 +
1.74 + /**
1.75 + The array of descriptor pointers to the authority components.
1.76 + */
1.77 + TPtrC8 iComponent[EAuthorityMaxComponents];
1.78 +
1.79 + /**
1.80 + The descriptor pointer to the authority.
1.81 + */
1.82 + TPtrC8 iAuthorityDes;
1.83 +
1.84 +/**
1.85 + A friend class.
1.86 + @see CAuthority8
1.87 + @since 6.0
1.88 + */
1.89 + friend class CAuthority8;
1.90 +
1.91 +/**
1.92 + A friend class used for testing.
1.93 + @see TAuthorityC8StateAccessor
1.94 + @since 6.0
1.95 + */
1.96 + friend class TAuthorityC8StateAccessor;
1.97 +
1.98 + };
1.99 +
1.100 +/**
1.101 +Dependencies : TAuthorityC8
1.102 +Comments : Provides functionality to parse a descriptor into the components of an
1.103 +authority as defined in RFC2396. There are 3 components; userinfo, host and port.
1.104 +
1.105 +This uses 8-bit descriptors.
1.106 +
1.107 +
1.108 +Format of an authority is; [userinfo@]host[:port]
1.109 +
1.110 +@warning The descriptor that is parsed by an object of this class will be referenced
1.111 +by that object. If the original descriptor is no longer in scope there will be undefined
1.112 +behaviour.
1.113 +@publishedAll
1.114 +@released
1.115 +@since 6.0
1.116 +*/
1.117 +class TAuthorityParser8 : public TAuthorityC8
1.118 + {
1.119 +public: // Methods
1.120 +
1.121 + IMPORT_C TAuthorityParser8();
1.122 + IMPORT_C TInt Parse(const TDesC8& aAuthority);
1.123 +
1.124 + };
1.125 +
1.126 +/**
1.127 +Dependencies : CBase, TAuthorityC8.
1.128 +Comments : Provides modifying functionality on the components of an authority object, as
1.129 +defined in RFC2396. There are 3 components; userinfo, host and port.
1.130 +
1.131 +The object holds parsed authority information. It is owning. It uses 8-bit descriptors.
1.132 +
1.133 +The functionality provided by this API allows the authority components to be set or removed
1.134 +from this parsed authority. Also, it provides a reference to TAuthorityC8 object so that
1.135 +the non-modifying functionality can be used.
1.136 +@publishedAll
1.137 +@released
1.138 +@since 6.0
1.139 +*/
1.140 +class CAuthority8 : public CBase
1.141 + {
1.142 +public: // Methods
1.143 +
1.144 + IMPORT_C static CAuthority8* NewL(const TAuthorityC8& aAuthority);
1.145 + IMPORT_C static CAuthority8* NewLC(const TAuthorityC8& aAuthority);
1.146 + IMPORT_C static CAuthority8* NewL();
1.147 + IMPORT_C static CAuthority8* NewLC();
1.148 + IMPORT_C ~CAuthority8();
1.149 +
1.150 + IMPORT_C const TAuthorityC8& Authority() const;
1.151 + IMPORT_C void SetComponentL(const TDesC8& aData, TAuthorityComponent aComponent);
1.152 + IMPORT_C void SetAndEscapeComponentL(const TDesC8& aData, TAuthorityComponent aComponent);
1.153 + IMPORT_C void RemoveComponentL(TAuthorityComponent aComponent);
1.154 +
1.155 +private: // Methods
1.156 +
1.157 + CAuthority8(const TAuthorityC8& aAuthority);
1.158 + void ConstructL();
1.159 + void FormAuthorityL();
1.160 +
1.161 +private: // Attributes
1.162 +
1.163 + /**
1.164 + The descriptor buffer that contains the authority.
1.165 + */
1.166 + HBufC8* iAuthorityBuf;
1.167 +
1.168 + /**
1.169 + The parsed authority object.
1.170 + */
1.171 + TAuthorityC8 iAuthority;
1.172 +
1.173 +/**
1.174 + A friend class used for testing.
1.175 + @see TAuthority8StateAccessor
1.176 + @since 6.0
1.177 + */
1.178 + friend class TAuthority8StateAccessor;
1.179 +
1.180 + };
1.181 +
1.182 +#endif // __AUTHORITY8_H__