v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
js-segment-iterator.h
Go to the documentation of this file.
1// Copyright 2020 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_OBJECTS_JS_SEGMENT_ITERATOR_H_
6#define V8_OBJECTS_JS_SEGMENT_ITERATOR_H_
7
8#ifndef V8_INTL_SUPPORT
9#error Internationalization is expected to be enabled.
10#endif // V8_INTL_SUPPORT
11
12#include "src/base/bit-field.h"
14#include "src/heap/factory.h"
16#include "src/objects/managed.h"
17#include "src/objects/objects.h"
18#include "unicode/uversion.h"
19
20// Has to be the last include (doesn't have include guards):
22
23namespace U_ICU_NAMESPACE {
24class BreakIterator;
25class UnicodeString;
26} // namespace U_ICU_NAMESPACE
27
28namespace v8 {
29namespace internal {
30
31#include "torque-generated/src/objects/js-segment-iterator-tq.inc"
32
34 : public TorqueGeneratedJSSegmentIterator<JSSegmentIterator, JSObject> {
35 public:
36 // ecma402 #sec-CreateSegmentIterator
38 Isolate* isolate, DirectHandle<String> input_string,
39 icu::BreakIterator* icu_break_iterator,
41
42 // ecma402 #sec-segment-iterator-prototype-next
44 Isolate* isolate,
45 DirectHandle<JSSegmentIterator> segment_iterator_holder);
46
48
49 // SegmentIterator accessors.
53
55
58
59 // Bit positions in |flags|.
60 DEFINE_TORQUE_GENERATED_JS_SEGMENT_ITERATOR_FLAGS()
61
62 static_assert(GranularityBits::is_valid(JSSegmenter::Granularity::GRAPHEME));
63 static_assert(GranularityBits::is_valid(JSSegmenter::Granularity::WORD));
64 static_assert(GranularityBits::is_valid(JSSegmenter::Granularity::SENTENCE));
65
67};
68
70 : public TorqueGeneratedJSSegmentDataObject<JSSegmentDataObject, JSObject> {
71 public:
72 private:
74};
75
77 : public TorqueGeneratedJSSegmentDataObjectWithIsWordLike<
78 JSSegmentDataObjectWithIsWordLike, JSSegmentDataObject> {
79 public:
80 private:
82};
83
84} // namespace internal
85} // namespace v8
86
88
89#endif // V8_OBJECTS_JS_SEGMENT_ITERATOR_H_
Handle< String > GranularityAsString(Isolate *isolate) const
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< JSReceiver > Next(Isolate *isolate, DirectHandle< JSSegmentIterator > segment_iterator_holder)
JSSegmenter::Granularity granularity() const
void set_granularity(JSSegmenter::Granularity granularity)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< JSSegmentIterator > Create(Isolate *isolate, DirectHandle< String > input_string, icu::BreakIterator *icu_break_iterator, JSSegmenter::Granularity granularity)
#define DECL_ACCESSORS(name,...)
#define DECL_PRINTER(Name)
#define TQ_OBJECT_CONSTRUCTORS(Type)
#define V8_WARN_UNUSED_RESULT
Definition v8config.h:671