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 
8 #include "include/v8.h"  // for v8::ScriptCompiler
9 #include "src/handles.h"
10 
11 namespace v8 {
12 namespace internal {
13 
14 class Utf16CharacterStream;
15 
16 class ScannerStream {
17  public:
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);
24 
25   // For testing:
26   static std::unique_ptr<Utf16CharacterStream> ForTesting(const char* data);
27   static std::unique_ptr<Utf16CharacterStream> ForTesting(const char* data,
28                                                           size_t length);
29 };
30 
31 }  // namespace internal
32 }  // namespace v8
33 
34 #endif  // V8_PARSING_SCANNER_CHARACTER_STREAMS_H_
35