@@ -20,177 +20,44 @@ using namespace v8;
2020using namespace node ;
2121
2222/* *
23- * Class: GitBlob
2423 * Wrapper for libgit2 git_blob.
2524 */
2625class GitBlob : public ObjectWrap {
2726 public:
28- /* *
29- * Variable: constructor_template
30- * Used to create Node.js constructor.
31- */
27+
3228 static Persistent<Function> constructor_template;
33- /* *
34- * Function: Initialize
35- * Used to intialize the EventEmitter from Node.js
36- *
37- * Parameters:
38- * target - Object the Node.js global module object
39- */
29+
4030 static void Initialize (Handle<Object> target);
41- /* *
42- * Accessor for GitBlob
43- *
44- * @return the internal git_blob reference
45- */
31+
4632 git_blob* GetValue ();
47- /* *
48- * Mutator for Object
49- *
50- * @param obj a git_object object
51- */
5233 void SetValue (git_blob* blob);
53- /* *
54- * Function: Lookup
55- * Lookup a blob object from a repository.
56- *
57- * Parameters:
58- * repo the repo to use when locating the blob.
59- * id identity of the blob to locate.
60- *
61- * Returns:
62- * 0 on success; error code otherwise
63- */
34+
6435 int Lookup (git_repository* repo, const git_oid *id);
65- /* *
66- *
67- * Function: Close
68- * Free a blob object.
69- */
70- void Close ();
71- /* *
72- *
73- * Function: CreateFromFile
74- * Read a file into the ODB.
75- *
76- * Returns:
77- * 0 on success, error code otherwise
78- */
36+
7937 int CreateFromFile (git_oid* oid, git_repository* repo, const char * path);
80- /* *
81- *
82- * Function: CreateFromBuffer
83- * Read a buffer into the ODB.
84- *
85- * Returns:
86- * 0 on success, error code otherwise
87- */
8838 int CreateFromBuffer (git_oid* oid, git_repository* repo, const void * buffer, size_t len);
8939
9040 protected:
91- /* *
92- * Constructor: GitBlob
93- */
9441 GitBlob () {};
95- /* *
96- * Deconstructor: GitBlob
97- */
9842 ~GitBlob () {};
99- /* *
100- * Function: New
101- *
102- * Parameters:
103- * args Arguments function call
104- *
105- * Returns:
106- * Object args.This()
107- */
43+
10844 static Handle<Value> New (const Arguments& args);
109- /* *
110- * Function: Lookup
111- *
112- * Parameters:
113- * args Arguments function call
114- *
115- * Returns:
116- * Object args.This()
117- */
45+
46+ static Handle<Value> CreateFromFile (const Arguments& args);
47+
11848 static Handle<Value> Lookup (const Arguments& args);
119- /* *
120- * Function: LookupWork
121- *
122- * Parameters:
123- * req - an uv_work_t pointer
124- *
125- */
12649 static void LookupWork (uv_work_t * req);
127- /* *
128- * Function: LookupAfterWork
129- *
130- * Parameters:
131- * req - an uv_work_t pointer
132- */
13350 static void LookupAfterWork (uv_work_t * req);
13451
135- /* *
136- * Function: RawContent
137- *
138- * Parameters:
139- * args Arguments function call
140- *
141- * Returns:
142- * Object args.This()
143- */
14452 static Handle<Value> RawContent (const Arguments& args);
14553 static void RawContentWork (uv_work_t * req);
14654 static void RawContentAfterWork (uv_work_t * req);
14755
148- /* *
149- * Function: RawSize
150- *
151- * Parameters:
152- * args Arguments function call
153- *
154- * Returns:
155- * Object args.This()
156- */
157- static Handle<Value> RawSize (const Arguments& args);
158- /* *
159- * Function: Close
160- *
161- * Parameters:
162- * args Arguments function call
163- *
164- * Returns:
165- * Object args.This()
166- */
167- static Handle<Value> Close (const Arguments& args);
168- /* *
169- * Function: CreateFromFile
170- *
171- * Parameters:
172- * args Arguments function call
173- *
174- * Returns:
175- * Object args.This()
176- */
17756 static Handle<Value> CreateFromFile (const Arguments& args);
178- /* *
179- * Function: CreateFromBuffer
180- *
181- * Parameters:
182- * args Arguments function call
183- *
184- * Returns:
185- * Object args.This()
186- */
18757 static Handle<Value> CreateFromBuffer (const Arguments& args);
18858
18959 private:
190- /* *
191- * Variable: blob
192- * Internal reference to git_blob object
193- */
60+
19461 git_blob* blob;
19562
19663 struct LookupBaton {
0 commit comments