Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
188 lines (154 loc) · 4.32 KB

File metadata and controls

188 lines (154 loc) · 4.32 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#ifndef GITPATCH_H
#define GITPATCH_H
// generated from class_header.h
#include <nan.h>
#include <string>
#include <queue>
extern "C" {
#include <git2.h>
}
#include "../include/blob.h"
#include "../include/diff_options.h"
#include "../include/diff.h"
#include "../include/diff_delta.h"
#include "../include/diff_hunk.h"
#include "../include/diff_line.h"
// Forward declaration.
struct git_patch {
};
using namespace node;
using namespace v8;
class GitPatch : public Nan::ObjectWrap {
public:
static Nan::Persistent<Function> constructor_template;
static void InitializeComponent (Local<v8::Object> target);
git_patch *GetValue();
git_patch **GetRefValue();
void ClearValue();
static Local<v8::Value> New(void *raw, bool selfFreeing);
bool selfFreeing;
private:
GitPatch(git_patch *raw, bool selfFreeing);
~GitPatch();
static NAN_METHOD(JSNewFunction);
struct FromBlobAndBufferBaton {
int error_code;
const git_error* error;
git_patch * out;
const git_blob * old_blob;
const char * old_as_path;
const char * buffer;
size_t buffer_len;
const char * buffer_as_path;
const git_diff_options * opts;
};
class FromBlobAndBufferWorker : public Nan::AsyncWorker {
public:
FromBlobAndBufferWorker(
FromBlobAndBufferBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FromBlobAndBufferWorker() {};
void Execute();
void HandleOKCallback();
private:
FromBlobAndBufferBaton *baton;
};
static NAN_METHOD(FromBlobAndBuffer);
struct FromBlobsBaton {
int error_code;
const git_error* error;
git_patch * out;
const git_blob * old_blob;
const char * old_as_path;
const git_blob * new_blob;
const char * new_as_path;
const git_diff_options * opts;
};
class FromBlobsWorker : public Nan::AsyncWorker {
public:
FromBlobsWorker(
FromBlobsBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FromBlobsWorker() {};
void Execute();
void HandleOKCallback();
private:
FromBlobsBaton *baton;
};
static NAN_METHOD(FromBlobs);
struct FromDiffBaton {
int error_code;
const git_error* error;
git_patch * out;
git_diff * diff;
size_t idx;
};
class FromDiffWorker : public Nan::AsyncWorker {
public:
FromDiffWorker(
FromDiffBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FromDiffWorker() {};
void Execute();
void HandleOKCallback();
private:
FromDiffBaton *baton;
};
static NAN_METHOD(FromDiff);
static NAN_METHOD(GetDelta);
struct GetHunkBaton {
int error_code;
const git_error* error;
const git_diff_hunk * out;
size_t * lines_in_hunk;
git_patch * patch;
size_t hunk_idx;
};
class GetHunkWorker : public Nan::AsyncWorker {
public:
GetHunkWorker(
GetHunkBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GetHunkWorker() {};
void Execute();
void HandleOKCallback();
private:
GetHunkBaton *baton;
};
static NAN_METHOD(GetHunk);
struct GetLineInHunkBaton {
int error_code;
const git_error* error;
const git_diff_line * out;
git_patch * patch;
size_t hunk_idx;
size_t line_of_hunk;
};
class GetLineInHunkWorker : public Nan::AsyncWorker {
public:
GetLineInHunkWorker(
GetLineInHunkBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GetLineInHunkWorker() {};
void Execute();
void HandleOKCallback();
private:
GetLineInHunkBaton *baton;
};
static NAN_METHOD(GetLineInHunk);
static NAN_METHOD(NumHunks);
static NAN_METHOD(NumLinesInHunk);
static NAN_METHOD(Size);
git_patch *raw;
};
#endif
Morty Proxy This is a proxified and sanitized view of the page, visit original site.