|
1 | | -/* |
2 | | - * Copyright 2011, Tim Branyen @tbranyen <tim@tabdeveloper.com> |
3 | | - * @author Michael Robinson @codeofinterest <mike@pagesofinterest.net> |
4 | | - * |
5 | | - * Dual licensed under the MIT and GPL licenses. |
6 | | - */ |
| 1 | +/** |
| 2 | + * This code is auto-generated; unless you know what you're doing, do not modify! |
| 3 | + **/ |
| 4 | + |
| 5 | +#ifndef GITCOMMIT_H |
| 6 | +#define GITCOMMIT_H |
7 | 7 |
|
8 | 8 | #include <v8.h> |
9 | 9 | #include <node.h> |
10 | | -#include <vector> |
| 10 | +#include <string> |
11 | 11 |
|
12 | 12 | #include "git2.h" |
13 | 13 |
|
14 | | -#include "reference.h" |
15 | | -#include "repo.h" |
16 | | -#include "oid.h" |
17 | | -#include "tree.h" |
18 | | - |
19 | 14 | using namespace node; |
20 | 15 | using namespace v8; |
21 | 16 |
|
22 | | -/** |
23 | | - * Class wrapper for libgit2 git_commit |
24 | | - */ |
25 | 17 | class GitCommit : public ObjectWrap { |
26 | 18 | public: |
27 | | - /** |
28 | | - * v8::FunctionTemplate used to create Node.js constructor |
29 | | - */ |
30 | | - static Persistent<Function> constructor_template; |
31 | 19 |
|
32 | | - /** |
33 | | - * Used to intialize the EventEmitter from Node.js |
34 | | - * |
35 | | - * @param target v8::Object the Node.js module object |
36 | | - */ |
| 20 | + static Persistent<Function> constructor_template; |
37 | 21 | static void Initialize (Handle<v8::Object> target); |
38 | 22 |
|
39 | | - git_commit* GetValue(); |
40 | | - void SetValue(git_commit* commit); |
41 | | - void SetOid(git_oid* oid); |
| 23 | + git_commit *GetValue(); |
42 | 24 |
|
43 | | - protected: |
44 | | - GitCommit() {} |
45 | | - ~GitCommit() {} |
| 25 | + private: |
| 26 | + GitCommit(git_commit *raw); |
| 27 | + ~GitCommit(); |
46 | 28 |
|
47 | 29 | static Handle<Value> New(const Arguments& args); |
48 | | - static Handle<Value> Free(const Arguments& args); |
| 30 | + |
49 | 31 |
|
50 | 32 | static Handle<Value> Lookup(const Arguments& args); |
51 | | - static void LookupWork(uv_work_t *req); |
52 | | - static void LookupAfterWork(uv_work_t *req); |
| 33 | + static void LookupWork(uv_work_t* req); |
| 34 | + static void LookupAfterWork(uv_work_t* req); |
53 | 35 |
|
| 36 | + struct LookupBaton { |
| 37 | + uv_work_t request; |
| 38 | + const git_error* error; |
| 39 | + git_commit * commit; |
| 40 | + git_repository * repo; |
| 41 | + const git_oid * id; |
| 42 | + Persistent<Function> callback; |
| 43 | + }; |
54 | 44 | static Handle<Value> Oid(const Arguments& args); |
55 | | - |
| 45 | + static Handle<Value> MessageEncoding(const Arguments& args); |
56 | 46 | static Handle<Value> Message(const Arguments& args); |
57 | | - static void MessageWork(uv_work_t* req); |
58 | | - static void MessageAfterWork(uv_work_t* req); |
59 | | - |
60 | 47 | static Handle<Value> Time(const Arguments& args); |
61 | | - static void TimeWork(uv_work_t* req); |
62 | | - static void TimeAfterWork(uv_work_t* req); |
63 | | - |
64 | 48 | static Handle<Value> Offset(const Arguments& args); |
65 | | - static void OffsetWork(uv_work_t* req); |
66 | | - static void OffsetAfterWork(uv_work_t* req); |
67 | | - |
68 | | - static Handle<Value> Author(const Arguments& args); |
69 | | - static void AuthorWork(uv_work_t* req); |
70 | | - static void AuthorAfterWork(uv_work_t* req); |
71 | | - |
72 | 49 | static Handle<Value> Committer(const Arguments& args); |
73 | | - static void CommitterWork(uv_work_t* req); |
74 | | - static void CommitterAfterWork(uv_work_t* req); |
75 | | - |
| 50 | + static Handle<Value> Author(const Arguments& args); |
76 | 51 | static Handle<Value> Tree(const Arguments& args); |
77 | 52 | static void TreeWork(uv_work_t* req); |
78 | 53 | static void TreeAfterWork(uv_work_t* req); |
79 | 54 |
|
80 | | - static Handle<Value> Parents(const Arguments& args); |
81 | | - static void ParentsWork(uv_work_t* req); |
82 | | - static void ParentsAfterWork(uv_work_t* req); |
83 | | - |
84 | | - private: |
85 | | - git_commit* commit; |
86 | | - git_oid* oid; |
87 | | - |
88 | | - struct LookupBaton { |
89 | | - uv_work_t request; |
90 | | - const git_error* error; |
91 | | - |
92 | | - git_repository* repo; |
93 | | - git_oid rawOid; |
94 | | - std::string sha; |
95 | | - git_commit* rawCommit; |
96 | | - |
97 | | - Persistent<Function> callback; |
98 | | - }; |
99 | | - |
100 | | - struct MessageBaton { |
101 | | - uv_work_t request; |
102 | | - |
103 | | - git_commit* rawCommit; |
104 | | - std::string message; |
105 | | - |
106 | | - Persistent<Function> callback; |
107 | | - }; |
108 | | - |
109 | | - struct TimeBaton { |
110 | | - uv_work_t request; |
111 | | - |
112 | | - git_commit* rawCommit; |
113 | | - git_time_t time; |
114 | | - |
115 | | - Persistent<Function> callback; |
116 | | - }; |
117 | | - |
118 | | - struct SignatureBaton { |
119 | | - uv_work_t request; |
120 | | - |
121 | | - git_commit* rawCommit; |
122 | | - const git_signature* rawSignature; |
123 | | - |
124 | | - Persistent<Function> callback; |
125 | | - }; |
126 | | - |
127 | | - struct OffsetBaton { |
128 | | - uv_work_t request; |
129 | | - |
130 | | - git_commit* rawCommit; |
131 | | - int offset; |
132 | | - |
133 | | - Persistent<Function> callback; |
134 | | - }; |
135 | | - |
136 | | - |
137 | 55 | struct TreeBaton { |
138 | 56 | uv_work_t request; |
139 | 57 | const git_error* error; |
140 | | - |
141 | | - git_commit* rawCommit; |
142 | | - git_tree* rawTree; |
143 | | - |
| 58 | + git_tree * tree_out; |
| 59 | + const git_commit * commit; |
144 | 60 | Persistent<Function> callback; |
145 | 61 | }; |
| 62 | + static Handle<Value> TreeId(const Arguments& args); |
| 63 | + static Handle<Value> ParentCount(const Arguments& args); |
| 64 | + static Handle<Value> Parent(const Arguments& args); |
| 65 | + static void ParentWork(uv_work_t* req); |
| 66 | + static void ParentAfterWork(uv_work_t* req); |
146 | 67 |
|
147 | | - struct Parent { |
148 | | - const git_oid* rawOid; |
149 | | - git_commit* rawCommit; |
150 | | - }; |
151 | | - |
152 | | - struct ParentsBaton { |
| 68 | + struct ParentBaton { |
153 | 69 | uv_work_t request; |
154 | 70 | const git_error* error; |
155 | | - |
156 | | - int index; |
157 | | - git_commit* rawCommit; |
158 | | - std::vector<Parent* > parents; |
159 | | - |
| 71 | + git_commit * out; |
| 72 | + git_commit * commit; |
| 73 | + unsigned int n; |
160 | 74 | Persistent<Function> callback; |
161 | 75 | }; |
| 76 | + git_commit *raw; |
162 | 77 | }; |
| 78 | + |
| 79 | +#endif |
0 commit comments