os/ossrv/genericservices/httputils/internetdateutils/tinternetdateparser.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericservices/httputils/internetdateutils/tinternetdateparser.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,66 @@
     1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// This file contains the definition of internal classes used to parse TInternetDate data
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +/**
    1.22 + @file tinternetdateparser.h
    1.23 +*/
    1.24 +
    1.25 +
    1.26 +#ifndef		__TINTERNETDATEPARSER_H__
    1.27 +#define		__TINTERNETDATEPARSER_H__
    1.28 +
    1.29 +#include <e32std.h>
    1.30 +
    1.31 +/**
    1.32 +	Used as a support class of TInternetDate. This provides the implementation of parsing
    1.33 +
    1.34 +	Supports parsing of the following date formats:
    1.35 +	Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
    1.36 +    Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
    1.37 +    Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
    1.38 +
    1.39 +	All dates are store relative to Universal Time and not local time. 
    1.40 +
    1.41 +	@internalAll
    1.42 +	@since 7.0
    1.43 +*/
    1.44 +class TInternetDateParser
    1.45 +	{
    1.46 +public:
    1.47 +	inline TInternetDateParser();
    1.48 +		
    1.49 +	void ConvertFromInternetFormL(const TDesC8& aInternetTextDateTime, TDateTime& aDateTime);
    1.50 +
    1.51 +	HBufC8* ConvertToRfc1123FormL(const TDateTime& aDateTime);
    1.52 +private:
    1.53 +
    1.54 +	void ConvertFromRfc1123And850FormL(const TDesC8& aRfc1123DateTime, TDateTime& aDateTime);
    1.55 +	void ConvertFromAscTimeFormL(const TDesC8& aAscTimeDateTime, TDateTime& aDateTime);
    1.56 +	TInt ParseRfcDateDayMonthYearL(const TDesC8& aDateTimeText, TDateTime& aDateTime);
    1.57 +	TMonth GetMonthL(const TDesC8& aMonthText);
    1.58 +	void ParseHHMMSSTimeL(const TDesC8& aDateTimeText, TDateTime& aDateTime);
    1.59 +	void ParseTimeOffsetL(const TDesC8& aTimeOffset, TTimeIntervalMinutes& aOffsetMinutes);
    1.60 +	void ParseHHMMTimeOffsetL(const TDesC8& aTimeOffset, TTimeIntervalMinutes& aOffsetMinutes);
    1.61 +	};
    1.62 +
    1.63 +
    1.64 +inline TInternetDateParser::TInternetDateParser()
    1.65 +	{}
    1.66 +
    1.67 +
    1.68 +
    1.69 +#endif	//	__TINTERNETDATEPARSER_H__