/
path_win32.h
292 lines (207 loc) · 7.54 KB
/
path_win32.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
/***************************************************************************
* *
* This file was automatically generated using idlc.js *
* PLEASE DO NOT EDIT!!!! *
* *
***************************************************************************/
#ifndef _path_win32_base_H_
#define _path_win32_base_H_
/**
@author Leo Hoo <lion@9465.net>
*/
#include "../object.h"
namespace fibjs {
class path_win32_base : public object_base {
DECLARE_CLASS(path_win32_base);
public:
// path_win32_base
static result_t normalize(exlib::string path, exlib::string& retVal);
static result_t basename(exlib::string path, exlib::string ext, exlib::string& retVal);
static result_t extname(exlib::string path, exlib::string& retVal);
static result_t dirname(exlib::string path, exlib::string& retVal);
static result_t fullpath(exlib::string path, exlib::string& retVal);
static result_t isAbsolute(exlib::string path, bool& retVal);
static result_t join(OptArgs ps, exlib::string& retVal);
static result_t resolve(OptArgs ps, exlib::string& retVal);
static result_t toNamespacedPath(v8::Local<v8::Value> path, v8::Local<v8::Value>& retVal);
static result_t get_sep(exlib::string& retVal);
static result_t get_delimiter(exlib::string& retVal);
static result_t get_posix(v8::Local<v8::Object>& retVal);
static result_t get_win32(v8::Local<v8::Object>& retVal);
public:
static void s__new(const v8::FunctionCallbackInfo<v8::Value>& args)
{
CONSTRUCT_INIT();
Isolate* isolate = Isolate::current();
isolate->m_isolate->ThrowException(
isolate->NewString("not a constructor"));
}
public:
static void s_normalize(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_basename(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_extname(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_dirname(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_fullpath(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_isAbsolute(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_join(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_resolve(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_toNamespacedPath(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_get_sep(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args);
static void s_get_delimiter(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args);
static void s_get_posix(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args);
static void s_get_win32(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args);
};
}
namespace fibjs {
inline ClassInfo& path_win32_base::class_info()
{
static ClassData::ClassMethod s_method[] = {
{ "normalize", s_normalize, true },
{ "basename", s_basename, true },
{ "extname", s_extname, true },
{ "dirname", s_dirname, true },
{ "fullpath", s_fullpath, true },
{ "isAbsolute", s_isAbsolute, true },
{ "join", s_join, true },
{ "resolve", s_resolve, true },
{ "toNamespacedPath", s_toNamespacedPath, true }
};
static ClassData::ClassProperty s_property[] = {
{ "sep", s_get_sep, block_set, true },
{ "delimiter", s_get_delimiter, block_set, true },
{ "posix", s_get_posix, block_set, true },
{ "win32", s_get_win32, block_set, true }
};
static ClassData s_cd = {
"path_win32", true, 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 path_win32_base::s_normalize(const v8::FunctionCallbackInfo<v8::Value>& args)
{
exlib::string vr;
METHOD_NAME("path_win32.normalize");
METHOD_ENTER();
METHOD_OVER(1, 1);
ARG(exlib::string, 0);
hr = normalize(v0, vr);
METHOD_RETURN();
}
inline void path_win32_base::s_basename(const v8::FunctionCallbackInfo<v8::Value>& args)
{
exlib::string vr;
METHOD_NAME("path_win32.basename");
METHOD_ENTER();
METHOD_OVER(2, 1);
ARG(exlib::string, 0);
OPT_ARG(exlib::string, 1, "");
hr = basename(v0, v1, vr);
METHOD_RETURN();
}
inline void path_win32_base::s_extname(const v8::FunctionCallbackInfo<v8::Value>& args)
{
exlib::string vr;
METHOD_NAME("path_win32.extname");
METHOD_ENTER();
METHOD_OVER(1, 1);
ARG(exlib::string, 0);
hr = extname(v0, vr);
METHOD_RETURN();
}
inline void path_win32_base::s_dirname(const v8::FunctionCallbackInfo<v8::Value>& args)
{
exlib::string vr;
METHOD_NAME("path_win32.dirname");
METHOD_ENTER();
METHOD_OVER(1, 1);
ARG(exlib::string, 0);
hr = dirname(v0, vr);
METHOD_RETURN();
}
inline void path_win32_base::s_fullpath(const v8::FunctionCallbackInfo<v8::Value>& args)
{
exlib::string vr;
METHOD_NAME("path_win32.fullpath");
METHOD_ENTER();
METHOD_OVER(1, 1);
ARG(exlib::string, 0);
hr = fullpath(v0, vr);
METHOD_RETURN();
}
inline void path_win32_base::s_isAbsolute(const v8::FunctionCallbackInfo<v8::Value>& args)
{
bool vr;
METHOD_NAME("path_win32.isAbsolute");
METHOD_ENTER();
METHOD_OVER(1, 1);
ARG(exlib::string, 0);
hr = isAbsolute(v0, vr);
METHOD_RETURN();
}
inline void path_win32_base::s_join(const v8::FunctionCallbackInfo<v8::Value>& args)
{
exlib::string vr;
METHOD_NAME("path_win32.join");
METHOD_ENTER();
METHOD_OVER(-1, 0);
ARG_LIST(0);
hr = join(v0, vr);
METHOD_RETURN();
}
inline void path_win32_base::s_resolve(const v8::FunctionCallbackInfo<v8::Value>& args)
{
exlib::string vr;
METHOD_NAME("path_win32.resolve");
METHOD_ENTER();
METHOD_OVER(-1, 0);
ARG_LIST(0);
hr = resolve(v0, vr);
METHOD_RETURN();
}
inline void path_win32_base::s_toNamespacedPath(const v8::FunctionCallbackInfo<v8::Value>& args)
{
v8::Local<v8::Value> vr;
METHOD_NAME("path_win32.toNamespacedPath");
METHOD_ENTER();
METHOD_OVER(1, 0);
OPT_ARG(v8::Local<v8::Value>, 0, v8::Undefined(isolate));
hr = toNamespacedPath(v0, vr);
METHOD_RETURN();
}
inline void path_win32_base::s_get_sep(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args)
{
exlib::string vr;
METHOD_NAME("path_win32.sep");
PROPERTY_ENTER();
hr = get_sep(vr);
METHOD_RETURN();
}
inline void path_win32_base::s_get_delimiter(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args)
{
exlib::string vr;
METHOD_NAME("path_win32.delimiter");
PROPERTY_ENTER();
hr = get_delimiter(vr);
METHOD_RETURN();
}
inline void path_win32_base::s_get_posix(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args)
{
v8::Local<v8::Object> vr;
METHOD_NAME("path_win32.posix");
PROPERTY_ENTER();
hr = get_posix(vr);
METHOD_RETURN();
}
inline void path_win32_base::s_get_win32(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args)
{
v8::Local<v8::Object> vr;
METHOD_NAME("path_win32.win32");
PROPERTY_ENTER();
hr = get_win32(vr);
METHOD_RETURN();
}
}
#endif