sl@0: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // This file contains the definition of internal classes used to parse TInternetDate data sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file tinternetdateparser.h sl@0: */ sl@0: sl@0: sl@0: #ifndef __TINTERNETDATEPARSER_H__ sl@0: #define __TINTERNETDATEPARSER_H__ sl@0: sl@0: #include <e32std.h> sl@0: sl@0: /** sl@0: Used as a support class of TInternetDate. This provides the implementation of parsing sl@0: sl@0: Supports parsing of the following date formats: sl@0: Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 sl@0: Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 sl@0: Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format sl@0: sl@0: All dates are store relative to Universal Time and not local time. sl@0: sl@0: @internalAll sl@0: @since 7.0 sl@0: */ sl@0: class TInternetDateParser sl@0: { sl@0: public: sl@0: inline TInternetDateParser(); sl@0: sl@0: void ConvertFromInternetFormL(const TDesC8& aInternetTextDateTime, TDateTime& aDateTime); sl@0: sl@0: HBufC8* ConvertToRfc1123FormL(const TDateTime& aDateTime); sl@0: private: sl@0: sl@0: void ConvertFromRfc1123And850FormL(const TDesC8& aRfc1123DateTime, TDateTime& aDateTime); sl@0: void ConvertFromAscTimeFormL(const TDesC8& aAscTimeDateTime, TDateTime& aDateTime); sl@0: TInt ParseRfcDateDayMonthYearL(const TDesC8& aDateTimeText, TDateTime& aDateTime); sl@0: TMonth GetMonthL(const TDesC8& aMonthText); sl@0: void ParseHHMMSSTimeL(const TDesC8& aDateTimeText, TDateTime& aDateTime); sl@0: void ParseTimeOffsetL(const TDesC8& aTimeOffset, TTimeIntervalMinutes& aOffsetMinutes); sl@0: void ParseHHMMTimeOffsetL(const TDesC8& aTimeOffset, TTimeIntervalMinutes& aOffsetMinutes); sl@0: }; sl@0: sl@0: sl@0: inline TInternetDateParser::TInternetDateParser() sl@0: {} sl@0: sl@0: sl@0: sl@0: #endif // __TINTERNETDATEPARSER_H__