V8
head
Loading...
Searching...
No Matches
include
v8-regexp.h
Go to the documentation of this file.
1
// Copyright 2021 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 INCLUDE_V8_REGEXP_H_
6
#define INCLUDE_V8_REGEXP_H_
7
8
#include "
v8-local-handle.h
"
// NOLINT(build/include_directory)
9
#include "
v8-object.h
"
// NOLINT(build/include_directory)
10
#include "
v8config.h
"
// NOLINT(build/include_directory)
11
12
namespace
v8
{
13
14
class
Context;
15
19
class
V8_EXPORT
RegExp
:
public
Object
{
20
public
:
29
enum
Flags
{
30
kNone
= 0,
31
kGlobal = 1 << 0,
32
kIgnoreCase = 1 << 1,
33
kMultiline = 1 << 2,
34
kSticky = 1 << 3,
35
kUnicode = 1 << 4,
36
kDotAll = 1 << 5,
37
kLinear = 1 << 6,
38
kHasIndices = 1 << 7,
39
kUnicodeSets = 1 << 8,
40
};
41
42
static
constexpr
int
kFlagCount = 9;
43
54
static
V8_WARN_UNUSED_RESULT
MaybeLocal<RegExp>
New
(
Local<Context>
context,
55
Local<String>
pattern,
56
Flags
flags);
57
63
static
V8_WARN_UNUSED_RESULT
MaybeLocal<RegExp>
NewWithBacktrackLimit
(
64
Local<Context>
context,
Local<String>
pattern,
Flags
flags,
65
uint32_t backtrack_limit);
66
78
V8_DEPRECATE_SOON
(
"Use ExecV2 instead"
)
79
V8_WARN_UNUSED_RESULT
MaybeLocal
<
Object
> Exec(
Local
<
Context
> context,
80
Local
<
String
> subject);
81
V8_WARN_UNUSED_RESULT
MaybeLocal
<
Value
> ExecV2(
Local
<
Context
> context,
82
Local
<
String
> subject);
83
88
Local
<
String
> GetSource() const;
89
93
Flags
GetFlags() const;
94
95
V8_INLINE
static
RegExp
* Cast(
Value
* value) {
96
#ifdef V8_ENABLE_CHECKS
97
CheckCast(value);
98
#endif
99
return
static_cast<
RegExp
*
>
(value);
100
}
101
102
private
:
103
static
void
CheckCast(
Value
* obj);
104
};
105
106
}
// namespace v8
107
108
#endif
// INCLUDE_V8_REGEXP_H_
v8::Context
Definition:
v8-context.h:55
v8::Local
Definition:
v8-local-handle.h:359
v8::MaybeLocal
Definition:
v8-local-handle.h:730
v8::Object
Definition:
v8-object.h:267
v8::RegExp
Definition:
v8-regexp.h:19
v8::RegExp::Flags
Flags
Definition:
v8-regexp.h:29
v8::RegExp::New
static MaybeLocal< RegExp > New(Local< Context > context, Local< String > pattern, Flags flags)
v8::RegExp::NewWithBacktrackLimit
static MaybeLocal< RegExp > NewWithBacktrackLimit(Local< Context > context, Local< String > pattern, Flags flags, uint32_t backtrack_limit)
v8::String
Definition:
v8-primitive.h:126
v8::Value
Definition:
v8-value.h:32
v8
Definition:
libplatform.h:15
v8::MemoryPressureLevel::kNone
@ kNone
v8-local-handle.h
v8-object.h
v8config.h
V8_EXPORT
#define V8_EXPORT
Definition:
v8config.h:874
V8_INLINE
#define V8_INLINE
Definition:
v8config.h:518
V8_DEPRECATE_SOON
#define V8_DEPRECATE_SOON(message)
Definition:
v8config.h:631
V8_WARN_UNUSED_RESULT
#define V8_WARN_UNUSED_RESULT
Definition:
v8config.h:688