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/globals.h" 10 11 namespace v8 { 12 namespace internal { 13 14 template <typename T> 15 class Handle; 16 class Utf16CharacterStream; 17 class RuntimeCallStats; 18 class String; 19 20 class V8_EXPORT_PRIVATE ScannerStream { 21 public: 22 static Utf16CharacterStream* For(Isolate* isolate, Handle<String> data); 23 static Utf16CharacterStream* For(Isolate* isolate, Handle<String> data, 24 int start_pos, int end_pos); 25 static Utf16CharacterStream* For( 26 ScriptCompiler::ExternalSourceStream* source_stream, 27 ScriptCompiler::StreamedSource::Encoding encoding, 28 RuntimeCallStats* stats); 29 30 static std::unique_ptr<Utf16CharacterStream> ForTesting(const char* data); 31 static std::unique_ptr<Utf16CharacterStream> ForTesting(const char* data, 32 size_t length); 33 }; 34 35 } // namespace internal 36 } // namespace v8 37 38 #endif // V8_PARSING_SCANNER_CHARACTER_STREAMS_H_ 39