| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_UNICODE_DECODER_H_ | 5 #ifndef V8_UNICODE_DECODER_H_ |
| 6 #define V8_UNICODE_DECODER_H_ | 6 #define V8_UNICODE_DECODER_H_ |
| 7 | 7 |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/utils.h" |
| 10 | 11 |
| 11 namespace unibrow { | 12 namespace unibrow { |
| 12 | 13 |
| 13 class Utf8DecoderBase { | 14 class V8_EXPORT_PRIVATE Utf8DecoderBase { |
| 14 public: | 15 public: |
| 15 // Initialization done in subclass. | 16 // Initialization done in subclass. |
| 16 inline Utf8DecoderBase(); | 17 inline Utf8DecoderBase(); |
| 17 inline Utf8DecoderBase(uint16_t* buffer, size_t buffer_length, | 18 inline Utf8DecoderBase(uint16_t* buffer, size_t buffer_length, |
| 18 const uint8_t* stream, size_t stream_length); | 19 const uint8_t* stream, size_t stream_length); |
| 19 inline size_t Utf16Length() const { return utf16_length_; } | 20 inline size_t Utf16Length() const { return utf16_length_; } |
| 20 | 21 |
| 21 protected: | 22 protected: |
| 22 // This reads all characters and sets the utf16_length_. | 23 // This reads all characters and sets the utf16_length_. |
| 23 // The first buffer_length utf16 chars are cached in the buffer. | 24 // The first buffer_length utf16 chars are cached in the buffer. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 case 0x178: | 114 case 0x178: |
| 114 return 0xff; | 115 return 0xff; |
| 115 } | 116 } |
| 116 return 0; | 117 return 0; |
| 117 } | 118 } |
| 118 | 119 |
| 119 | 120 |
| 120 } // namespace unibrow | 121 } // namespace unibrow |
| 121 | 122 |
| 122 #endif // V8_UNICODE_DECODER_H_ | 123 #endif // V8_UNICODE_DECODER_H_ |
| OLD | NEW |