forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuri.h
More file actions
60 lines (48 loc) · 2.03 KB
/
uri.h
File metadata and controls
60 lines (48 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_STRINGS_URI_H_
#define V8_STRINGS_URI_H_
#include "src/handles/maybe-handles.h"
#include "src/utils/allocation.h"
namespace v8 {
namespace internal {
class Uri : public AllStatic {
public:
// ES6 section 18.2.6.2 decodeURI (encodedURI)
static MaybeDirectHandle<String> DecodeUri(Isolate* isolate,
DirectHandle<String> uri) {
return Decode(isolate, uri, true);
}
// ES6 section 18.2.6.3 decodeURIComponent (encodedURIComponent)
static MaybeDirectHandle<String> DecodeUriComponent(
Isolate* isolate, DirectHandle<String> component) {
return Decode(isolate, component, false);
}
// ES6 section 18.2.6.4 encodeURI (uri)
static MaybeDirectHandle<String> EncodeUri(Isolate* isolate,
DirectHandle<String> uri) {
return Encode(isolate, uri, true);
}
// ES6 section 18.2.6.5 encodeURIComponent (uriComponent)
static MaybeDirectHandle<String> EncodeUriComponent(
Isolate* isolate, DirectHandle<String> component) {
return Encode(isolate, component, false);
}
// ES6 section B.2.1.1 escape (string)
static MaybeDirectHandle<String> Escape(Isolate* isolate,
Handle<String> string);
// ES6 section B.2.1.2 unescape (string)
static MaybeDirectHandle<String> Unescape(Isolate* isolate,
Handle<String> string);
private:
static MaybeDirectHandle<String> Decode(Isolate* isolate,
DirectHandle<String> uri,
bool is_uri);
static MaybeDirectHandle<String> Encode(Isolate* isolate,
DirectHandle<String> uri,
bool is_uri);
};
} // namespace internal
} // namespace v8
#endif // V8_STRINGS_URI_H_