// This is a generated file, modify: generate/templates/templates/class_header.h

#ifndef GITIGNORE_H
#define GITIGNORE_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>

#include "async_baton.h"
#include "async_worker.h"
#include "context.h"
#include "lock_master.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"

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

#include "../include/typedefs.h"

#include "../include/repository.h"

using namespace node;
using namespace v8;


class GitIgnore : public
  Nan::ObjectWrap
{
   public:
    static void InitializeComponent (v8::Local<v8::Object> target, nodegit::Context *nodegitContext);

             

  private:

    static NAN_METHOD(AddRule);

    static NAN_METHOD(ClearInternalRules);

    struct PathIsIgnoredBaton {
      int error_code;
      const git_error* error;
      int * ignored;
      git_repository * repo;
      const char * path;
    };
    class PathIsIgnoredWorker : public nodegit::AsyncWorker {
      public:
        PathIsIgnoredWorker(
            PathIsIgnoredBaton *_baton,
            Nan::Callback *callback
        ) : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:GitIgnore:PathIsIgnored")
          , baton(_baton) {};
        ~PathIsIgnoredWorker() {};
        void Execute();
        void HandleErrorCallback();
        void HandleOKCallback();
        nodegit::LockMaster AcquireLocks();

      private:
        PathIsIgnoredBaton *baton;
    };

    static NAN_METHOD(PathIsIgnored);
};

#endif
