netprotocols_plat/cookie_manager_api/inc/cookie.h
changeset 27 974c3ee9bf20
parent 16 cb0c8a2aff2d
equal deleted inserted replaced
23:ea9c9681bbaf 27:974c3ee9bf20
    28 
    28 
    29 // FORWARD DECLARATIONS
    29 // FORWARD DECLARATIONS
    30 
    30 
    31 class RHTTPHeaders;
    31 class RHTTPHeaders;
    32 class TUriC8;
    32 class TUriC8;
    33 
    33 class TDesC8;
    34 // CONSTANTS
    34 // CONSTANTS
    35 
    35 
    36 // Attribute prefix : we have to pack cookies when either passing them over
    36 // Attribute prefix : we have to pack cookies when either passing them over
    37 // client-server boundaries or writing them into a file. When this happens we
    37 // client-server boundaries or writing them into a file. When this happens we
    38 // put each attribute of a cookie in the destination buffer as follows :
    38 // put each attribute of a cookie in the destination buffer as follows :
    75 							// Netscape cookies only
    75 							// Netscape cookies only
    76             EDate,          // Date when the response header containing the 
    76             EDate,          // Date when the response header containing the 
    77                             // cookie was generated. It is important to know it 
    77                             // cookie was generated. It is important to know it 
    78                             // for correct age calculation.
    78                             // for correct age calculation.
    79             //EAge,           // The age of the cookie as estimated by the cache
    79             //EAge,           // The age of the cookie as estimated by the cache
       
    80             ELastAttribute
    80 			};
    81 			};
    81 
    82 
    82 	public :	// exported methods
    83 	public :	// exported methods
    83 		/**
    84 		/**
    84 		* Constructor.
    85 		* Constructor.
   237 		
   238 		
   238         /**
   239         /**
   239         * Copy from an already existing one.
   240         * Copy from an already existing one.
   240         * @param aCopyFrom The already existing CCookie object
   241         * @param aCopyFrom The already existing CCookie object
   241         */
   242         */
   242         void CopyFromL( const CCookie& aCopyFrom  );
   243         void CopyFromL( const CCookie& aCopyFrom, const TDesC8& aDomain, const TDesC8& aPath, const TDesC8& aPort  );
   243 
   244 
   244         /**
   245         /**
   245         * Returns this cookie's StringPool.
   246         * Returns this cookie's StringPool.
   246         */
   247         */
   247         RStringPool StringPool();
   248         RStringPool StringPool();
   264         /**
   265         /**
   265         * Returns whether the cookie's Version attribute is known or not.
   266         * Returns whether the cookie's Version attribute is known or not.
   266         * @return TBool indicating the cookies's Version attribute's notoriety.
   267         * @return TBool indicating the cookies's Version attribute's notoriety.
   267         */
   268         */
   268         TBool IsUnknownVersion() const;
   269         TBool IsUnknownVersion() const;
   269 
   270         static CCookie* CloneL( const CCookie& aCopy,const TDesC8& aDomain, const TDesC8& aPath, const TDesC8& aPort);
   270 
   271 
   271 	private :	// class for internal use
   272 	private :	// class for internal use
   272         /**
   273         /**
   273         * Determines if the cookie had expired in case of Netscape style
   274         * Determines if the cookie had expired in case of Netscape style
   274         * Method may leave with 
   275         * Method may leave with 
   276         *   KErrNotFound, if parsing the date string fails (not a well formed string)
   277         *   KErrNotFound, if parsing the date string fails (not a well formed string)
   277         * @param aAttrVal The THTTPHdrVal holding the Expires date as a string
   278         * @param aAttrVal The THTTPHdrVal holding the Expires date as a string
   278         * @return A TBool holding the result
   279         * @return A TBool holding the result
   279         */
   280         */
   280         TBool ExpiredNetscapeL( THTTPHdrVal aAttrVal ) const;
   281         TBool ExpiredNetscapeL( THTTPHdrVal aAttrVal ) const;
   281 
   282         
       
   283         /* For logging Cookie attributes
       
   284          * 
       
   285          */
       
   286         void Log( TInt aAssociatedId = 0 ) const;
   282         /**
   287         /**
   283         * Tokenize a string.
   288         * Tokenize a string.
   284         * @return actual number of tokens
   289         * @return actual number of tokens
   285         * @param aString string to be tokenized
   290         * @param aString string to be tokenized
   286         * @param aTokenSeparators separator characters
   291         * @param aTokenSeparators separator characters