| 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 SRC_VM_UNICODE_H_ | 5 #ifndef SRC_VM_UNICODE_H_ |
| 6 #define SRC_VM_UNICODE_H_ | 6 #define SRC_VM_UNICODE_H_ |
| 7 | 7 |
| 8 #include "src/shared/assert.h" | 8 #include "src/shared/assert.h" |
| 9 #include "src/shared/globals.h" | 9 #include "src/shared/globals.h" |
| 10 | 10 |
| 11 namespace fletch { | 11 namespace dartino { |
| 12 | 12 |
| 13 class TwoByteString; | 13 class TwoByteString; |
| 14 | 14 |
| 15 class CodePointIterator { | 15 class CodePointIterator { |
| 16 public: | 16 public: |
| 17 explicit CodePointIterator(TwoByteString* str); | 17 explicit CodePointIterator(TwoByteString* str); |
| 18 | 18 |
| 19 int32 Current() const { | 19 int32 Current() const { |
| 20 ASSERT(index_ >= 0); | 20 ASSERT(index_ >= 0); |
| 21 ASSERT(index_ < end_); | 21 ASSERT(index_ < end_); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 static void Encode(int32 codepoint, uint16_t* dst); | 134 static void Encode(int32 codepoint, uint16_t* dst); |
| 135 | 135 |
| 136 static const int32 kMaxCodeUnit = 0xFFFF; | 136 static const int32 kMaxCodeUnit = 0xFFFF; |
| 137 | 137 |
| 138 private: | 138 private: |
| 139 static const int32 kLeadSurrogateOffset = (0xD800 - (0x10000 >> 10)); | 139 static const int32 kLeadSurrogateOffset = (0xD800 - (0x10000 >> 10)); |
| 140 | 140 |
| 141 static const int32 kSurrogateOffset = (0x10000 - (0xD800 << 10) - 0xDC00); | 141 static const int32 kSurrogateOffset = (0x10000 - (0xD800 << 10) - 0xDC00); |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 } // namespace fletch | 144 } // namespace dartino |
| 145 | 145 |
| 146 #endif // SRC_VM_UNICODE_H_ | 146 #endif // SRC_VM_UNICODE_H_ |
| OLD | NEW |