#ifndef GITTREEENTRY_H
#define GITTREEENTRY_H

#include <nan.h>
#include <string>

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

#include "../include/tree.h"
#include "../include/types.h"
#include "../include/oid.h"

// Forward declaration.
struct git_tree_entry {
            uint16_t removed;
                uint16_t attr;
                git_oid oid;
                size_t filename_len;
                char filename[1];
      };

using namespace node;
using namespace v8;

class GitTreeEntry : public ObjectWrap {
  public:

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

        git_tree_entry *GetValue();

    static Handle<Value> New(void *raw);
    
  private:
        GitTreeEntry(git_tree_entry *raw);
    ~GitTreeEntry();
    
    static NAN_METHOD(New);

              static NAN_METHOD(Removed);
                    static NAN_METHOD(Attr);
                    static NAN_METHOD(Oid);
                    static NAN_METHOD(FilenameLen);
                    static NAN_METHOD(Filename);
          
    
        git_tree_entry *raw;
    };

#endif
