forked from nodejs/node-v0.x-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode_file.h
More file actions
49 lines (35 loc) · 851 Bytes
/
node_file.h
File metadata and controls
49 lines (35 loc) · 851 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright 2009 Ryan Dahl <ry@tinyclouds.org>
#ifndef SRC_FILE_H_
#define SRC_FILE_H_
#include <node.h>
#include <node_events.h>
#include <v8.h>
#include <eio.h>
namespace node {
class File {
public:
static void Initialize(v8::Handle<v8::Object> target);
};
void InitFs(v8::Handle<v8::Object> target);
class EIORequest : public EventSource {
public:
static void Initialize(v8::Handle<v8::Object> target);
static EIORequest* New();
EIORequest() : EventSource() { }
~EIORequest() { }
void Set(eio_req *req, v8::Handle<v8::Value> callback);
static int After(eio_req *req);
void Active() {
EventSource::Active();
ev_ref(EV_DEFAULT_UC);
}
void Inactive() {
ev_unref(EV_DEFAULT_UC);
req_ = NULL;
EventSource::Inactive();
}
private:
eio_req *req_;
};
} // namespace node
#endif // SRC_FILE_H_