#ifndef GITSTATUS_H
#define GITSTATUS_H
// generated from class_header.h
#include <nan.h>
#include <string>

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

#include "../include/repository.h"
#include "../include/status_list.h"
#include "../include/diff_perfdata.h"

using namespace node;
using namespace v8;

class GitStatus : public ObjectWrap {
public:

  static Persistent<Function> constructor_template;
  static void InitializeComponent (Handle<v8::Object> target);

  bool selfFreeing;

private:

  static NAN_METHOD(JSNewFunction);


  static NAN_METHOD(File);

  static NAN_METHOD(ListEntrycount);

  static NAN_METHOD(ListFree);

  struct ListGetPerfdataBaton {
    int error_code;
    const git_error* error;
    git_diff_perfdata * out;
    const git_status_list * status;
  };
  class ListGetPerfdataWorker : public NanAsyncWorker {
  public:
    ListGetPerfdataWorker(
      ListGetPerfdataBaton *_baton,
      NanCallback *callback
    ) : NanAsyncWorker(callback)
      , baton(_baton) {};
    ~ListGetPerfdataWorker() {};
    void Execute();
    void HandleOKCallback();

  private:
    ListGetPerfdataBaton *baton;
  };

  static NAN_METHOD(ListGetPerfdata);

  static NAN_METHOD(ShouldIgnore);
};

#endif
