-
Notifications
You must be signed in to change notification settings - Fork 699
Expand file tree
/
Copy pathobject.h
More file actions
executable file
·93 lines (77 loc) · 1.99 KB
/
object.h
File metadata and controls
executable file
·93 lines (77 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
Copyright (c) 2011, Tim Branyen @tbranyen <tim@tabdeveloper.com>
*/
#ifndef OBJ_H
#define OBJ_H
#include <v8.h>
#include <node.h>
#include <node_events.h>
#include "../vendor/libgit2/include/git2.h"
#include "repo.h"
#include "oid.h"
using namespace node;
/**
* Class wrapper for libgit2 git_object
*/
class GitObject : public EventEmitter {
public:
/**
* v8::FunctionTemplate used to create Node.js constructor
*/
static Persistent<FunctionTemplate> constructor_template;
/**
* Used to intialize the EventEmitter from Node.js
*
* @param target v8::Object the Node.js module object
*/
static void Initialize(Handle<v8::Object> target);
/**
* Accessor for Object
*
* @return the internal git_object reference
*/
git_object* GetValue();
/**
* Mutator for Object
*
* @param obj a git_object object
*/
void SetValue(git_object* obj);
const git_oid* Id();
git_otype Type();
git_repository* Owner();
const char* Type2String(git_otype type);
git_otype String2Type(const char* type);
int TypeIsLoose(git_otype type);
size_t Size(git_otype type);
protected:
/**
* Constructor
*/
GitObject() {};
/**
* Deconstructor
*/
~GitObject() {};
/**
* Mutator for GitObject
*
* @param args v8::Arguments function call arguments from Node.js
*
* @return v8::Object args.This()
*/
static Handle<Value> New(const Arguments& args);
static Handle<Value> Id(const Arguments& args);
static Handle<Value> Type(const Arguments& args);
static Handle<Value> Owner(const Arguments& args);
static Handle<Value> Type2String(const Arguments& args);
static Handle<Value> String2Type(const Arguments& args);
static Handle<Value> TypeIsLoose(const Arguments& args);
static Handle<Value> Size(const Arguments& args);
private:
/**
* Internal reference to git_object object
*/
git_object* obj;
};
#endif