-
Notifications
You must be signed in to change notification settings - Fork 299
/
TextDecoder.h
117 lines (86 loc) · 3.09 KB
/
TextDecoder.h
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/***************************************************************************
* *
* This file was automatically generated using idlc.js *
* PLEASE DO NOT EDIT!!!! *
* *
***************************************************************************/
#pragma once
/**
@author Leo Hoo <lion@9465.net>
*/
#include "../object.h"
namespace fibjs {
class Buffer_base;
class TextDecoder_base : public object_base {
DECLARE_CLASS(TextDecoder_base);
public:
// TextDecoder_base
static result_t _new(exlib::string codec, v8::Local<v8::Object> opts, obj_ptr<TextDecoder_base>& retVal, v8::Local<v8::Object> This = v8::Local<v8::Object>());
virtual result_t decode(Buffer_base* data, v8::Local<v8::Object> opts, exlib::string& retVal) = 0;
virtual result_t get_encoding(exlib::string& retVal) = 0;
public:
template <typename T>
static void __new(const T& args);
public:
static void s__new(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_decode(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_get_encoding(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& args);
};
}
#include "ifs/Buffer.h"
namespace fibjs {
inline ClassInfo& TextDecoder_base::class_info()
{
static ClassData::ClassMethod s_method[] = {
{ "decode", s_decode, false, false }
};
static ClassData::ClassProperty s_property[] = {
{ "encoding", s_get_encoding, block_set, false }
};
static ClassData s_cd = {
"TextDecoder", false, s__new, NULL,
ARRAYSIZE(s_method), s_method, 0, NULL, ARRAYSIZE(s_property), s_property, 0, NULL, NULL, NULL,
&object_base::class_info()
};
static ClassInfo s_ci(s_cd);
return s_ci;
}
inline void TextDecoder_base::s__new(const v8::FunctionCallbackInfo<v8::Value>& args)
{
CONSTRUCT_INIT();
__new(args);
}
template <typename T>
void TextDecoder_base::__new(const T& args)
{
obj_ptr<TextDecoder_base> vr;
METHOD_NAME("new TextDecoder()");
CONSTRUCT_ENTER();
METHOD_OVER(2, 0);
OPT_ARG(exlib::string, 0, "utf8");
OPT_ARG(v8::Local<v8::Object>, 1, v8::Object::New(isolate));
hr = _new(v0, v1, vr, args.This());
CONSTRUCT_RETURN();
}
inline void TextDecoder_base::s_decode(const v8::FunctionCallbackInfo<v8::Value>& args)
{
exlib::string vr;
METHOD_NAME("TextDecoder.decode");
METHOD_INSTANCE(TextDecoder_base);
METHOD_ENTER();
METHOD_OVER(2, 1);
ARG(obj_ptr<Buffer_base>, 0);
OPT_ARG(v8::Local<v8::Object>, 1, v8::Object::New(isolate));
hr = pInst->decode(v0, v1, vr);
METHOD_RETURN();
}
inline void TextDecoder_base::s_get_encoding(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& args)
{
exlib::string vr;
METHOD_NAME("TextDecoder.encoding");
METHOD_INSTANCE(TextDecoder_base);
PROPERTY_ENTER();
hr = pInst->get_encoding(vr);
METHOD_RETURN();
}
}