Skip to content

Commit c27d9c3

Browse files
committed
Regenerated include/index_entry.h and src/index_entry.cc after new fields were added.
1 parent c372842 commit c27d9c3

File tree

2 files changed

+125
-0
lines changed

2 files changed

+125
-0
lines changed

include/index_entry.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ class GitIndexEntry : public ObjectWrap {
3232

3333
static Handle<Value> Ctime(const Arguments& args);
3434
static Handle<Value> Mtime(const Arguments& args);
35+
static Handle<Value> Dev(const Arguments& args);
36+
static Handle<Value> Ino(const Arguments& args);
37+
static Handle<Value> Mode(const Arguments& args);
38+
static Handle<Value> Uid(const Arguments& args);
39+
static Handle<Value> gid(const Arguments& args);
40+
static Handle<Value> FileSize(const Arguments& args);
41+
static Handle<Value> Oid(const Arguments& args);
42+
static Handle<Value> Flags(const Arguments& args);
43+
static Handle<Value> FlagsExtended(const Arguments& args);
3544
static Handle<Value> Path(const Arguments& args);
3645

3746
git_index_entry *raw;

src/index_entry.cc

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "../include/index_entry.h"
1313
#include "../include/index_time.h"
14+
#include "../include/oid.h"
1415

1516
using namespace v8;
1617
using 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+
103219
Handle<Value> GitIndexEntry::Path(const Arguments& args) {
104220
HandleScope scope;
105221
Handle<Value> to;

0 commit comments

Comments
 (0)