-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathqdir_wrapper.h
More file actions
30 lines (27 loc) · 980 Bytes
/
Copy pathqdir_wrapper.h
File metadata and controls
30 lines (27 loc) · 980 Bytes
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
#pragma once
namespace shelllet {
namespace core {
template<typename T, typename U, bool C>
class QDirWrapper : public ObjectWrapper<T, U, C>
{
public:
template <bool M>
QDirWrapper(QDirPrivate<T, M>& d, const v8::FunctionCallbackInfo<v8::Value>& args)
: ObjectWrapper(d, args) {
}
QDirWrapper(v8::Isolate* isolate, const v8::Local<v8::FunctionTemplate>& tpl) : ObjectWrapper(isolate, tpl)
{
auto filter = v8::FunctionTemplate::New(isolate);
filter->Set(isolate, "Dirs", v8::Int32::New(isolate, QDir::Dirs));
filter->Set(isolate, "Files", v8::Int32::New(isolate, QDir::Files));
filter->Set(isolate, "AllDirs", v8::Int32::New(isolate, QDir::AllDirs));
filter->Set(isolate, "NoDotAndDotDot", v8::Int32::New(isolate, QDir::NoDotAndDotDot));
tpl->Set(isolate, "Filter", filter);
}
QDirWrapper(v8::Isolate* isolate, const v8::Local<v8::ObjectTemplate>& proto) : ObjectWrapper(isolate, proto)
{
}
protected:
};
}
}