1111
1212#include " ../include/index_entry.h"
1313#include " ../include/index_time.h"
14+ #include " ../include/oid.h"
1415
1516using namespace v8 ;
1617using namespace node ;
@@ -34,6 +35,15 @@ void GitIndexEntry::Initialize(Handle<v8::Object> target) {
3435
3536 NODE_SET_PROTOTYPE_METHOD (tpl, " ctime" , Ctime);
3637 NODE_SET_PROTOTYPE_METHOD (tpl, " mtime" , Mtime);
38+ NODE_SET_PROTOTYPE_METHOD (tpl, " dev" , Dev);
39+ NODE_SET_PROTOTYPE_METHOD (tpl, " ino" , Ino);
40+ NODE_SET_PROTOTYPE_METHOD (tpl, " mode" , Mode);
41+ NODE_SET_PROTOTYPE_METHOD (tpl, " uid" , Uid);
42+ NODE_SET_PROTOTYPE_METHOD (tpl, " gid" , gid);
43+ NODE_SET_PROTOTYPE_METHOD (tpl, " file_size" , FileSize);
44+ NODE_SET_PROTOTYPE_METHOD (tpl, " oid" , Oid);
45+ NODE_SET_PROTOTYPE_METHOD (tpl, " flags" , Flags);
46+ NODE_SET_PROTOTYPE_METHOD (tpl, " flags_extended" , FlagsExtended);
3747 NODE_SET_PROTOTYPE_METHOD (tpl, " path" , Path);
3848
3949 constructor_template = Persistent<Function>::New (tpl->GetFunction ());
@@ -100,6 +110,112 @@ Handle<Value> GitIndexEntry::Mtime(const Arguments& args) {
100110 return scope.Close (to);
101111}
102112
113+ Handle<Value> GitIndexEntry::Dev (const Arguments& args) {
114+ HandleScope scope;
115+ Handle<Value> to;
116+
117+ unsigned int dev =
118+ ObjectWrap::Unwrap<GitIndexEntry>(args.This ())->GetValue ()->dev ;
119+
120+ to = Uint32::New (dev);
121+ return scope.Close (to);
122+ }
123+
124+ Handle<Value> GitIndexEntry::Ino (const Arguments& args) {
125+ HandleScope scope;
126+ Handle<Value> to;
127+
128+ unsigned int ino =
129+ ObjectWrap::Unwrap<GitIndexEntry>(args.This ())->GetValue ()->ino ;
130+
131+ to = Uint32::New (ino);
132+ return scope.Close (to);
133+ }
134+
135+ Handle<Value> GitIndexEntry::Mode (const Arguments& args) {
136+ HandleScope scope;
137+ Handle<Value> to;
138+
139+ uint16_t mode =
140+ ObjectWrap::Unwrap<GitIndexEntry>(args.This ())->GetValue ()->mode ;
141+
142+ to = Integer::New (mode);
143+ return scope.Close (to);
144+ }
145+
146+ Handle<Value> GitIndexEntry::Uid (const Arguments& args) {
147+ HandleScope scope;
148+ Handle<Value> to;
149+
150+ unsigned int uid =
151+ ObjectWrap::Unwrap<GitIndexEntry>(args.This ())->GetValue ()->uid ;
152+
153+ to = Uint32::New (uid);
154+ return scope.Close (to);
155+ }
156+
157+ Handle<Value> GitIndexEntry::gid (const Arguments& args) {
158+ HandleScope scope;
159+ Handle<Value> to;
160+
161+ unsigned int gid =
162+ ObjectWrap::Unwrap<GitIndexEntry>(args.This ())->GetValue ()->gid ;
163+
164+ to = Uint32::New (gid);
165+ return scope.Close (to);
166+ }
167+
168+ Handle<Value> GitIndexEntry::FileSize (const Arguments& args) {
169+ HandleScope scope;
170+ Handle<Value> to;
171+
172+ unsigned int file_size =
173+ ObjectWrap::Unwrap<GitIndexEntry>(args.This ())->GetValue ()->file_size ;
174+
175+ to = Uint32::New (file_size);
176+ return scope.Close (to);
177+ }
178+
179+ Handle<Value> GitIndexEntry::Oid (const Arguments& args) {
180+ HandleScope scope;
181+ Handle<Value> to;
182+
183+ git_oid *oid =
184+ &ObjectWrap::Unwrap<GitIndexEntry>(args.This ())->GetValue ()->oid ;
185+
186+ if (oid != NULL ) {
187+ oid = (git_oid *)git_oid_dup (oid);
188+ }
189+ if (oid != NULL ) {
190+ to = GitOid::New ((void *)oid);
191+ } else {
192+ to = Null ();
193+ }
194+ return scope.Close (to);
195+ }
196+
197+ Handle<Value> GitIndexEntry::Flags (const Arguments& args) {
198+ HandleScope scope;
199+ Handle<Value> to;
200+
201+ uint16_t flags =
202+ ObjectWrap::Unwrap<GitIndexEntry>(args.This ())->GetValue ()->flags ;
203+
204+ to = Integer::New (flags);
205+ return scope.Close (to);
206+ }
207+
208+ Handle<Value> GitIndexEntry::FlagsExtended (const Arguments& args) {
209+ HandleScope scope;
210+ Handle<Value> to;
211+
212+ uint16_t flags_extended =
213+ ObjectWrap::Unwrap<GitIndexEntry>(args.This ())->GetValue ()->flags_extended ;
214+
215+ to = Integer::New (flags_extended);
216+ return scope.Close (to);
217+ }
218+
103219Handle<Value> GitIndexEntry::Path (const Arguments& args) {
104220 HandleScope scope;
105221 Handle<Value> to;
0 commit comments