| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1 | // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef V8_PARSING_SCANNER_CHARACTER_STREAMS_H_ |
| 6 | #define V8_PARSING_SCANNER_CHARACTER_STREAMS_H_ |
| 7 | |
| Ben Murdoch | f3b273f | 2017-01-17 12:11:28 +0000 | [diff] [blame^] | 8 | #include "include/v8.h" // for v8::ScriptCompiler |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 9 | #include "src/handles.h" |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 10 | |
| 11 | namespace v8 { |
| 12 | namespace internal { |
| 13 | |
| Ben Murdoch | f3b273f | 2017-01-17 12:11:28 +0000 | [diff] [blame^] | 14 | class Utf16CharacterStream; |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 15 | |
| Ben Murdoch | f3b273f | 2017-01-17 12:11:28 +0000 | [diff] [blame^] | 16 | class ScannerStream { |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 17 | public: |
| Ben Murdoch | f3b273f | 2017-01-17 12:11:28 +0000 | [diff] [blame^] | 18 | static Utf16CharacterStream* For(Handle<String> data); |
| 19 | static Utf16CharacterStream* For(Handle<String> data, int start_pos, |
| 20 | int end_pos); |
| 21 | static Utf16CharacterStream* For( |
| 22 | ScriptCompiler::ExternalSourceStream* source_stream, |
| 23 | ScriptCompiler::StreamedSource::Encoding encoding); |
| Ben Murdoch | f91f061 | 2016-11-29 16:50:11 +0000 | [diff] [blame] | 24 | |
| 25 | // For testing: |
| Ben Murdoch | f3b273f | 2017-01-17 12:11:28 +0000 | [diff] [blame^] | 26 | static std::unique_ptr<Utf16CharacterStream> ForTesting(const char* data); |
| 27 | static std::unique_ptr<Utf16CharacterStream> ForTesting(const char* data, |
| 28 | size_t length); |
| Ben Murdoch | 014dc51 | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | } // namespace internal |
| 32 | } // namespace v8 |
| 33 | |
| 34 | #endif // V8_PARSING_SCANNER_CHARACTER_STREAMS_H_ |