| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
| 23 * DAMAGE. | 23 * DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef DateTimeFormat_h | 26 #ifndef DateTimeFormat_h |
| 27 #define DateTimeFormat_h | 27 #define DateTimeFormat_h |
| 28 | 28 |
| 29 #include "platform/PlatformExport.h" | 29 #include "platform/PlatformExport.h" |
| 30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
| 31 #include "wtf/Allocator.h" |
| 31 #include "wtf/Forward.h" | 32 #include "wtf/Forward.h" |
| 32 | 33 |
| 33 namespace blink { | 34 namespace blink { |
| 34 | 35 |
| 35 // DateTimeFormat parses date time format defined in Unicode Technical | 36 // DateTimeFormat parses date time format defined in Unicode Technical |
| 36 // standard 35, Locale Data Markup Language (LDML)[1]. | 37 // standard 35, Locale Data Markup Language (LDML)[1]. |
| 37 // [1] LDML http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns | 38 // [1] LDML http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns |
| 38 class PLATFORM_EXPORT DateTimeFormat { | 39 class PLATFORM_EXPORT DateTimeFormat { |
| 40 STATIC_ONLY(DateTimeFormat); |
| 39 public: | 41 public: |
| 40 enum FieldType { | 42 enum FieldType { |
| 41 FieldTypeInvalid, | 43 FieldTypeInvalid, |
| 42 FieldTypeLiteral, | 44 FieldTypeLiteral, |
| 43 | 45 |
| 44 // Era: AD | 46 // Era: AD |
| 45 FieldTypeEra = 'G', | 47 FieldTypeEra = 'G', |
| 46 | 48 |
| 47 // Year: 1996 | 49 // Year: 1996 |
| 48 FieldTypeYear = 'y', | 50 FieldTypeYear = 'y', |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 // Returns true if succeeded, false if failed. | 110 // Returns true if succeeded, false if failed. |
| 109 static bool parse(const String&, TokenHandler&); | 111 static bool parse(const String&, TokenHandler&); |
| 110 static void quoteAndAppendLiteral(const String&, StringBuilder&); | 112 static void quoteAndAppendLiteral(const String&, StringBuilder&); |
| 111 }; | 113 }; |
| 112 | 114 |
| 113 } // namespace blink | 115 } // namespace blink |
| 114 | 116 |
| 115 #endif // DateTimeFormat_h | 117 #endif // DateTimeFormat_h |
| OLD | NEW |