[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/nodegit/nodegit/v0.1.4/src/diff_options.cc [Back]  [Original]

/**
 * This code is auto-generated; unless you know what you're doing, do not modify!
 **/
#include 
#include 

#include "git2.h"

#include "../include/functions/copy.h"

#include "../include/diff_options.h"

using namespace v8;
using namespace node;

GitDiffOptions::GitDiffOptions(git_diff_options *raw) {
  this->raw = raw;
}

GitDiffOptions::~GitDiffOptions() {
  free(this->raw);
}

void GitDiffOptions::Initialize(Handle target) {
  NanScope();

  Local tpl = NanNew(New);

  tpl->InstanceTemplate()->SetInternalFieldCount(1);
  tpl->SetClassName(NanNew("DiffOptions"));


  Local _constructor_template = tpl->GetFunction();
  NanAssignPersistent(constructor_template, _constructor_template);
  target->Set(NanNew("DiffOptions"), _constructor_template);
}

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

  if (args.Length() == 0 || !args[0]->IsExternal()) {
    return NanThrowError("git_diff_options is required.");
  }
  GitDiffOptions* object = new GitDiffOptions(static_cast(Handle::Cast(args[0])->Value()));
  object->Wrap(args.This());

  NanReturnValue(args.This());
}

Handle GitDiffOptions::New(void *raw) {
  NanEscapableScope();
  Handle argv[1] = { NanNew((void *)raw) };
  return NanEscapeScope(NanNew(GitDiffOptions::constructor_template)->NewInstance(1, argv));
}

git_diff_options *GitDiffOptions::GetValue() {
  return this->raw;
}


Persistent GitDiffOptions::constructor_template;

Web Proxy Viewer  |  New URL  |  Original Page