genericservices/httputils/internetdateutils/tinternetdateparser.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     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 // This file contains the definition of internal classes used to parse TInternetDate data
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file tinternetdateparser.h
       
    20 */
       
    21 
       
    22 
       
    23 #ifndef		__TINTERNETDATEPARSER_H__
       
    24 #define		__TINTERNETDATEPARSER_H__
       
    25 
       
    26 #include <e32std.h>
       
    27 
       
    28 /**
       
    29 	Used as a support class of TInternetDate. This provides the implementation of parsing
       
    30 
       
    31 	Supports parsing of the following date formats:
       
    32 	Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
       
    33     Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
       
    34     Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
       
    35 
       
    36 	All dates are store relative to Universal Time and not local time. 
       
    37 
       
    38 	@internalAll
       
    39 	@since 7.0
       
    40 */
       
    41 class TInternetDateParser
       
    42 	{
       
    43 public:
       
    44 	inline TInternetDateParser();
       
    45 		
       
    46 	void ConvertFromInternetFormL(const TDesC8& aInternetTextDateTime, TDateTime& aDateTime);
       
    47 
       
    48 	HBufC8* ConvertToRfc1123FormL(const TDateTime& aDateTime);
       
    49 private:
       
    50 
       
    51 	void ConvertFromRfc1123And850FormL(const TDesC8& aRfc1123DateTime, TDateTime& aDateTime);
       
    52 	void ConvertFromAscTimeFormL(const TDesC8& aAscTimeDateTime, TDateTime& aDateTime);
       
    53 	TInt ParseRfcDateDayMonthYearL(const TDesC8& aDateTimeText, TDateTime& aDateTime);
       
    54 	TMonth GetMonthL(const TDesC8& aMonthText);
       
    55 	void ParseHHMMSSTimeL(const TDesC8& aDateTimeText, TDateTime& aDateTime);
       
    56 	void ParseTimeOffsetL(const TDesC8& aTimeOffset, TTimeIntervalMinutes& aOffsetMinutes);
       
    57 	void ParseHHMMTimeOffsetL(const TDesC8& aTimeOffset, TTimeIntervalMinutes& aOffsetMinutes);
       
    58 	};
       
    59 
       
    60 
       
    61 inline TInternetDateParser::TInternetDateParser()
       
    62 	{}
       
    63 
       
    64 
       
    65 
       
    66 #endif	//	__TINTERNETDATEPARSER_H__