// This is a generated file, modify: generate/templates/class.cc.
#include <nan.h>
#include <string.h>

extern "C" {
#include <git2.h>
}

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


using namespace v8;
using namespace node;

GitCheckoutOptions::GitCheckoutOptions(git_checkout_options *raw) {
  this->raw = raw;
}

GitCheckoutOptions::~GitCheckoutOptions() {
  }

void GitCheckoutOptions::Initialize(Handle<v8::Object> target) {
  NanScope();

  Local<FunctionTemplate> tpl = NanNew<FunctionTemplate>(New);

  tpl->InstanceTemplate()->SetInternalFieldCount(1);
  tpl->SetClassName(NanNew<String>("CheckoutOptions"));

  
  
  Local<Function> _constructor_template = tpl->GetFunction();
  NanAssignPersistent(constructor_template, _constructor_template);
  target->Set(NanNew<String>("CheckoutOptions"), _constructor_template);
}

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

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

  NanReturnValue(args.This());
}

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

git_checkout_options *GitCheckoutOptions::GetValue() {
  return this->raw;
}



Persistent<Function> GitCheckoutOptions::constructor_template;
