Sha256: fd373324fe7d51467451db696f0d0c7b4062187cdd97ac8e0b24d56e4fb5af00

Contents?: true

Size: 1007 Bytes

Versions: 79

Compression:

Stored size: 1007 Bytes

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;
  NanScope();
  v8::Local<v8::Value> argv[] = {
    NanNew<v8::String>(path),
    NanNew<v8::Number>(flags),
    NanNew<v8::Number>(id)
  };
  handler->Call(3, argv);
}

NAN_METHOD(FSEvents::New) {
  NanScope();

  NanUtf8String *path = new NanUtf8String(args[0]);
  NanCallback *callback = new NanCallback(args[1].As<v8::Function>());

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

  NanReturnValue(args.This());
}

NAN_METHOD(FSEvents::Stop) {
  NanScope();

  FSEvents* fse = node::ObjectWrap::Unwrap<FSEvents>(args.This());

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

  NanReturnValue(args.This());
}

NAN_METHOD(FSEvents::Start) {
  NanScope();

  FSEvents* fse = node::ObjectWrap::Unwrap<FSEvents>(args.This());
  fse->asyncStart();
  fse->threadStart();

  NanReturnValue(args.This());
}

Version data entries

79 entries across 79 versions & 3 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/chokidar/node_modules/fsevents/src/methods.cc
hooch-0.4.1 jasmine/node_modules/karma/node_modules/chokidar/node_modules/fsevents/src/methods.cc
hooch-0.4.0 jasmine/node_modules/karma/node_modules/chokidar/node_modules/fsevents/src/methods.cc
hooch-0.3.0 jasmine/node_modules/karma/node_modules/chokidar/node_modules/fsevents/src/methods.cc
hooch-0.2.1 jasmine/node_modules/karma/node_modules/chokidar/node_modules/fsevents/src/methods.cc
hooch-0.2.0 jasmine/node_modules/karma/node_modules/chokidar/node_modules/fsevents/src/methods.cc
hooch-0.1.0 jasmine/node_modules/karma/node_modules/chokidar/node_modules/fsevents/src/methods.cc
hooch-0.0.8 jasmine/node_modules/karma/node_modules/chokidar/node_modules/fsevents/src/methods.cc
hooch-0.0.7 jasmine/node_modules/karma/node_modules/chokidar/node_modules/fsevents/src/methods.cc
hooch-0.0.6 jasmine/node_modules/karma/node_modules/chokidar/node_modules/fsevents/src/methods.cc
smock-0.1.268 node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc
smock-0.1.267 node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc
smock-0.1.266 node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc
smock-0.1.265 node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc
smock-0.1.264 node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc
smock-0.1.263 node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc
smock-0.1.262 node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc
smock-0.1.261 node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc
smock-0.1.260 node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc
smock-0.1.259 node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/src/methods.cc