OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 13 matching lines...) Expand all Loading... |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_D8_H_ | 28 #ifndef V8_D8_H_ |
29 #define V8_D8_H_ | 29 #define V8_D8_H_ |
30 | 30 |
31 #ifndef V8_SHARED | 31 #ifndef V8_SHARED |
32 #include "allocation.h" | 32 #include "allocation.h" |
33 #include "hashmap.h" | 33 #include "hashmap.h" |
| 34 #include "smart-array-pointer.h" |
34 #include "v8.h" | 35 #include "v8.h" |
35 #else | 36 #else |
36 #include "../include/v8.h" | 37 #include "../include/v8.h" |
37 #endif // V8_SHARED | 38 #endif // V8_SHARED |
38 | 39 |
39 namespace v8 { | 40 namespace v8 { |
40 | 41 |
41 | 42 |
42 #ifndef V8_SHARED | 43 #ifndef V8_SHARED |
43 // A single counter in a counter collection. | 44 // A single counter in a counter collection. |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 }; | 333 }; |
333 | 334 |
334 | 335 |
335 #ifndef V8_SHARED | 336 #ifndef V8_SHARED |
336 class LineEditor { | 337 class LineEditor { |
337 public: | 338 public: |
338 enum Type { DUMB = 0, READLINE = 1 }; | 339 enum Type { DUMB = 0, READLINE = 1 }; |
339 LineEditor(Type type, const char* name); | 340 LineEditor(Type type, const char* name); |
340 virtual ~LineEditor() { } | 341 virtual ~LineEditor() { } |
341 | 342 |
342 virtual i::SmartPointer<char> Prompt(const char* prompt) = 0; | 343 virtual i::SmartArrayPointer<char> Prompt(const char* prompt) = 0; |
343 virtual bool Open() { return true; } | 344 virtual bool Open() { return true; } |
344 virtual bool Close() { return true; } | 345 virtual bool Close() { return true; } |
345 virtual void AddHistory(const char* str) { } | 346 virtual void AddHistory(const char* str) { } |
346 | 347 |
347 const char* name() { return name_; } | 348 const char* name() { return name_; } |
348 static LineEditor* Get(); | 349 static LineEditor* Get(); |
349 private: | 350 private: |
350 Type type_; | 351 Type type_; |
351 const char* name_; | 352 const char* name_; |
352 LineEditor* next_; | 353 LineEditor* next_; |
353 static LineEditor* first_; | 354 static LineEditor* first_; |
354 }; | 355 }; |
355 #endif // V8_SHARED | 356 #endif // V8_SHARED |
356 | 357 |
357 | 358 |
358 } // namespace v8 | 359 } // namespace v8 |
359 | 360 |
360 | 361 |
361 #endif // V8_D8_H_ | 362 #endif // V8_D8_H_ |
OLD | NEW |