Sha256: e5bac8f760da84c61ed9497a9978dcc1aa8e0ae9348a8ca5f58a006662eab635

Contents?: true

Size: 1.02 KB

Versions: 14

Compression:

Stored size: 1.02 KB

Contents

/*
** © 2014 by Philipp Dunkel <pip@pipobscure.com>
** Licensed under MIT License.
*/

void FSEvents::emitEvent(const char *path, UInt32 flags, UInt64 id) {
  if (!handler) return;
  Nan::HandleScope handle_scope;
  v8::Local<v8::Value> argv[] = {
    Nan::New<v8::String>(path).ToLocalChecked(),
    Nan::New<v8::Number>(flags),
    Nan::New<v8::Number>(id)
  };
  handler->Call(3, argv);
}

NAN_METHOD(FSEvents::New) {
  Nan::Utf8String *path = new Nan::Utf8String(info[0]);
  Nan::Callback *callback = new Nan::Callback(info[1].As<v8::Function>());

  FSEvents *fse = new FSEvents(**path, callback);
  fse->Wrap(info.This());

  info.GetReturnValue().Set(info.This());
}

NAN_METHOD(FSEvents::Stop) {
  FSEvents* fse = node::ObjectWrap::Unwrap<FSEvents>(info.This());

  fse->threadStop();
  fse->asyncStop();

  info.GetReturnValue().Set(info.This());
}

NAN_METHOD(FSEvents::Start) {
  FSEvents* fse = node::ObjectWrap::Unwrap<FSEvents>(info.This());
  fse->asyncStart();
  fse->threadStart();

  info.GetReturnValue().Set(info.This());
}

Version data entries

14 entries across 14 versions & 5 rubygems

Version Path
affiliator-0.2.1 node_modules/fsevents/src/methods.cc
lanes-0.8.0 node_modules/fsevents/src/methods.cc
brwy_rails-0.0.6 test/dummy/node_modules/fsevents/src/methods.cc
brwy_rails-0.0.5 test/dummy/node_modules/fsevents/src/methods.cc
brwy_rails-0.0.4 test/dummy/node_modules/fsevents/src/methods.cc
brwy_rails-0.0.3 test/dummy/node_modules/fsevents/src/methods.cc
brwy_rails-0.0.2 test/dummy/node_modules/fsevents/src/methods.cc
brwy_rails-0.0.1 test/dummy/node_modules/fsevents/src/methods.cc
es6_tilt-0.1.2 test/dummy/app/assets/javascripts/node_modules/fsevents/src/methods.cc
es6_tilt-0.1.1 test/dummy/app/assets/javascripts/node_modules/fsevents/src/methods.cc
es6_tilt-0.1.0 test/dummy/app/assets/javascripts/node_modules/fsevents/src/methods.cc
gulp_assets-1.0.0.pre.5 template/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc
gulp_assets-1.0.0.pre.4 template/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc
gulp_assets-1.0.0.pre.3 template/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc