epoc32/include/tinternetdate.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100 (2010-03-31)
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 // Copyright (c) 2002-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // This file contains the class TInternetDate
    15 // 
    16 //
    17 
    18 
    19 
    20 /**
    21  @file tinternetdate.h
    22  @publishedAll
    23  @released
    24 */
    25   
    26 
    27 #ifndef		__TINTERNETDATE_H__
    28 #define		__TINTERNETDATE_H__
    29 
    30 #include <e32std.h>
    31 
    32 /**
    33 Stores dates in universal time and provides parsing of internet style dates 
    34 into TDateTime and RFC 1123 (updates RFC 822) dates.
    35 
    36 Supports parsing of the following date formats:
    37 Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
    38 Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
    39 Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
    40 
    41 In case of Date Formats with offsets "Mon, 21 Jan 2002 23:00:00 +0210" , equivalent 
    42 time in UTC can be determined by substracting the offset from the local time (RFC 3339).
    43 
    44 All dates are store relative to Universal Time and not local time. 
    45 
    46 @publishedAll
    47 @released
    48 @since 7.0
    49 */
    50 class TInternetDate
    51 	{
    52 public:	
    53 /** 
    54 	Enum defining internet date formats.
    55 	@publishedAll
    56 	@released
    57 	@since 9.1	
    58  */
    59 	enum TInternetDateFormat
    60 		{
    61 		/** 
    62 			Rfc 1123 Compliant date format 
    63 		*/
    64 		ERfc1123Format
    65 		};
    66 
    67 	inline TInternetDate();
    68 
    69 
    70 	inline TInternetDate(TDateTime aUniversalTime);
    71 
    72 	IMPORT_C void SetDateL(const TDesC8& aDate);
    73 
    74 	IMPORT_C const TDateTime& DateTime();
    75 
    76 	IMPORT_C HBufC8* InternetDateTimeL(TInternetDateFormat aInternetDateFormat);
    77 
    78 private:
    79 	/**
    80 	A date and time object
    81 	*/
    82 	TDateTime iDateTime;
    83 	};
    84 
    85 
    86 /**
    87 	Intended Usage:	Default Constructor. Used when setting dates that are in a text format using SetDateL
    88 	
    89 	@since			7.0	.	
    90 */
    91 inline TInternetDate::TInternetDate()
    92 	{}
    93 
    94 /**
    95 	Intended Usage:	Constructor. Used when setting a date that you later want parsed into an internet text format
    96 	
    97 	@since			7.0
    98 	@param			aUniversalTime	a time that should correspond to Universal Time.
    99 */
   100 inline TInternetDate::TInternetDate(TDateTime aUniversalTime) :
   101 	iDateTime(aUniversalTime)
   102 	{}
   103 
   104 
   105 #endif	//	__TINTERNETDATE_H__