OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 static bool IsBmp(int32_t code_point) { | 23 static bool IsBmp(int32_t code_point) { |
24 return (code_point >= 0) && (code_point <= 0xFFFF); | 24 return (code_point >= 0) && (code_point <= 0xFFFF); |
25 } | 25 } |
26 | 26 |
27 static bool IsSupplementary(int32_t code_point) { | 27 static bool IsSupplementary(int32_t code_point) { |
28 return (code_point > 0xFFFF) && (code_point <= kMaxCodePoint); | 28 return (code_point > 0xFFFF) && (code_point <= kMaxCodePoint); |
29 } | 29 } |
30 | 30 |
31 // Returns true if the code point value is above Plane 17. | 31 // Returns true if the code point value is above Plane 17. |
32 static bool IsOutOfRange(int32_t code_point) { | 32 static bool IsOutOfRange(intptr_t code_point) { |
33 return (code_point < 0) || (code_point > kMaxCodePoint); | 33 return (code_point < 0) || (code_point > kMaxCodePoint); |
34 } | 34 } |
35 }; | 35 }; |
36 | 36 |
37 | 37 |
38 class Utf8 : AllStatic { | 38 class Utf8 : AllStatic { |
39 public: | 39 public: |
40 enum Type { | 40 enum Type { |
41 kLatin1 = 0, // Latin-1 code point [U+0000, U+00FF]. | 41 kLatin1 = 0, // Latin-1 code point [U+0000, U+00FF]. |
42 kBMP, // Basic Multilingual Plane code point [U+0000, U+FFFF]. | 42 kBMP, // Basic Multilingual Plane code point [U+0000, U+FFFF]. |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 // Data for small code points with one mapping | 222 // Data for small code points with one mapping |
223 static const int16_t stage2_[]; | 223 static const int16_t stage2_[]; |
224 | 224 |
225 // Data for large code points or code points with both mappings. | 225 // Data for large code points or code points with both mappings. |
226 static const int32_t stage2_exception_[][2]; | 226 static const int32_t stage2_exception_[][2]; |
227 }; | 227 }; |
228 | 228 |
229 } // namespace dart | 229 } // namespace dart |
230 | 230 |
231 #endif // VM_UNICODE_H_ | 231 #endif // VM_UNICODE_H_ |
OLD | NEW |