• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 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_INTL_SUPPORT
6 #error Internationalization is expected to be enabled.
7 #endif  // V8_INTL_SUPPORT
8 
9 #ifndef V8_OBJECTS_JS_BREAK_ITERATOR_H_
10 #define V8_OBJECTS_JS_BREAK_ITERATOR_H_
11 
12 #include <set>
13 #include <string>
14 
15 #include "src/objects/intl-objects.h"
16 #include "src/objects/managed.h"
17 #include "src/objects/objects.h"
18 #include "torque-generated/field-offsets.h"
19 
20 // Has to be the last include (doesn't have include guards):
21 #include "src/objects/object-macros.h"
22 
23 namespace U_ICU_NAMESPACE {
24 class BreakIterator;
25 }  // namespace U_ICU_NAMESPACE
26 
27 namespace v8 {
28 namespace internal {
29 
30 #include "torque-generated/src/objects/js-break-iterator-tq.inc"
31 
32 class JSV8BreakIterator
33     : public TorqueGeneratedJSV8BreakIterator<JSV8BreakIterator, JSObject> {
34  public:
35   V8_WARN_UNUSED_RESULT static MaybeHandle<JSV8BreakIterator> New(
36       Isolate* isolate, Handle<Map> map, Handle<Object> input_locales,
37       Handle<Object> input_options, const char* service);
38 
39   static Handle<JSObject> ResolvedOptions(
40       Isolate* isolate, Handle<JSV8BreakIterator> break_iterator);
41 
42   V8_EXPORT_PRIVATE static const std::set<std::string>& GetAvailableLocales();
43 
44   static void AdoptText(Isolate* isolate,
45                         Handle<JSV8BreakIterator> break_iterator,
46                         Handle<String> text);
47 
48   static Handle<Object> Current(Isolate* isolate,
49                                 Handle<JSV8BreakIterator> break_iterator);
50   static Handle<Object> First(Isolate* isolate,
51                               Handle<JSV8BreakIterator> break_iterator);
52   static Handle<Object> Next(Isolate* isolate,
53                              Handle<JSV8BreakIterator> break_iterator);
54   static String BreakType(Isolate* isolate,
55                           Handle<JSV8BreakIterator> break_iterator);
56 
57   DECL_PRINTER(JSV8BreakIterator)
58 
59   DECL_ACCESSORS(break_iterator, Managed<icu::BreakIterator>)
60   DECL_ACCESSORS(unicode_string, Managed<icu::UnicodeString>)
61 
62   TQ_OBJECT_CONSTRUCTORS(JSV8BreakIterator)
63 };
64 
65 }  // namespace internal
66 }  // namespace v8
67 
68 #include "src/objects/object-macros-undef.h"
69 
70 #endif  // V8_OBJECTS_JS_BREAK_ITERATOR_H_
71