@@ -73,7 +73,7 @@ namespace native
73
73
delete req;
74
74
}
75
75
76
- void delete_req (uv_fs_t * req)
76
+ inline void delete_req (uv_fs_t * req)
77
77
{
78
78
delete reinterpret_cast <callbacks*>(req->data );
79
79
uv_fs_req_cleanup (req);
@@ -122,7 +122,7 @@ namespace native
122
122
}
123
123
}
124
124
125
- bool open (const std::string& path, int flags, int mode, std::function<void (native::fs::file_handle fd, error e)> callback)
125
+ inline bool open (const std::string& path, int flags, int mode, std::function<void (native::fs::file_handle fd, error e)> callback)
126
126
{
127
127
auto req = internal::create_req (callback);
128
128
if (uv_fs_open (uv_default_loop (), req, path.c_str (), flags, mode, [](uv_fs_t * req) {
@@ -140,7 +140,7 @@ namespace native
140
140
return true ;
141
141
}
142
142
143
- bool read (file_handle fd, size_t len, off_t offset, std::function<void (const std::string& str, error e)> callback)
143
+ inline bool read (file_handle fd, size_t len, off_t offset, std::function<void (const std::string& str, error e)> callback)
144
144
{
145
145
auto buf = new char [len];
146
146
auto req = internal::create_req (callback, buf);
@@ -172,7 +172,7 @@ namespace native
172
172
return true ;
173
173
}
174
174
175
- bool write (file_handle fd, const char * buf, size_t len, off_t offset, std::function<void (int nwritten, error e)> callback)
175
+ inline bool write (file_handle fd, const char * buf, size_t len, off_t offset, std::function<void (int nwritten, error e)> callback)
176
176
{
177
177
auto req = internal::create_req (callback);
178
178
@@ -198,7 +198,7 @@ namespace native
198
198
return true ;
199
199
}
200
200
201
- bool read_to_end (file_handle fd, std::function<void (const std::string& str, error e)> callback)
201
+ inline bool read_to_end (file_handle fd, std::function<void (const std::string& str, error e)> callback)
202
202
{
203
203
auto ctx = new internal::rte_context;
204
204
ctx->file = fd;
@@ -212,7 +212,7 @@ namespace native
212
212
return true ;
213
213
}
214
214
215
- bool close (file_handle fd, std::function<void (error e)> callback)
215
+ inline bool close (file_handle fd, std::function<void (error e)> callback)
216
216
{
217
217
auto req = internal::create_req (callback);
218
218
if (uv_fs_close (uv_default_loop (), req, fd, [](uv_fs_t * req){
@@ -226,7 +226,7 @@ namespace native
226
226
return true ;
227
227
}
228
228
229
- bool unlink (const std::string& path, std::function<void (error e)> callback)
229
+ inline bool unlink (const std::string& path, std::function<void (error e)> callback)
230
230
{
231
231
auto req = internal::create_req (callback);
232
232
if (uv_fs_unlink (uv_default_loop (), req, path.c_str (), [](uv_fs_t * req){
@@ -240,7 +240,7 @@ namespace native
240
240
return true ;
241
241
}
242
242
243
- bool mkdir (const std::string& path, int mode, std::function<void (error e)> callback)
243
+ inline bool mkdir (const std::string& path, int mode, std::function<void (error e)> callback)
244
244
{
245
245
auto req = internal::create_req (callback);
246
246
if (uv_fs_mkdir (uv_default_loop (), req, path.c_str (), mode, [](uv_fs_t * req){
@@ -254,7 +254,7 @@ namespace native
254
254
return true ;
255
255
}
256
256
257
- bool rmdir (const std::string& path, std::function<void (error e)> callback)
257
+ inline bool rmdir (const std::string& path, std::function<void (error e)> callback)
258
258
{
259
259
auto req = internal::create_req (callback);
260
260
if (uv_fs_rmdir (uv_default_loop (), req, path.c_str (), [](uv_fs_t * req){
@@ -268,7 +268,7 @@ namespace native
268
268
return true ;
269
269
}
270
270
271
- bool rename (const std::string& path, const std::string& new_path, std::function<void (error e)> callback)
271
+ inline bool rename (const std::string& path, const std::string& new_path, std::function<void (error e)> callback)
272
272
{
273
273
auto req = internal::create_req (callback);
274
274
if (uv_fs_rename (uv_default_loop (), req, path.c_str (), new_path.c_str (), [](uv_fs_t * req){
@@ -282,7 +282,7 @@ namespace native
282
282
return true ;
283
283
}
284
284
285
- bool chmod (const std::string& path, int mode, std::function<void (error e)> callback)
285
+ inline bool chmod (const std::string& path, int mode, std::function<void (error e)> callback)
286
286
{
287
287
auto req = internal::create_req (callback);
288
288
if (uv_fs_chmod (uv_default_loop (), req, path.c_str (), mode, [](uv_fs_t * req){
@@ -296,7 +296,7 @@ namespace native
296
296
return true ;
297
297
}
298
298
299
- bool chown (const std::string& path, int uid, int gid, std::function<void (error e)> callback)
299
+ inline bool chown (const std::string& path, int uid, int gid, std::function<void (error e)> callback)
300
300
{
301
301
auto req = internal::create_req (callback);
302
302
if (uv_fs_chown (uv_default_loop (), req, path.c_str (), uid, gid, [](uv_fs_t * req){
0 commit comments