OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_UNICODE_H_ | 5 #ifndef VM_UNICODE_H_ |
6 #define VM_UNICODE_H_ | 6 #define VM_UNICODE_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 | 10 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
13 class String; | 13 class String; |
14 | 14 |
15 class Utf8 : AllStatic { | 15 class Utf8 : AllStatic { |
16 public: | 16 public: |
17 enum Type { | 17 enum Type { |
18 kLatin1 = 0, // Latin-1 character set. | 18 kLatin1 = 0, // Latin-1 code point [U+0000, U+00FF]. |
19 kBMP, // Basic Multilingual Plane. | 19 kBMP, // Basic Multilingual Plane code point [U+0000, U+FFFF]. |
20 kSMP, // Supplementary Multilingual Plane. | 20 kSupplementary, // Supplementary code point [U+010000, U+10FFFF]. |
21 }; | 21 }; |
22 | 22 |
23 static const intptr_t kMaxOneByteChar = 0x7F; | 23 static const intptr_t kMaxOneByteChar = 0x7F; |
24 static const intptr_t kMaxTwoByteChar = 0x7FF; | 24 static const intptr_t kMaxTwoByteChar = 0x7FF; |
25 static const intptr_t kMaxThreeByteChar = 0xFFFF; | 25 static const intptr_t kMaxThreeByteChar = 0xFFFF; |
26 static const intptr_t kMaxFourByteChar = 0x10FFFF; | 26 static const intptr_t kMaxFourByteChar = 0x10FFFF; |
27 | 27 |
28 static intptr_t CodePointCount(const uint8_t* utf8_array, | 28 static intptr_t CodePointCount(const uint8_t* utf8_array, |
29 intptr_t array_len, | 29 intptr_t array_len, |
30 Type* type); | 30 Type* type); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // Data for small code points with one mapping | 162 // Data for small code points with one mapping |
163 static const int16_t stage2_[]; | 163 static const int16_t stage2_[]; |
164 | 164 |
165 // Data for large code points or code points with both mappings. | 165 // Data for large code points or code points with both mappings. |
166 static const int32_t stage2_exception_[][2]; | 166 static const int32_t stage2_exception_[][2]; |
167 }; | 167 }; |
168 | 168 |
169 } // namespace dart | 169 } // namespace dart |
170 | 170 |
171 #endif // VM_UNICODE_H_ | 171 #endif // VM_UNICODE_H_ |
OLD | NEW |