Initial commit - full huishou project

This commit is contained in:
jiapengyu
2026-07-27 14:07:26 +08:00
commit 60790ad1b3
39127 changed files with 5989265 additions and 0 deletions
+180
View File
@@ -0,0 +1,180 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITANNOTATEDCOMMIT_H
#define GITANNOTATEDCOMMIT_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
#include "../include/oid.h"
#include "../include/reference.h"
// Forward declaration.
struct git_annotated_commit {
};
using namespace node;
using namespace v8;
class GitAnnotatedCommit;
struct GitAnnotatedCommitTraits {
typedef GitAnnotatedCommit cppClass;
typedef git_annotated_commit cType;
static const bool isDuplicable = false;
static void duplicate(git_annotated_commit **dest, git_annotated_commit *src) {
Nan::ThrowError("duplicate called on GitAnnotatedCommit which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_annotated_commit *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_annotated_commit_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitAnnotatedCommit : public
NodeGitWrapper<GitAnnotatedCommitTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitAnnotatedCommitTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitAnnotatedCommit()
: NodeGitWrapper<GitAnnotatedCommitTraits>(
"A new GitAnnotatedCommit cannot be instantiated."
)
{}
GitAnnotatedCommit(git_annotated_commit *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitAnnotatedCommitTraits>(raw, selfFreeing, owner)
{}
~GitAnnotatedCommit();
struct FromFetchheadBaton {
int error_code;
const git_error* error;
git_annotated_commit * out;
git_repository * repo;
const char * branch_name;
const char * remote_url;
const git_oid * id;
bool idNeedsFree;
};
class FromFetchheadWorker : public Nan::AsyncWorker {
public:
FromFetchheadWorker(
FromFetchheadBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FromFetchheadWorker() {};
void Execute();
void HandleOKCallback();
private:
FromFetchheadBaton *baton;
};
static NAN_METHOD(FromFetchhead);
struct FromRefBaton {
int error_code;
const git_error* error;
git_annotated_commit * out;
git_repository * repo;
const git_reference * ref;
};
class FromRefWorker : public Nan::AsyncWorker {
public:
FromRefWorker(
FromRefBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FromRefWorker() {};
void Execute();
void HandleOKCallback();
private:
FromRefBaton *baton;
};
static NAN_METHOD(FromRef);
struct FromRevspecBaton {
int error_code;
const git_error* error;
git_annotated_commit * out;
git_repository * repo;
const char * revspec;
};
class FromRevspecWorker : public Nan::AsyncWorker {
public:
FromRevspecWorker(
FromRevspecBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FromRevspecWorker() {};
void Execute();
void HandleOKCallback();
private:
FromRevspecBaton *baton;
};
static NAN_METHOD(FromRevspec);
static NAN_METHOD(Id);
struct LookupBaton {
int error_code;
const git_error* error;
git_annotated_commit * out;
git_repository * repo;
const git_oid * id;
bool idNeedsFree;
};
class LookupWorker : public Nan::AsyncWorker {
public:
LookupWorker(
LookupBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LookupWorker() {};
void Execute();
void HandleOKCallback();
private:
LookupBaton *baton;
};
static NAN_METHOD(Lookup);
static NAN_METHOD(Ref);
};
#endif
+72
View File
@@ -0,0 +1,72 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITAPPLY_H
#define GITAPPLY_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
#include "../include/diff.h"
#include "../include/apply_options.h"
#include "../include/index.h"
#include "../include/tree.h"
using namespace node;
using namespace v8;
class GitApply : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
static NAN_METHOD(Apply);
struct ToTreeBaton {
int error_code;
const git_error* error;
git_index * out;
git_repository * repo;
git_tree * preimage;
git_diff * diff;
const git_apply_options * options;
};
class ToTreeWorker : public Nan::AsyncWorker {
public:
ToTreeWorker(
ToTreeBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ToTreeWorker() {};
void Execute();
void HandleOKCallback();
private:
ToTreeBaton *baton;
};
static NAN_METHOD(ToTree);
};
#endif
+114
View File
@@ -0,0 +1,114 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITAPPLYOPTIONS_H
#define GITAPPLYOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
#include "../include/diff_delta.h"
#include "../include/diff_hunk.h"
using namespace node;
using namespace v8;
class GitApplyOptions;
struct GitApplyOptionsTraits {
typedef GitApplyOptions cppClass;
typedef git_apply_options cType;
static const bool isDuplicable = false;
static void duplicate(git_apply_options **dest, git_apply_options *src) {
Nan::ThrowError("duplicate called on GitApplyOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = false;
static void free(git_apply_options *raw) {
Nan::ThrowError("free called on GitApplyOptions which cannot be freed");
}
};
class GitApplyOptions : public NodeGitWrapper<GitApplyOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitApplyOptionsTraits>;
public:
GitApplyOptions(git_apply_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
static int delta_cb_cppCallback (
const git_diff_delta * delta
,
void * payload
);
static void delta_cb_async(void *baton);
static void delta_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct DeltaCbBaton : public AsyncBatonWithResult<int> {
const git_diff_delta * delta;
void * payload;
DeltaCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitApplyOptions * delta_cb_getInstanceFromBaton (
DeltaCbBaton *baton);
static int hunk_cb_cppCallback (
const git_diff_hunk * hunk
,
void * payload
);
static void hunk_cb_async(void *baton);
static void hunk_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct HunkCbBaton : public AsyncBatonWithResult<int> {
const git_diff_hunk * hunk;
void * payload;
HunkCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitApplyOptions * hunk_cb_getInstanceFromBaton (
HunkCbBaton *baton);
private:
GitApplyOptions();
~GitApplyOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
CallbackWrapper delta_cb;
static NAN_GETTER(GetDeltaCb);
static NAN_SETTER(SetDeltaCb);
CallbackWrapper hunk_cb;
static NAN_GETTER(GetHunkCb);
static NAN_SETTER(SetHunkCb);
Nan::Persistent<Value> payload;
static NAN_GETTER(GetPayload);
static NAN_SETTER(SetPayload);
};
#endif
+97
View File
@@ -0,0 +1,97 @@
#ifndef ASYNC_BATON
#define ASYNC_BATON
#include <uv.h>
#include <nan.h>
#include "lock_master.h"
#include "nodegit.h"
// Base class for Batons used for callbacks (for example,
// JS functions passed as callback parameters,
// or field properties of configuration objects whose values are callbacks)
struct AsyncBaton {
uv_sem_t semaphore;
virtual ~AsyncBaton() {}
};
void deleteBaton(AsyncBaton *baton);
template<typename ResultT>
struct AsyncBatonWithResult : public AsyncBaton {
ResultT result;
ResultT defaultResult; // result returned if the callback doesn't return anything valid
void (*onCompletion)(AsyncBaton *);
AsyncBatonWithResult(const ResultT &defaultResult)
: defaultResult(defaultResult) {
}
void Done() {
if (onCompletion) {
onCompletion(this);
} else {
// signal completion
uv_sem_post(&semaphore);
}
}
ResultT ExecuteAsync(ThreadPool::Callback asyncCallback, void (*onCompletion)(AsyncBaton *) = NULL) {
result = 0;
this->onCompletion = onCompletion;
if (!onCompletion) {
uv_sem_init(&semaphore, 0);
}
{
LockMaster::TemporaryUnlock temporaryUnlock;
libgit2ThreadPool.ExecuteReverseCallback(asyncCallback, this);
if (!onCompletion) {
// wait for completion
uv_sem_wait(&semaphore);
uv_sem_destroy(&semaphore);
}
}
return result;
}
};
struct AsyncBatonWithNoResult : public AsyncBaton {
void (*onCompletion)(AsyncBaton *);
void Done() {
if (onCompletion) {
onCompletion(this);
} else {
// signal completion
uv_sem_post(&semaphore);
}
}
void ExecuteAsync(ThreadPool::Callback asyncCallback, void (*onCompletion)(AsyncBaton *) = NULL) {
this->onCompletion = onCompletion;
if (!onCompletion) {
uv_sem_init(&semaphore, 0);
}
{
LockMaster::TemporaryUnlock temporaryUnlock;
libgit2ThreadPool.ExecuteReverseCallback(asyncCallback, this);
if (!onCompletion) {
// wait for completion
uv_sem_wait(&semaphore);
uv_sem_destroy(&semaphore);
}
}
return;
}
};
#endif
+33
View File
@@ -0,0 +1,33 @@
#ifndef ASYNC_LIBGIT2_QUEUE_WORKER_H
#define ASYNC_LIBGIT2_QUEUE_WORKER_H
#include <nan.h>
#include <uv.h>
#include "../include/thread_pool.h"
#include "../include/nodegit.h"
// Runs WorkComplete of the scheduled AsyncWorker,
// and destroys it. This is run in the uv_default_loop event loop.
NAN_INLINE void AsyncLibgit2Complete (void* data) {
Nan::AsyncWorker *worker = static_cast<Nan::AsyncWorker*>(data);
worker->WorkComplete();
worker->Destroy();
}
// Runs Execute of the scheduled AyncWorker on the dedicated libgit2 thread /
// event loop, and schedules the WorkComplete callback to run on the
// uv_default_loop event loop
NAN_INLINE void AsyncLibgit2Execute (void *vworker) {
// execute the worker
Nan::AsyncWorker *worker = static_cast<Nan::AsyncWorker*>(vworker);
worker->Execute();
}
// Schedules the AsyncWorker to run on the dedicated libgit2 thread / event loop,
// and on completion AsyncLibgit2Complete on the default loop
NAN_INLINE void AsyncLibgit2QueueWorker (Nan::AsyncWorker* worker) {
libgit2ThreadPool.QueueWork(AsyncLibgit2Execute, AsyncLibgit2Complete, worker);
}
#endif
+99
View File
@@ -0,0 +1,99 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITATTR_H
#define GITATTR_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
using namespace node;
using namespace v8;
class GitAttr : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
static NAN_METHOD(AddMacro);
static NAN_METHOD(CacheFlush);
struct GetBaton {
int error_code;
const git_error* error;
const char * value_out;
git_repository * repo;
uint32_t flags;
const char * path;
const char * name;
};
class GetWorker : public Nan::AsyncWorker {
public:
GetWorker(
GetBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GetWorker() {};
void Execute();
void HandleOKCallback();
private:
GetBaton *baton;
};
static NAN_METHOD(Get);
struct GetManyBaton {
int error_code;
const git_error* error;
const char * values_out;
git_repository * repo;
uint32_t flags;
const char * path;
size_t num_attr;
const char ** names;
};
class GetManyWorker : public Nan::AsyncWorker {
public:
GetManyWorker(
GetManyBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GetManyWorker() {};
void Execute();
void HandleOKCallback();
private:
GetManyBaton *baton;
};
static NAN_METHOD(GetMany);
static NAN_METHOD(Value);
};
#endif
+132
View File
@@ -0,0 +1,132 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITBLAME_H
#define GITBLAME_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
#include "../include/blame_options.h"
#include "../include/blame_hunk.h"
// Forward declaration.
struct git_blame {
};
using namespace node;
using namespace v8;
class GitBlame;
struct GitBlameTraits {
typedef GitBlame cppClass;
typedef git_blame cType;
static const bool isDuplicable = false;
static void duplicate(git_blame **dest, git_blame *src) {
Nan::ThrowError("duplicate called on GitBlame which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_blame *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_blame_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitBlame : public
NodeGitWrapper<GitBlameTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitBlameTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitBlame()
: NodeGitWrapper<GitBlameTraits>(
"A new GitBlame cannot be instantiated."
)
{}
GitBlame(git_blame *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitBlameTraits>(raw, selfFreeing, owner)
{}
~GitBlame();
struct BufferBaton {
int error_code;
const git_error* error;
git_blame * out;
git_blame * reference;
const char * buffer;
size_t buffer_len;
};
class BufferWorker : public Nan::AsyncWorker {
public:
BufferWorker(
BufferBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~BufferWorker() {};
void Execute();
void HandleOKCallback();
private:
BufferBaton *baton;
};
static NAN_METHOD(Buffer);
struct FileBaton {
int error_code;
const git_error* error;
git_blame * out;
git_repository * repo;
const char * path;
git_blame_options * options;
};
class FileWorker : public Nan::AsyncWorker {
public:
FileWorker(
FileBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FileWorker() {};
void Execute();
void HandleOKCallback();
private:
FileBaton *baton;
};
static NAN_METHOD(File);
static NAN_METHOD(GetHunkByindex);
static NAN_METHOD(GetHunkByline);
static NAN_METHOD(GetHunkCount);
};
#endif
+80
View File
@@ -0,0 +1,80 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITBLAMEHUNK_H
#define GITBLAMEHUNK_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/oid.h"
#include "../include/signature.h"
using namespace node;
using namespace v8;
class GitBlameHunk;
struct GitBlameHunkTraits {
typedef GitBlameHunk cppClass;
typedef git_blame_hunk cType;
static const bool isDuplicable = false;
static void duplicate(git_blame_hunk **dest, git_blame_hunk *src) {
Nan::ThrowError("duplicate called on GitBlameHunk which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_blame_hunk *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitBlameHunk : public
NodeGitWrapper<GitBlameHunkTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitBlameHunkTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitBlameHunk()
: NodeGitWrapper<GitBlameHunkTraits>(
"A new GitBlameHunk cannot be instantiated."
)
{}
GitBlameHunk(git_blame_hunk *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitBlameHunkTraits>(raw, selfFreeing, owner)
{}
~GitBlameHunk();
static NAN_METHOD(LinesInHunk);
static NAN_METHOD(FinalCommitId);
static NAN_METHOD(FinalStartLineNumber);
static NAN_METHOD(FinalSignature);
static NAN_METHOD(OrigCommitId);
static NAN_METHOD(OrigPath);
static NAN_METHOD(OrigStartLineNumber);
static NAN_METHOD(OrigSignature);
};
#endif
+91
View File
@@ -0,0 +1,91 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITBLAMEOPTIONS_H
#define GITBLAMEOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
#include "../include/oid.h"
using namespace node;
using namespace v8;
class GitBlameOptions;
struct GitBlameOptionsTraits {
typedef GitBlameOptions cppClass;
typedef git_blame_options cType;
static const bool isDuplicable = false;
static void duplicate(git_blame_options **dest, git_blame_options *src) {
Nan::ThrowError("duplicate called on GitBlameOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_blame_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitBlameOptions : public NodeGitWrapper<GitBlameOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitBlameOptionsTraits>;
public:
GitBlameOptions(git_blame_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitBlameOptions();
~GitBlameOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetFlags);
static NAN_SETTER(SetFlags);
static NAN_GETTER(GetMinMatchCharacters);
static NAN_SETTER(SetMinMatchCharacters);
Nan::Persistent<Object> newest_commit;
static NAN_GETTER(GetNewestCommit);
static NAN_SETTER(SetNewestCommit);
Nan::Persistent<Object> oldest_commit;
static NAN_GETTER(GetOldestCommit);
static NAN_SETTER(SetOldestCommit);
static NAN_GETTER(GetMinLine);
static NAN_SETTER(SetMinLine);
static NAN_GETTER(GetMaxLine);
static NAN_SETTER(SetMaxLine);
};
#endif
+286
View File
@@ -0,0 +1,286 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITBLOB_H
#define GITBLOB_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/wrapper.h"
#include "node_buffer.h"
#include "../include/oid.h"
#include "../include/repository.h"
#include "../include/buf.h"
#include "../include/blob_filter_options.h"
// Forward declaration.
struct git_blob {
};
using namespace node;
using namespace v8;
class GitBlob;
struct GitBlobTraits {
typedef GitBlob cppClass;
typedef git_blob cType;
static const bool isDuplicable = false;
static void duplicate(git_blob **dest, git_blob *src) {
Nan::ThrowError("duplicate called on GitBlob which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_blob *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_blob_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitBlob : public
NodeGitWrapper<GitBlobTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitBlobTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitBlob()
: NodeGitWrapper<GitBlobTraits>(
"A new GitBlob cannot be instantiated."
)
{}
GitBlob(git_blob *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitBlobTraits>(raw, selfFreeing, owner)
{}
~GitBlob();
struct CreateFromBufferBaton {
int error_code;
const git_error* error;
git_oid * id;
git_repository * repo;
const void * buffer;
size_t len;
};
class CreateFromBufferWorker : public Nan::AsyncWorker {
public:
CreateFromBufferWorker(
CreateFromBufferBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateFromBufferWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateFromBufferBaton *baton;
};
static NAN_METHOD(CreateFromBuffer);
struct CreateFromDiskBaton {
int error_code;
const git_error* error;
git_oid * id;
git_repository * repo;
const char * path;
};
class CreateFromDiskWorker : public Nan::AsyncWorker {
public:
CreateFromDiskWorker(
CreateFromDiskBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateFromDiskWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateFromDiskBaton *baton;
};
static NAN_METHOD(CreateFromDisk);
struct CreateFromWorkdirBaton {
int error_code;
const git_error* error;
git_oid * id;
git_repository * repo;
const char * relative_path;
};
class CreateFromWorkdirWorker : public Nan::AsyncWorker {
public:
CreateFromWorkdirWorker(
CreateFromWorkdirBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateFromWorkdirWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateFromWorkdirBaton *baton;
};
static NAN_METHOD(CreateFromWorkdir);
struct DupBaton {
int error_code;
const git_error* error;
git_blob * out;
git_blob * source;
};
class DupWorker : public Nan::AsyncWorker {
public:
DupWorker(
DupBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~DupWorker() {};
void Execute();
void HandleOKCallback();
private:
DupBaton *baton;
};
static NAN_METHOD(Dup);
struct FilterBaton {
int error_code;
const git_error* error;
git_buf * out;
git_blob * blob;
const char * as_path;
git_blob_filter_options * opts;
};
class FilterWorker : public Nan::AsyncWorker {
public:
FilterWorker(
FilterBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FilterWorker() {};
void Execute();
void HandleOKCallback();
private:
FilterBaton *baton;
};
static NAN_METHOD(Filter);
struct FilteredContentBaton {
int error_code;
const git_error* error;
git_buf * out;
git_blob * blob;
const char * as_path;
int check_for_binary_data;
};
class FilteredContentWorker : public Nan::AsyncWorker {
public:
FilteredContentWorker(
FilteredContentBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FilteredContentWorker() {};
void Execute();
void HandleOKCallback();
private:
FilteredContentBaton *baton;
};
static NAN_METHOD(FilteredContent);
static NAN_METHOD(Id);
static NAN_METHOD(IsBinary);
struct LookupBaton {
int error_code;
const git_error* error;
git_blob * blob;
git_repository * repo;
const git_oid * id;
bool idNeedsFree;
};
class LookupWorker : public Nan::AsyncWorker {
public:
LookupWorker(
LookupBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LookupWorker() {};
void Execute();
void HandleOKCallback();
private:
LookupBaton *baton;
};
static NAN_METHOD(Lookup);
struct LookupPrefixBaton {
int error_code;
const git_error* error;
git_blob * blob;
git_repository * repo;
const git_oid * id;
bool idNeedsFree;
size_t len;
};
class LookupPrefixWorker : public Nan::AsyncWorker {
public:
LookupPrefixWorker(
LookupPrefixBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LookupPrefixWorker() {};
void Execute();
void HandleOKCallback();
private:
LookupPrefixBaton *baton;
};
static NAN_METHOD(LookupPrefix);
static NAN_METHOD(Owner);
static NAN_METHOD(Rawcontent);
static NAN_METHOD(Rawsize);
};
#endif
+68
View File
@@ -0,0 +1,68 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITBLOBFILTEROPTIONS_H
#define GITBLOBFILTEROPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
using namespace node;
using namespace v8;
class GitBlobFilterOptions;
struct GitBlobFilterOptionsTraits {
typedef GitBlobFilterOptions cppClass;
typedef git_blob_filter_options cType;
static const bool isDuplicable = false;
static void duplicate(git_blob_filter_options **dest, git_blob_filter_options *src) {
Nan::ThrowError("duplicate called on GitBlobFilterOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_blob_filter_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitBlobFilterOptions : public NodeGitWrapper<GitBlobFilterOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitBlobFilterOptionsTraits>;
public:
GitBlobFilterOptions(git_blob_filter_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitBlobFilterOptions();
~GitBlobFilterOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetFlags);
static NAN_SETTER(SetFlags);
};
#endif
+272
View File
@@ -0,0 +1,272 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITBRANCH_H
#define GITBRANCH_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/buf.h"
#include "../include/reference.h"
#include "../include/repository.h"
#include "../include/commit.h"
#include "../include/annotated_commit.h"
#include "../include/buf.h"
using namespace node;
using namespace v8;
class GitBranch : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
struct CreateBaton {
int error_code;
const git_error* error;
git_reference * out;
git_repository * repo;
const char * branch_name;
const git_commit * target;
int force;
};
class CreateWorker : public Nan::AsyncWorker {
public:
CreateWorker(
CreateBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateBaton *baton;
};
static NAN_METHOD(Create);
struct CreateFromAnnotatedBaton {
int error_code;
const git_error* error;
git_reference * ref_out;
git_repository * repository;
const char * branch_name;
const git_annotated_commit * commit;
int force;
};
class CreateFromAnnotatedWorker : public Nan::AsyncWorker {
public:
CreateFromAnnotatedWorker(
CreateFromAnnotatedBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateFromAnnotatedWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateFromAnnotatedBaton *baton;
};
static NAN_METHOD(CreateFromAnnotated);
static NAN_METHOD(Delete);
static NAN_METHOD(IsCheckedOut);
static NAN_METHOD(IsHead);
struct LookupBaton {
int error_code;
const git_error* error;
git_reference * out;
git_repository * repo;
const char * branch_name;
git_branch_t branch_type;
};
class LookupWorker : public Nan::AsyncWorker {
public:
LookupWorker(
LookupBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LookupWorker() {};
void Execute();
void HandleOKCallback();
private:
LookupBaton *baton;
};
static NAN_METHOD(Lookup);
struct MoveBaton {
int error_code;
const git_error* error;
git_reference * out;
git_reference * branch;
const char * new_branch_name;
int force;
};
class MoveWorker : public Nan::AsyncWorker {
public:
MoveWorker(
MoveBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~MoveWorker() {};
void Execute();
void HandleOKCallback();
private:
MoveBaton *baton;
};
static NAN_METHOD(Move);
struct NameBaton {
int error_code;
const git_error* error;
const char * out;
const git_reference * ref;
};
class NameWorker : public Nan::AsyncWorker {
public:
NameWorker(
NameBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~NameWorker() {};
void Execute();
void HandleOKCallback();
private:
NameBaton *baton;
};
static NAN_METHOD(Name);
struct RemoteNameBaton {
int error_code;
const git_error* error;
git_buf * out;
git_repository * repo;
const char * refname;
};
class RemoteNameWorker : public Nan::AsyncWorker {
public:
RemoteNameWorker(
RemoteNameBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~RemoteNameWorker() {};
void Execute();
void HandleOKCallback();
private:
RemoteNameBaton *baton;
};
static NAN_METHOD(RemoteName);
struct SetUpstreamBaton {
int error_code;
const git_error* error;
git_reference * branch;
const char * branch_name;
};
class SetUpstreamWorker : public Nan::AsyncWorker {
public:
SetUpstreamWorker(
SetUpstreamBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~SetUpstreamWorker() {};
void Execute();
void HandleOKCallback();
private:
SetUpstreamBaton *baton;
};
static NAN_METHOD(SetUpstream);
struct UpstreamBaton {
int error_code;
const git_error* error;
git_reference * out;
const git_reference * branch;
};
class UpstreamWorker : public Nan::AsyncWorker {
public:
UpstreamWorker(
UpstreamBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~UpstreamWorker() {};
void Execute();
void HandleOKCallback();
private:
UpstreamBaton *baton;
};
static NAN_METHOD(Upstream);
struct UpstreamNameBaton {
int error_code;
const git_error* error;
git_buf * out;
git_repository * repo;
const char * refname;
};
class UpstreamNameWorker : public Nan::AsyncWorker {
public:
UpstreamNameWorker(
UpstreamNameBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~UpstreamNameWorker() {};
void Execute();
void HandleOKCallback();
private:
UpstreamNameBaton *baton;
};
static NAN_METHOD(UpstreamName);
static NAN_METHOD(UpstreamRemote);
};
#endif
+73
View File
@@ -0,0 +1,73 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITBRANCHITERATOR_H
#define GITBRANCHITERATOR_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
// Forward declaration.
struct git_branch_iterator {
};
using namespace node;
using namespace v8;
class GitBranchIterator;
struct GitBranchIteratorTraits {
typedef GitBranchIterator cppClass;
typedef git_branch_iterator cType;
static const bool isDuplicable = false;
static void duplicate(git_branch_iterator **dest, git_branch_iterator *src) {
Nan::ThrowError("duplicate called on GitBranchIterator which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_branch_iterator *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitBranchIterator : public
NodeGitWrapper<GitBranchIteratorTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitBranchIteratorTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitBranchIterator()
: NodeGitWrapper<GitBranchIteratorTraits>(
"A new GitBranchIterator cannot be instantiated."
)
{}
GitBranchIterator(git_branch_iterator *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitBranchIteratorTraits>(raw, selfFreeing, owner)
{}
~GitBranchIterator();
};
#endif
+84
View File
@@ -0,0 +1,84 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITBUF_H
#define GITBUF_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/git_buf_converter.h"
using namespace node;
using namespace v8;
class GitBuf;
struct GitBufTraits {
typedef GitBuf cppClass;
typedef git_buf cType;
static const bool isDuplicable = false;
static void duplicate(git_buf **dest, git_buf *src) {
Nan::ThrowError("duplicate called on GitBuf which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_buf *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_buf_dispose(raw); // :: to avoid calling this free recursively
}
}
};
class GitBuf : public
NodeGitWrapper<GitBufTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitBufTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitBuf()
: NodeGitWrapper<GitBufTraits>(
"A new GitBuf cannot be instantiated."
)
{}
GitBuf(git_buf *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitBufTraits>(raw, selfFreeing, owner)
{}
~GitBuf();
static NAN_METHOD(Ptr);
static NAN_METHOD(Asize);
static NAN_METHOD(Size);
static NAN_METHOD(ContainsNul);
static NAN_METHOD(Dispose);
static NAN_METHOD(Grow);
static NAN_METHOD(IsBinary);
static NAN_METHOD(Set);
};
#endif
+70
View File
@@ -0,0 +1,70 @@
#ifndef CALLBACK_WRAPPER_H
#define CALLBACK_WRAPPER_H
#include <nan.h>
#include <uv.h>
using namespace v8;
using namespace node;
class CallbackWrapper {
Nan::Callback* jsCallback;
// throttling data, used for callbacks that need to be throttled
int throttle; // in milliseconds - if > 0, calls to the JS callback will be throttled
uint64_t lastCallTime;
// false will trigger the callback and not wait for the callback to finish
// in this case, the underlying libgit2 function will immediately be given
// the default result
bool waitForResult;
public:
CallbackWrapper() {
jsCallback = NULL;
lastCallTime = 0;
throttle = 0;
}
~CallbackWrapper() {
SetCallback(NULL);
}
bool HasCallback() {
return jsCallback != NULL;
}
Nan::Callback* GetCallback() {
return jsCallback;
}
void SetCallback(Nan::Callback* callback, int throttle = 0, bool waitForResult = true) {
if(jsCallback) {
delete jsCallback;
}
jsCallback = callback;
this->throttle = throttle;
this->waitForResult = waitForResult;
}
bool ShouldWaitForResult() {
return waitForResult;
}
bool WillBeThrottled() {
if(!throttle) {
return false;
}
// throttle if needed
uint64_t now = uv_hrtime();
if(lastCallTime > 0 && now < lastCallTime + throttle * (uint64_t)1000000) {
// throttled
return true;
} else {
lastCallTime = now;
return false;
}
}
};
#endif
+71
View File
@@ -0,0 +1,71 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCERT_H
#define GITCERT_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitCert;
struct GitCertTraits {
typedef GitCert cppClass;
typedef git_cert cType;
static const bool isDuplicable = false;
static void duplicate(git_cert **dest, git_cert *src) {
Nan::ThrowError("duplicate called on GitCert which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_cert *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitCert : public
NodeGitWrapper<GitCertTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitCertTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitCert()
: NodeGitWrapper<GitCertTraits>(
"A new GitCert cannot be instantiated."
)
{}
GitCert(git_cert *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitCertTraits>(raw, selfFreeing, owner)
{}
~GitCert();
static NAN_METHOD(CertType);
};
#endif
+76
View File
@@ -0,0 +1,76 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCERTHOSTKEY_H
#define GITCERTHOSTKEY_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/cert.h"
using namespace node;
using namespace v8;
class GitCertHostkey;
struct GitCertHostkeyTraits {
typedef GitCertHostkey cppClass;
typedef git_cert_hostkey cType;
static const bool isDuplicable = false;
static void duplicate(git_cert_hostkey **dest, git_cert_hostkey *src) {
Nan::ThrowError("duplicate called on GitCertHostkey which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_cert_hostkey *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitCertHostkey : public
NodeGitWrapper<GitCertHostkeyTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitCertHostkeyTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitCertHostkey()
: NodeGitWrapper<GitCertHostkeyTraits>(
"A new GitCertHostkey cannot be instantiated."
)
{}
GitCertHostkey(git_cert_hostkey *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitCertHostkeyTraits>(raw, selfFreeing, owner)
{}
~GitCertHostkey();
static NAN_METHOD(Parent);
static NAN_METHOD(Type);
static NAN_METHOD(HashMd5);
static NAN_METHOD(HashSha1);
static NAN_METHOD(HashSha256);
};
#endif
+76
View File
@@ -0,0 +1,76 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCERTX509_H
#define GITCERTX509_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/wrapper.h"
#include "node_buffer.h"
#include "../include/cert.h"
using namespace node;
using namespace v8;
class GitCertX509;
struct GitCertX509Traits {
typedef GitCertX509 cppClass;
typedef git_cert_x509 cType;
static const bool isDuplicable = false;
static void duplicate(git_cert_x509 **dest, git_cert_x509 *src) {
Nan::ThrowError("duplicate called on GitCertX509 which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_cert_x509 *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitCertX509 : public
NodeGitWrapper<GitCertX509Traits>
{
// grant full access to base class
friend class NodeGitWrapper<GitCertX509Traits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitCertX509()
: NodeGitWrapper<GitCertX509Traits>(
"A new GitCertX509 cannot be instantiated."
)
{}
GitCertX509(git_cert_x509 *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitCertX509Traits>(raw, selfFreeing, owner)
{}
~GitCertX509();
static NAN_METHOD(Parent);
static NAN_METHOD(Data);
static NAN_METHOD(Len);
};
#endif
+114
View File
@@ -0,0 +1,114 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCHECKOUT_H
#define GITCHECKOUT_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
#include "../include/checkout_options.h"
#include "../include/index.h"
#include "../include/object.h"
using namespace node;
using namespace v8;
class GitCheckout : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
struct HeadBaton {
int error_code;
const git_error* error;
git_repository * repo;
const git_checkout_options * opts;
};
class HeadWorker : public Nan::AsyncWorker {
public:
HeadWorker(
HeadBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~HeadWorker() {};
void Execute();
void HandleOKCallback();
private:
HeadBaton *baton;
};
static NAN_METHOD(Head);
struct IndexBaton {
int error_code;
const git_error* error;
git_repository * repo;
git_index * index;
const git_checkout_options * opts;
};
class IndexWorker : public Nan::AsyncWorker {
public:
IndexWorker(
IndexBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~IndexWorker() {};
void Execute();
void HandleOKCallback();
private:
IndexBaton *baton;
};
static NAN_METHOD(Index);
struct TreeBaton {
int error_code;
const git_error* error;
git_repository * repo;
const git_object * treeish;
const git_checkout_options * opts;
};
class TreeWorker : public Nan::AsyncWorker {
public:
TreeWorker(
TreeBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~TreeWorker() {};
void Execute();
void HandleOKCallback();
private:
TreeBaton *baton;
};
static NAN_METHOD(Tree);
};
#endif
+226
View File
@@ -0,0 +1,226 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITCHECKOUTOPTIONS_H
#define GITCHECKOUTOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
#include "../include/diff_file.h"
#include "../include/strarray.h"
#include "../include/tree.h"
#include "../include/index.h"
#include "../include/checkout_perfdata.h"
using namespace node;
using namespace v8;
class GitCheckoutOptions;
struct GitCheckoutOptionsTraits {
typedef GitCheckoutOptions cppClass;
typedef git_checkout_options cType;
static const bool isDuplicable = false;
static void duplicate(git_checkout_options **dest, git_checkout_options *src) {
Nan::ThrowError("duplicate called on GitCheckoutOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_checkout_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitCheckoutOptions : public NodeGitWrapper<GitCheckoutOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitCheckoutOptionsTraits>;
public:
GitCheckoutOptions(git_checkout_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
static int notify_cb_cppCallback (
git_checkout_notify_t why
,
const char * path
,
const git_diff_file * baseline
,
const git_diff_file * target
,
const git_diff_file * workdir
,
void * payload
);
static void notify_cb_async(void *baton);
static void notify_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct NotifyCbBaton : public AsyncBatonWithResult<int> {
git_checkout_notify_t why;
const char * path;
const git_diff_file * baseline;
const git_diff_file * target;
const git_diff_file * workdir;
void * payload;
NotifyCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitCheckoutOptions * notify_cb_getInstanceFromBaton (
NotifyCbBaton *baton);
static int progress_cb_cppCallback (
const char * path
,
size_t completed_steps
,
size_t total_steps
,
void * payload
);
static void progress_cb_async(void *baton);
static void progress_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct ProgressCbBaton : public AsyncBatonWithResult<int> {
const char * path;
size_t completed_steps;
size_t total_steps;
void * payload;
ProgressCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitCheckoutOptions * progress_cb_getInstanceFromBaton (
ProgressCbBaton *baton);
static int perfdata_cb_cppCallback (
const git_checkout_perfdata * perfdata
,
void * payload
);
static void perfdata_cb_async(void *baton);
static void perfdata_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct PerfdataCbBaton : public AsyncBatonWithResult<int> {
const git_checkout_perfdata * perfdata;
void * payload;
PerfdataCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitCheckoutOptions * perfdata_cb_getInstanceFromBaton (
PerfdataCbBaton *baton);
private:
GitCheckoutOptions();
~GitCheckoutOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetCheckoutStrategy);
static NAN_SETTER(SetCheckoutStrategy);
static NAN_GETTER(GetDisableFilters);
static NAN_SETTER(SetDisableFilters);
static NAN_GETTER(GetDirMode);
static NAN_SETTER(SetDirMode);
static NAN_GETTER(GetFileMode);
static NAN_SETTER(SetFileMode);
static NAN_GETTER(GetFileOpenFlags);
static NAN_SETTER(SetFileOpenFlags);
static NAN_GETTER(GetNotifyFlags);
static NAN_SETTER(SetNotifyFlags);
CallbackWrapper notify_cb;
static NAN_GETTER(GetNotifyCb);
static NAN_SETTER(SetNotifyCb);
Nan::Persistent<Value> notify_payload;
static NAN_GETTER(GetNotifyPayload);
static NAN_SETTER(SetNotifyPayload);
CallbackWrapper progress_cb;
static NAN_GETTER(GetProgressCb);
static NAN_SETTER(SetProgressCb);
Nan::Persistent<Value> progress_payload;
static NAN_GETTER(GetProgressPayload);
static NAN_SETTER(SetProgressPayload);
Nan::Persistent<Object> paths;
static NAN_GETTER(GetPaths);
static NAN_SETTER(SetPaths);
Nan::Persistent<Object> baseline;
static NAN_GETTER(GetBaseline);
static NAN_SETTER(SetBaseline);
Nan::Persistent<Object> baseline_index;
static NAN_GETTER(GetBaselineIndex);
static NAN_SETTER(SetBaselineIndex);
static NAN_GETTER(GetTargetDirectory);
static NAN_SETTER(SetTargetDirectory);
static NAN_GETTER(GetAncestorLabel);
static NAN_SETTER(SetAncestorLabel);
static NAN_GETTER(GetOurLabel);
static NAN_SETTER(SetOurLabel);
static NAN_GETTER(GetTheirLabel);
static NAN_SETTER(SetTheirLabel);
CallbackWrapper perfdata_cb;
static NAN_GETTER(GetPerfdataCb);
static NAN_SETTER(SetPerfdataCb);
Nan::Persistent<Value> perfdata_payload;
static NAN_GETTER(GetPerfdataPayload);
static NAN_SETTER(SetPerfdataPayload);
};
#endif
+73
View File
@@ -0,0 +1,73 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCHECKOUTPERFDATA_H
#define GITCHECKOUTPERFDATA_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitCheckoutPerfdata;
struct GitCheckoutPerfdataTraits {
typedef GitCheckoutPerfdata cppClass;
typedef git_checkout_perfdata cType;
static const bool isDuplicable = false;
static void duplicate(git_checkout_perfdata **dest, git_checkout_perfdata *src) {
Nan::ThrowError("duplicate called on GitCheckoutPerfdata which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_checkout_perfdata *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitCheckoutPerfdata : public
NodeGitWrapper<GitCheckoutPerfdataTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitCheckoutPerfdataTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitCheckoutPerfdata()
: NodeGitWrapper<GitCheckoutPerfdataTraits>(
"A new GitCheckoutPerfdata cannot be instantiated."
)
{}
GitCheckoutPerfdata(git_checkout_perfdata *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitCheckoutPerfdataTraits>(raw, selfFreeing, owner)
{}
~GitCheckoutPerfdata();
static NAN_METHOD(MkdirCalls);
static NAN_METHOD(StatCalls);
static NAN_METHOD(ChmodCalls);
};
#endif
+95
View File
@@ -0,0 +1,95 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCHERRYPICK_H
#define GITCHERRYPICK_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
#include "../include/commit.h"
#include "../include/cherrypick_options.h"
#include "../include/index.h"
#include "../include/merge_options.h"
using namespace node;
using namespace v8;
class GitCherrypick : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
struct CherrypickBaton {
int error_code;
const git_error* error;
git_repository * repo;
git_commit * commit;
const git_cherrypick_options * cherrypick_options;
};
class CherrypickWorker : public Nan::AsyncWorker {
public:
CherrypickWorker(
CherrypickBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CherrypickWorker() {};
void Execute();
void HandleOKCallback();
private:
CherrypickBaton *baton;
};
static NAN_METHOD(Cherrypick);
struct CommitBaton {
int error_code;
const git_error* error;
git_index * out;
git_repository * repo;
git_commit * cherrypick_commit;
git_commit * our_commit;
unsigned int mainline;
const git_merge_options * merge_options;
};
class CommitWorker : public Nan::AsyncWorker {
public:
CommitWorker(
CommitBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CommitWorker() {};
void Execute();
void HandleOKCallback();
private:
CommitBaton *baton;
};
static NAN_METHOD(Commit);
};
#endif
+80
View File
@@ -0,0 +1,80 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITCHERRYPICKOPTIONS_H
#define GITCHERRYPICKOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
#include "../include/merge_options.h"
#include "../include/checkout_options.h"
using namespace node;
using namespace v8;
class GitCherrypickOptions;
struct GitCherrypickOptionsTraits {
typedef GitCherrypickOptions cppClass;
typedef git_cherrypick_options cType;
static const bool isDuplicable = false;
static void duplicate(git_cherrypick_options **dest, git_cherrypick_options *src) {
Nan::ThrowError("duplicate called on GitCherrypickOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_cherrypick_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitCherrypickOptions : public NodeGitWrapper<GitCherrypickOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitCherrypickOptionsTraits>;
public:
GitCherrypickOptions(git_cherrypick_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitCherrypickOptions();
~GitCherrypickOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetMainline);
static NAN_SETTER(SetMainline);
Nan::Persistent<Object> merge_opts;
static NAN_GETTER(GetMergeOpts);
static NAN_SETTER(SetMergeOpts);
Nan::Persistent<Object> checkout_opts;
static NAN_GETTER(GetCheckoutOpts);
static NAN_SETTER(SetCheckoutOpts);
};
#endif
+66
View File
@@ -0,0 +1,66 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCLONE_H
#define GITCLONE_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
#include "../include/clone_options.h"
using namespace node;
using namespace v8;
class GitClone : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
struct CloneBaton {
int error_code;
const git_error* error;
git_repository * out;
const char * url;
const char * local_path;
const git_clone_options * options;
};
class CloneWorker : public Nan::AsyncWorker {
public:
CloneWorker(
CloneBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CloneWorker() {};
void Execute();
void HandleOKCallback();
private:
CloneBaton *baton;
};
static NAN_METHOD(Clone);
};
#endif
+98
View File
@@ -0,0 +1,98 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITCLONEOPTIONS_H
#define GITCLONEOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
#include "../include/checkout_options.h"
#include "../include/fetch_options.h"
using namespace node;
using namespace v8;
class GitCloneOptions;
struct GitCloneOptionsTraits {
typedef GitCloneOptions cppClass;
typedef git_clone_options cType;
static const bool isDuplicable = false;
static void duplicate(git_clone_options **dest, git_clone_options *src) {
Nan::ThrowError("duplicate called on GitCloneOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_clone_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitCloneOptions : public NodeGitWrapper<GitCloneOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitCloneOptionsTraits>;
public:
GitCloneOptions(git_clone_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitCloneOptions();
~GitCloneOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
Nan::Persistent<Object> checkout_opts;
static NAN_GETTER(GetCheckoutOpts);
static NAN_SETTER(SetCheckoutOpts);
Nan::Persistent<Object> fetch_opts;
static NAN_GETTER(GetFetchOpts);
static NAN_SETTER(SetFetchOpts);
static NAN_GETTER(GetBare);
static NAN_SETTER(SetBare);
static NAN_GETTER(GetLocal);
static NAN_SETTER(SetLocal);
static NAN_GETTER(GetCheckoutBranch);
static NAN_SETTER(SetCheckoutBranch);
Nan::Persistent<Value> repository_cb_payload;
static NAN_GETTER(GetRepositoryCbPayload);
static NAN_SETTER(SetRepositoryCbPayload);
Nan::Persistent<Value> remote_cb_payload;
static NAN_GETTER(GetRemoteCbPayload);
static NAN_SETTER(SetRemoteCbPayload);
};
#endif
+450
View File
@@ -0,0 +1,450 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCOMMIT_H
#define GITCOMMIT_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/oid.h"
#include "../include/signature.h"
#include "../include/tree.h"
#include "../include/mailmap.h"
#include "../include/repository.h"
#include "../include/buf.h"
// Forward declaration.
struct git_commit {
};
using namespace node;
using namespace v8;
class GitCommit;
struct GitCommitTraits {
typedef GitCommit cppClass;
typedef git_commit cType;
static const bool isDuplicable = false;
static void duplicate(git_commit **dest, git_commit *src) {
Nan::ThrowError("duplicate called on GitCommit which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_commit *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_commit_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitCommit : public
NodeGitWrapper<GitCommitTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitCommitTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitCommit()
: NodeGitWrapper<GitCommitTraits>(
"A new GitCommit cannot be instantiated."
)
{}
GitCommit(git_commit *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitCommitTraits>(raw, selfFreeing, owner)
{}
~GitCommit();
struct AmendBaton {
int error_code;
const git_error* error;
git_oid * id;
const git_commit * commit_to_amend;
const char * update_ref;
const git_signature * author;
const git_signature * committer;
const char * message_encoding;
const char * message;
const git_tree * tree;
};
class AmendWorker : public Nan::AsyncWorker {
public:
AmendWorker(
AmendBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AmendWorker() {};
void Execute();
void HandleOKCallback();
private:
AmendBaton *baton;
};
static NAN_METHOD(Amend);
static NAN_METHOD(Author);
struct AuthorWithMailmapBaton {
int error_code;
const git_error* error;
git_signature * out;
const git_commit * commit;
const git_mailmap * mailmap;
};
class AuthorWithMailmapWorker : public Nan::AsyncWorker {
public:
AuthorWithMailmapWorker(
AuthorWithMailmapBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AuthorWithMailmapWorker() {};
void Execute();
void HandleOKCallback();
private:
AuthorWithMailmapBaton *baton;
};
static NAN_METHOD(AuthorWithMailmap);
static NAN_METHOD(Body);
static NAN_METHOD(Committer);
struct CommitterWithMailmapBaton {
int error_code;
const git_error* error;
git_signature * out;
const git_commit * commit;
const git_mailmap * mailmap;
};
class CommitterWithMailmapWorker : public Nan::AsyncWorker {
public:
CommitterWithMailmapWorker(
CommitterWithMailmapBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CommitterWithMailmapWorker() {};
void Execute();
void HandleOKCallback();
private:
CommitterWithMailmapBaton *baton;
};
static NAN_METHOD(CommitterWithMailmap);
struct CreateBaton {
int error_code;
const git_error* error;
git_oid * id;
git_repository * repo;
const char * update_ref;
const git_signature * author;
const git_signature * committer;
const char * message_encoding;
const char * message;
const git_tree * tree;
size_t parent_count;
const git_commit ** parents;
};
class CreateWorker : public Nan::AsyncWorker {
public:
CreateWorker(
CreateBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateBaton *baton;
};
static NAN_METHOD(Create);
struct CreateBufferBaton {
int error_code;
const git_error* error;
git_buf * out;
git_repository * repo;
const git_signature * author;
const git_signature * committer;
const char * message_encoding;
const char * message;
const git_tree * tree;
size_t parent_count;
const git_commit ** parents;
};
class CreateBufferWorker : public Nan::AsyncWorker {
public:
CreateBufferWorker(
CreateBufferBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateBufferWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateBufferBaton *baton;
};
static NAN_METHOD(CreateBuffer);
static NAN_METHOD(CreateV);
struct CreateWithSignatureBaton {
int error_code;
const git_error* error;
git_oid * out;
git_repository * repo;
const char * commit_content;
const char * signature;
const char * signature_field;
};
class CreateWithSignatureWorker : public Nan::AsyncWorker {
public:
CreateWithSignatureWorker(
CreateWithSignatureBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateWithSignatureWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateWithSignatureBaton *baton;
};
static NAN_METHOD(CreateWithSignature);
struct DupBaton {
int error_code;
const git_error* error;
git_commit * out;
git_commit * source;
};
class DupWorker : public Nan::AsyncWorker {
public:
DupWorker(
DupBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~DupWorker() {};
void Execute();
void HandleOKCallback();
private:
DupBaton *baton;
};
static NAN_METHOD(Dup);
struct ExtractSignatureBaton {
int error_code;
const git_error* error;
git_buf signature;
git_buf signed_data;
git_repository * repo;
git_oid * commit_id;
bool commit_idNeedsFree;
char * field;
};
class ExtractSignatureWorker : public Nan::AsyncWorker {
public:
ExtractSignatureWorker(
ExtractSignatureBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ExtractSignatureWorker() {};
void Execute();
void HandleOKCallback();
private:
ExtractSignatureBaton *baton;
};
static NAN_METHOD(ExtractSignature);
struct HeaderFieldBaton {
int error_code;
const git_error* error;
git_buf * out;
const git_commit * commit;
const char * field;
};
class HeaderFieldWorker : public Nan::AsyncWorker {
public:
HeaderFieldWorker(
HeaderFieldBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~HeaderFieldWorker() {};
void Execute();
void HandleOKCallback();
private:
HeaderFieldBaton *baton;
};
static NAN_METHOD(HeaderField);
static NAN_METHOD(Id);
struct LookupBaton {
int error_code;
const git_error* error;
git_commit * commit;
git_repository * repo;
const git_oid * id;
bool idNeedsFree;
};
class LookupWorker : public Nan::AsyncWorker {
public:
LookupWorker(
LookupBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LookupWorker() {};
void Execute();
void HandleOKCallback();
private:
LookupBaton *baton;
};
static NAN_METHOD(Lookup);
struct LookupPrefixBaton {
int error_code;
const git_error* error;
git_commit * commit;
git_repository * repo;
const git_oid * id;
bool idNeedsFree;
size_t len;
};
class LookupPrefixWorker : public Nan::AsyncWorker {
public:
LookupPrefixWorker(
LookupPrefixBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LookupPrefixWorker() {};
void Execute();
void HandleOKCallback();
private:
LookupPrefixBaton *baton;
};
static NAN_METHOD(LookupPrefix);
static NAN_METHOD(Message);
static NAN_METHOD(MessageEncoding);
static NAN_METHOD(MessageRaw);
struct NthGenAncestorBaton {
int error_code;
const git_error* error;
git_commit * ancestor;
const git_commit * commit;
unsigned int n;
};
class NthGenAncestorWorker : public Nan::AsyncWorker {
public:
NthGenAncestorWorker(
NthGenAncestorBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~NthGenAncestorWorker() {};
void Execute();
void HandleOKCallback();
private:
NthGenAncestorBaton *baton;
};
static NAN_METHOD(NthGenAncestor);
static NAN_METHOD(Owner);
struct ParentBaton {
int error_code;
const git_error* error;
git_commit * out;
const git_commit * commit;
unsigned int n;
};
class ParentWorker : public Nan::AsyncWorker {
public:
ParentWorker(
ParentBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ParentWorker() {};
void Execute();
void HandleOKCallback();
private:
ParentBaton *baton;
};
static NAN_METHOD(Parent);
static NAN_METHOD(ParentId);
static NAN_METHOD(Parentcount);
static NAN_METHOD(RawHeader);
static NAN_METHOD(Summary);
static NAN_METHOD(Time);
static NAN_METHOD(TimeOffset);
static NAN_METHOD(Tree);
static NAN_METHOD(TreeId);
};
#endif
+525
View File
@@ -0,0 +1,525 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCONFIG_H
#define GITCONFIG_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/git_buf_converter.h"
#include "../include/buf.h"
#include "../include/config_entry.h"
#include "../include/transaction.h"
// Forward declaration.
struct git_config {
};
using namespace node;
using namespace v8;
class GitConfig;
struct GitConfigTraits {
typedef GitConfig cppClass;
typedef git_config cType;
static const bool isDuplicable = false;
static void duplicate(git_config **dest, git_config *src) {
Nan::ThrowError("duplicate called on GitConfig which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_config *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_config_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitConfig : public
NodeGitWrapper<GitConfigTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitConfigTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitConfig()
: NodeGitWrapper<GitConfigTraits>(
"A new GitConfig cannot be instantiated."
)
{}
GitConfig(git_config *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitConfigTraits>(raw, selfFreeing, owner)
{}
~GitConfig();
static NAN_METHOD(DeleteEntry);
static NAN_METHOD(DeleteMultivar);
struct FindGlobalBaton {
int error_code;
const git_error* error;
git_buf * out;
};
class FindGlobalWorker : public Nan::AsyncWorker {
public:
FindGlobalWorker(
FindGlobalBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FindGlobalWorker() {};
void Execute();
void HandleOKCallback();
private:
FindGlobalBaton *baton;
};
static NAN_METHOD(FindGlobal);
struct FindProgramdataBaton {
int error_code;
const git_error* error;
git_buf * out;
};
class FindProgramdataWorker : public Nan::AsyncWorker {
public:
FindProgramdataWorker(
FindProgramdataBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FindProgramdataWorker() {};
void Execute();
void HandleOKCallback();
private:
FindProgramdataBaton *baton;
};
static NAN_METHOD(FindProgramdata);
struct FindSystemBaton {
int error_code;
const git_error* error;
git_buf * out;
};
class FindSystemWorker : public Nan::AsyncWorker {
public:
FindSystemWorker(
FindSystemBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FindSystemWorker() {};
void Execute();
void HandleOKCallback();
private:
FindSystemBaton *baton;
};
static NAN_METHOD(FindSystem);
struct FindXdgBaton {
int error_code;
const git_error* error;
git_buf * out;
};
class FindXdgWorker : public Nan::AsyncWorker {
public:
FindXdgWorker(
FindXdgBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FindXdgWorker() {};
void Execute();
void HandleOKCallback();
private:
FindXdgBaton *baton;
};
static NAN_METHOD(FindXdg);
struct GetBoolBaton {
int error_code;
const git_error* error;
int * out;
const git_config * cfg;
const char * name;
};
class GetBoolWorker : public Nan::AsyncWorker {
public:
GetBoolWorker(
GetBoolBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GetBoolWorker() {};
void Execute();
void HandleOKCallback();
private:
GetBoolBaton *baton;
};
static NAN_METHOD(GetBool);
struct GetEntryBaton {
int error_code;
const git_error* error;
git_config_entry * out;
const git_config * cfg;
const char * name;
};
class GetEntryWorker : public Nan::AsyncWorker {
public:
GetEntryWorker(
GetEntryBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GetEntryWorker() {};
void Execute();
void HandleOKCallback();
private:
GetEntryBaton *baton;
};
static NAN_METHOD(GetEntry);
struct GetInt32Baton {
int error_code;
const git_error* error;
int32_t * out;
const git_config * cfg;
const char * name;
};
class GetInt32Worker : public Nan::AsyncWorker {
public:
GetInt32Worker(
GetInt32Baton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GetInt32Worker() {};
void Execute();
void HandleOKCallback();
private:
GetInt32Baton *baton;
};
static NAN_METHOD(GetInt32);
struct GetInt64Baton {
int error_code;
const git_error* error;
int64_t * out;
const git_config * cfg;
const char * name;
};
class GetInt64Worker : public Nan::AsyncWorker {
public:
GetInt64Worker(
GetInt64Baton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GetInt64Worker() {};
void Execute();
void HandleOKCallback();
private:
GetInt64Baton *baton;
};
static NAN_METHOD(GetInt64);
struct GetPathBaton {
int error_code;
const git_error* error;
git_buf * out;
const git_config * cfg;
const char * name;
};
class GetPathWorker : public Nan::AsyncWorker {
public:
GetPathWorker(
GetPathBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GetPathWorker() {};
void Execute();
void HandleOKCallback();
private:
GetPathBaton *baton;
};
static NAN_METHOD(GetPath);
struct GetStringBufBaton {
int error_code;
const git_error* error;
git_buf * out;
const git_config * cfg;
const char * name;
};
class GetStringBufWorker : public Nan::AsyncWorker {
public:
GetStringBufWorker(
GetStringBufBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GetStringBufWorker() {};
void Execute();
void HandleOKCallback();
private:
GetStringBufBaton *baton;
};
static NAN_METHOD(GetStringBuf);
struct LockBaton {
int error_code;
const git_error* error;
git_transaction * tx;
git_config * cfg;
};
class LockWorker : public Nan::AsyncWorker {
public:
LockWorker(
LockBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LockWorker() {};
void Execute();
void HandleOKCallback();
private:
LockBaton *baton;
};
static NAN_METHOD(Lock);
struct OpenDefaultBaton {
int error_code;
const git_error* error;
git_config * out;
};
class OpenDefaultWorker : public Nan::AsyncWorker {
public:
OpenDefaultWorker(
OpenDefaultBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~OpenDefaultWorker() {};
void Execute();
void HandleOKCallback();
private:
OpenDefaultBaton *baton;
};
static NAN_METHOD(OpenDefault);
struct OpenOndiskBaton {
int error_code;
const git_error* error;
git_config * out;
const char * path;
};
class OpenOndiskWorker : public Nan::AsyncWorker {
public:
OpenOndiskWorker(
OpenOndiskBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~OpenOndiskWorker() {};
void Execute();
void HandleOKCallback();
private:
OpenOndiskBaton *baton;
};
static NAN_METHOD(OpenOndisk);
struct SetBoolBaton {
int error_code;
const git_error* error;
git_config * cfg;
const char * name;
int value;
};
class SetBoolWorker : public Nan::AsyncWorker {
public:
SetBoolWorker(
SetBoolBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~SetBoolWorker() {};
void Execute();
void HandleOKCallback();
private:
SetBoolBaton *baton;
};
static NAN_METHOD(SetBool);
struct SetInt32Baton {
int error_code;
const git_error* error;
git_config * cfg;
const char * name;
int32_t value;
};
class SetInt32Worker : public Nan::AsyncWorker {
public:
SetInt32Worker(
SetInt32Baton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~SetInt32Worker() {};
void Execute();
void HandleOKCallback();
private:
SetInt32Baton *baton;
};
static NAN_METHOD(SetInt32);
struct SetInt64Baton {
int error_code;
const git_error* error;
git_config * cfg;
const char * name;
int64_t value;
};
class SetInt64Worker : public Nan::AsyncWorker {
public:
SetInt64Worker(
SetInt64Baton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~SetInt64Worker() {};
void Execute();
void HandleOKCallback();
private:
SetInt64Baton *baton;
};
static NAN_METHOD(SetInt64);
struct SetMultivarBaton {
int error_code;
const git_error* error;
git_config * cfg;
const char * name;
const char * regexp;
const char * value;
};
class SetMultivarWorker : public Nan::AsyncWorker {
public:
SetMultivarWorker(
SetMultivarBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~SetMultivarWorker() {};
void Execute();
void HandleOKCallback();
private:
SetMultivarBaton *baton;
};
static NAN_METHOD(SetMultivar);
struct SetStringBaton {
int error_code;
const git_error* error;
git_config * cfg;
const char * name;
const char * value;
};
class SetStringWorker : public Nan::AsyncWorker {
public:
SetStringWorker(
SetStringBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~SetStringWorker() {};
void Execute();
void HandleOKCallback();
private:
SetStringBaton *baton;
};
static NAN_METHOD(SetString);
struct SnapshotBaton {
int error_code;
const git_error* error;
git_config * out;
git_config * config;
};
class SnapshotWorker : public Nan::AsyncWorker {
public:
SnapshotWorker(
SnapshotBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~SnapshotWorker() {};
void Execute();
void HandleOKCallback();
private:
SnapshotBaton *baton;
};
static NAN_METHOD(Snapshot);
};
#endif
+70
View File
@@ -0,0 +1,70 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCONFIGENTRY_H
#define GITCONFIGENTRY_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitConfigEntry;
struct GitConfigEntryTraits {
typedef GitConfigEntry cppClass;
typedef git_config_entry cType;
static const bool isDuplicable = false;
static void duplicate(git_config_entry **dest, git_config_entry *src) {
Nan::ThrowError("duplicate called on GitConfigEntry which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = false;
static void free(git_config_entry *raw) {
Nan::ThrowError("free called on GitConfigEntry which cannot be freed");
}
};
class GitConfigEntry : public
NodeGitWrapper<GitConfigEntryTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitConfigEntryTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitConfigEntry()
: NodeGitWrapper<GitConfigEntryTraits>(
"A new GitConfigEntry cannot be instantiated."
)
{}
GitConfigEntry(git_config_entry *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitConfigEntryTraits>(raw, selfFreeing, owner)
{}
~GitConfigEntry();
static NAN_METHOD(Name);
static NAN_METHOD(Value);
static NAN_METHOD(Level);
};
#endif
+149
View File
@@ -0,0 +1,149 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCONFIGITERATOR_H
#define GITCONFIGITERATOR_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/config.h"
#include "../include/config_entry.h"
// Forward declaration.
struct git_config_iterator {
};
using namespace node;
using namespace v8;
class GitConfigIterator;
struct GitConfigIteratorTraits {
typedef GitConfigIterator cppClass;
typedef git_config_iterator cType;
static const bool isDuplicable = false;
static void duplicate(git_config_iterator **dest, git_config_iterator *src) {
Nan::ThrowError("duplicate called on GitConfigIterator which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_config_iterator *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_config_iterator_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitConfigIterator : public
NodeGitWrapper<GitConfigIteratorTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitConfigIteratorTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitConfigIterator()
: NodeGitWrapper<GitConfigIteratorTraits>(
"A new GitConfigIterator cannot be instantiated."
)
{}
GitConfigIterator(git_config_iterator *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitConfigIteratorTraits>(raw, selfFreeing, owner)
{}
~GitConfigIterator();
struct CreateBaton {
int error_code;
const git_error* error;
git_config_iterator * out;
const git_config * cfg;
};
class CreateWorker : public Nan::AsyncWorker {
public:
CreateWorker(
CreateBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateBaton *baton;
};
static NAN_METHOD(Create);
struct GlobNewBaton {
int error_code;
const git_error* error;
git_config_iterator * out;
const git_config * cfg;
const char * regexp;
};
class GlobNewWorker : public Nan::AsyncWorker {
public:
GlobNewWorker(
GlobNewBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GlobNewWorker() {};
void Execute();
void HandleOKCallback();
private:
GlobNewBaton *baton;
};
static NAN_METHOD(GlobNew);
struct GitConfigMultivarIteratorNewBaton {
int error_code;
const git_error* error;
git_config_iterator * out;
const git_config * cfg;
const char * name;
const char * regexp;
};
class GitConfigMultivarIteratorNewWorker : public Nan::AsyncWorker {
public:
GitConfigMultivarIteratorNewWorker(
GitConfigMultivarIteratorNewBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GitConfigMultivarIteratorNewWorker() {};
void Execute();
void HandleOKCallback();
private:
GitConfigMultivarIteratorNewBaton *baton;
};
static NAN_METHOD(GitConfigMultivarIteratorNew);
static NAN_METHOD(GitConfigNext);
};
#endif
+73
View File
@@ -0,0 +1,73 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCONFIGMAP_H
#define GITCONFIGMAP_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitConfigmap;
struct GitConfigmapTraits {
typedef GitConfigmap cppClass;
typedef git_configmap cType;
static const bool isDuplicable = false;
static void duplicate(git_configmap **dest, git_configmap *src) {
Nan::ThrowError("duplicate called on GitConfigmap which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_configmap *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitConfigmap : public
NodeGitWrapper<GitConfigmapTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitConfigmapTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitConfigmap()
: NodeGitWrapper<GitConfigmapTraits>(
"A new GitConfigmap cannot be instantiated."
)
{}
GitConfigmap(git_configmap *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitConfigmapTraits>(raw, selfFreeing, owner)
{}
~GitConfigmap();
static NAN_METHOD(Type);
static NAN_METHOD(StrMatch);
static NAN_METHOD(MapValue);
};
#endif
+75
View File
@@ -0,0 +1,75 @@
#ifndef CONVENIENTHUNK_H
#define CONVENIENTHUNK_H
// generated from class_header.h
#include <nan.h>
#include <string>
#include "async_baton.h"
#include "promise_completion.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
struct HunkData {
git_diff_hunk hunk;
std::vector<git_diff_line *> *lines;
size_t numLines;
};
void HunkDataFree(HunkData *hunk);
using namespace node;
using namespace v8;
class ConvenientHunk : public Nan::ObjectWrap {
public:
static Nan::Persistent<Function> constructor_template;
static void InitializeComponent (v8::Local<v8::Object> target);
static v8::Local<v8::Value> New(void *raw);
HunkData *GetValue();
char *GetHeader();
size_t GetSize();
private:
ConvenientHunk(HunkData *hunk);
~ConvenientHunk();
HunkData *hunk;
static NAN_METHOD(JSNewFunction);
static NAN_METHOD(Size);
static NAN_METHOD(OldStart);
static NAN_METHOD(OldLines);
static NAN_METHOD(NewStart);
static NAN_METHOD(NewLines);
static NAN_METHOD(HeaderLen);
static NAN_METHOD(Header);
struct LinesBaton {
HunkData *hunk;
std::vector<git_diff_line *> *lines;
};
class LinesWorker : public Nan::AsyncWorker {
public:
LinesWorker(
LinesBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LinesWorker() {};
void Execute();
void HandleOKCallback();
private:
LinesBaton *baton;
};
static NAN_METHOD(Lines);
};
#endif
+108
View File
@@ -0,0 +1,108 @@
#ifndef CONVENIENTPATCH_H
#define CONVENIENTPATCH_H
// generated from class_header.h
#include <nan.h>
#include <string>
#include "async_baton.h"
#include "promise_completion.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/convenient_hunk.h"
struct ConvenientLineStats {
size_t context;
size_t additions;
size_t deletions;
};
struct PatchData {
ConvenientLineStats lineStats;
git_delta_t status;
git_diff_file new_file;
git_diff_file old_file;
std::vector<HunkData *> *hunks;
size_t numHunks;
};
PatchData *createFromRaw(git_patch *raw);
void PatchDataFree(PatchData *patch);
using namespace node;
using namespace v8;
class ConvenientPatch : public Nan::ObjectWrap {
public:
static Nan::Persistent<Function> constructor_template;
static void InitializeComponent (v8::Local<v8::Object> target);
static v8::Local<v8::Value> New(void *raw);
ConvenientLineStats GetLineStats();
git_delta_t GetStatus();
git_diff_file GetOldFile();
git_diff_file GetNewFile();
size_t GetNumHunks();
PatchData *GetValue();
private:
ConvenientPatch(PatchData *raw);
~ConvenientPatch();
PatchData *patch;
static NAN_METHOD(JSNewFunction);
// patch methods
static NAN_METHOD(LineStats);
// hunk methods
static NAN_METHOD(Size);
struct HunksBaton {
PatchData *patch;
std::vector<HunkData *> *hunks;
};
class HunksWorker : public Nan::AsyncWorker {
public:
HunksWorker(
HunksBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~HunksWorker() {};
void Execute();
void HandleOKCallback();
private:
HunksBaton *baton;
};
static NAN_METHOD(Hunks);
// delta methods
static NAN_METHOD(OldFile);
static NAN_METHOD(NewFile);
// convenient status methods
static NAN_METHOD(Status);
static NAN_METHOD(IsUnmodified);
static NAN_METHOD(IsAdded);
static NAN_METHOD(IsDeleted);
static NAN_METHOD(IsModified);
static NAN_METHOD(IsRenamed);
static NAN_METHOD(IsCopied);
static NAN_METHOD(IsIgnored);
static NAN_METHOD(IsUntracked);
static NAN_METHOD(IsTypeChange);
static NAN_METHOD(IsUnreadable);
static NAN_METHOD(IsConflicted);
// Hunk methods
};
#endif
+131
View File
@@ -0,0 +1,131 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITCRED_H
#define GITCRED_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitCred;
struct GitCredTraits {
typedef GitCred cppClass;
typedef git_cred cType;
static const bool isDuplicable = false;
static void duplicate(git_cred **dest, git_cred *src) {
Nan::ThrowError("duplicate called on GitCred which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_cred *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_cred_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitCred : public
NodeGitWrapper<GitCredTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitCredTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitCred()
: NodeGitWrapper<GitCredTraits>(
"A new GitCred cannot be instantiated."
)
{}
GitCred(git_cred *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitCredTraits>(raw, selfFreeing, owner)
{}
~GitCred();
static NAN_METHOD(DefaultNew);
static NAN_METHOD(GetUsername);
static NAN_METHOD(HasUsername);
static NAN_METHOD(SshKeyFromAgent);
struct SshKeyMemoryNewBaton {
int error_code;
const git_error* error;
git_cred * out;
const char * username;
const char * publickey;
const char * privatekey;
const char * passphrase;
};
class SshKeyMemoryNewWorker : public Nan::AsyncWorker {
public:
SshKeyMemoryNewWorker(
SshKeyMemoryNewBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~SshKeyMemoryNewWorker() {};
void Execute();
void HandleOKCallback();
private:
SshKeyMemoryNewBaton *baton;
};
static NAN_METHOD(SshKeyMemoryNew);
static NAN_METHOD(SshKeyNew);
struct UsernameNewBaton {
int error_code;
const git_error* error;
git_cred * cred;
const char * username;
};
class UsernameNewWorker : public Nan::AsyncWorker {
public:
UsernameNewWorker(
UsernameNewBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~UsernameNewWorker() {};
void Execute();
void HandleOKCallback();
private:
UsernameNewBaton *baton;
};
static NAN_METHOD(UsernameNew);
static NAN_METHOD(UserpassPlaintextNew);
};
#endif
+76
View File
@@ -0,0 +1,76 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITDESCRIBEFORMATOPTIONS_H
#define GITDESCRIBEFORMATOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
using namespace node;
using namespace v8;
class GitDescribeFormatOptions;
struct GitDescribeFormatOptionsTraits {
typedef GitDescribeFormatOptions cppClass;
typedef git_describe_format_options cType;
static const bool isDuplicable = false;
static void duplicate(git_describe_format_options **dest, git_describe_format_options *src) {
Nan::ThrowError("duplicate called on GitDescribeFormatOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_describe_format_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDescribeFormatOptions : public NodeGitWrapper<GitDescribeFormatOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitDescribeFormatOptionsTraits>;
public:
GitDescribeFormatOptions(git_describe_format_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDescribeFormatOptions();
~GitDescribeFormatOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetAbbreviatedSize);
static NAN_SETTER(SetAbbreviatedSize);
static NAN_GETTER(GetAlwaysUseLongFormat);
static NAN_SETTER(SetAlwaysUseLongFormat);
static NAN_GETTER(GetDirtySuffix);
static NAN_SETTER(SetDirtySuffix);
};
#endif
+84
View File
@@ -0,0 +1,84 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITDESCRIBEOPTIONS_H
#define GITDESCRIBEOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
using namespace node;
using namespace v8;
class GitDescribeOptions;
struct GitDescribeOptionsTraits {
typedef GitDescribeOptions cppClass;
typedef git_describe_options cType;
static const bool isDuplicable = false;
static void duplicate(git_describe_options **dest, git_describe_options *src) {
Nan::ThrowError("duplicate called on GitDescribeOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_describe_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDescribeOptions : public NodeGitWrapper<GitDescribeOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitDescribeOptionsTraits>;
public:
GitDescribeOptions(git_describe_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDescribeOptions();
~GitDescribeOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetMaxCandidatesTags);
static NAN_SETTER(SetMaxCandidatesTags);
static NAN_GETTER(GetDescribeStrategy);
static NAN_SETTER(SetDescribeStrategy);
static NAN_GETTER(GetPattern);
static NAN_SETTER(SetPattern);
static NAN_GETTER(GetOnlyFollowFirstParent);
static NAN_SETTER(SetOnlyFollowFirstParent);
static NAN_GETTER(GetShowCommitOidAsFallback);
static NAN_SETTER(SetShowCommitOidAsFallback);
};
#endif
+73
View File
@@ -0,0 +1,73 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITDESCRIBERESULT_H
#define GITDESCRIBERESULT_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
// Forward declaration.
struct git_describe_result {
};
using namespace node;
using namespace v8;
class GitDescribeResult;
struct GitDescribeResultTraits {
typedef GitDescribeResult cppClass;
typedef git_describe_result cType;
static const bool isDuplicable = false;
static void duplicate(git_describe_result **dest, git_describe_result *src) {
Nan::ThrowError("duplicate called on GitDescribeResult which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_describe_result *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDescribeResult : public
NodeGitWrapper<GitDescribeResultTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitDescribeResultTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDescribeResult()
: NodeGitWrapper<GitDescribeResultTraits>(
"A new GitDescribeResult cannot be instantiated."
)
{}
GitDescribeResult(git_describe_result *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitDescribeResultTraits>(raw, selfFreeing, owner)
{}
~GitDescribeResult();
};
#endif
+531
View File
@@ -0,0 +1,531 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITDIFF_H
#define GITDIFF_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
#include <git2/sys/diff.h>
}
#include "../include/typedefs.h"
#include "../include/blob.h"
#include "../include/diff_options.h"
#include "../include/diff_delta.h"
#include "../include/diff_binary.h"
#include "../include/diff_hunk.h"
#include "../include/diff_line.h"
#include "../include/diff_find_options.h"
#include "../include/diff_stats.h"
#include "../include/repository.h"
#include "../include/index.h"
#include "../include/oid.h"
#include "../include/diff_patchid_options.h"
#include "../include/buf.h"
#include "../include/tree.h"
#include "../include/diff_perfdata.h"
// Forward declaration.
struct git_diff {
};
using namespace node;
using namespace v8;
class GitDiff;
struct GitDiffTraits {
typedef GitDiff cppClass;
typedef git_diff cType;
static const bool isDuplicable = false;
static void duplicate(git_diff **dest, git_diff *src) {
Nan::ThrowError("duplicate called on GitDiff which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_diff_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiff : public
NodeGitWrapper<GitDiffTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitDiffTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
static int BlobToBuffer_file_cb_cppCallback (
const git_diff_delta * delta
,
float progress
,
void * payload
);
static void BlobToBuffer_file_cb_async(void *baton);
static void BlobToBuffer_file_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct BlobToBuffer_FileCbBaton : public AsyncBatonWithResult<int> {
const git_diff_delta * delta;
float progress;
void * payload;
BlobToBuffer_FileCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static int BlobToBuffer_binary_cb_cppCallback (
const git_diff_delta * delta
,
const git_diff_binary * binary
,
void * payload
);
static void BlobToBuffer_binary_cb_async(void *baton);
static void BlobToBuffer_binary_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct BlobToBuffer_BinaryCbBaton : public AsyncBatonWithResult<int> {
const git_diff_delta * delta;
const git_diff_binary * binary;
void * payload;
BlobToBuffer_BinaryCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static int BlobToBuffer_hunk_cb_cppCallback (
const git_diff_delta * delta
,
const git_diff_hunk * hunk
,
void * payload
);
static void BlobToBuffer_hunk_cb_async(void *baton);
static void BlobToBuffer_hunk_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct BlobToBuffer_HunkCbBaton : public AsyncBatonWithResult<int> {
const git_diff_delta * delta;
const git_diff_hunk * hunk;
void * payload;
BlobToBuffer_HunkCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static int BlobToBuffer_line_cb_cppCallback (
const git_diff_delta * delta
,
const git_diff_hunk * hunk
,
const git_diff_line * line
,
void * payload
);
static void BlobToBuffer_line_cb_async(void *baton);
static void BlobToBuffer_line_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct BlobToBuffer_LineCbBaton : public AsyncBatonWithResult<int> {
const git_diff_delta * delta;
const git_diff_hunk * hunk;
const git_diff_line * line;
void * payload;
BlobToBuffer_LineCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
private:
GitDiff()
: NodeGitWrapper<GitDiffTraits>(
"A new GitDiff cannot be instantiated."
)
{}
GitDiff(git_diff *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitDiffTraits>(raw, selfFreeing, owner)
{}
~GitDiff();
struct BlobToBufferBaton {
int error_code;
const git_error* error;
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 * options;
git_diff_file_cb file_cb;
git_diff_binary_cb binary_cb;
git_diff_hunk_cb hunk_cb;
git_diff_line_cb line_cb;
void * payload;
};
class BlobToBufferWorker : public Nan::AsyncWorker {
public:
BlobToBufferWorker(
BlobToBufferBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~BlobToBufferWorker() {};
void Execute();
void HandleOKCallback();
private:
BlobToBufferBaton *baton;
};
static NAN_METHOD(BlobToBuffer);
struct FindSimilarBaton {
int error_code;
const git_error* error;
git_diff * diff;
const git_diff_find_options * options;
};
class FindSimilarWorker : public Nan::AsyncWorker {
public:
FindSimilarWorker(
FindSimilarBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FindSimilarWorker() {};
void Execute();
void HandleOKCallback();
private:
FindSimilarBaton *baton;
};
static NAN_METHOD(FindSimilar);
struct FromBufferBaton {
int error_code;
const git_error* error;
git_diff * out;
const char * content;
size_t content_len;
};
class FromBufferWorker : public Nan::AsyncWorker {
public:
FromBufferWorker(
FromBufferBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FromBufferWorker() {};
void Execute();
void HandleOKCallback();
private:
FromBufferBaton *baton;
};
static NAN_METHOD(FromBuffer);
static NAN_METHOD(GetDelta);
struct GetStatsBaton {
int error_code;
const git_error* error;
git_diff_stats * out;
git_diff * diff;
};
class GetStatsWorker : public Nan::AsyncWorker {
public:
GetStatsWorker(
GetStatsBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~GetStatsWorker() {};
void Execute();
void HandleOKCallback();
private:
GetStatsBaton *baton;
};
static NAN_METHOD(GetStats);
struct IndexToIndexBaton {
int error_code;
const git_error* error;
git_diff * diff;
git_repository * repo;
git_index * old_index;
git_index * new_index;
const git_diff_options * opts;
};
class IndexToIndexWorker : public Nan::AsyncWorker {
public:
IndexToIndexWorker(
IndexToIndexBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~IndexToIndexWorker() {};
void Execute();
void HandleOKCallback();
private:
IndexToIndexBaton *baton;
};
static NAN_METHOD(IndexToIndex);
struct IndexToWorkdirBaton {
int error_code;
const git_error* error;
git_diff * diff;
git_repository * repo;
git_index * index;
const git_diff_options * opts;
};
class IndexToWorkdirWorker : public Nan::AsyncWorker {
public:
IndexToWorkdirWorker(
IndexToWorkdirBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~IndexToWorkdirWorker() {};
void Execute();
void HandleOKCallback();
private:
IndexToWorkdirBaton *baton;
};
static NAN_METHOD(IndexToWorkdir);
static NAN_METHOD(IsSortedIcase);
struct MergeBaton {
int error_code;
const git_error* error;
git_diff * onto;
const git_diff * from;
};
class MergeWorker : public Nan::AsyncWorker {
public:
MergeWorker(
MergeBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~MergeWorker() {};
void Execute();
void HandleOKCallback();
private:
MergeBaton *baton;
};
static NAN_METHOD(Merge);
static NAN_METHOD(NumDeltas);
struct PatchidBaton {
int error_code;
const git_error* error;
git_oid * out;
git_diff * diff;
git_diff_patchid_options * opts;
};
class PatchidWorker : public Nan::AsyncWorker {
public:
PatchidWorker(
PatchidBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~PatchidWorker() {};
void Execute();
void HandleOKCallback();
private:
PatchidBaton *baton;
};
static NAN_METHOD(Patchid);
struct ToBufBaton {
int error_code;
const git_error* error;
git_buf * out;
git_diff * diff;
git_diff_format_t format;
};
class ToBufWorker : public Nan::AsyncWorker {
public:
ToBufWorker(
ToBufBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ToBufWorker() {};
void Execute();
void HandleOKCallback();
private:
ToBufBaton *baton;
};
static NAN_METHOD(ToBuf);
struct TreeToIndexBaton {
int error_code;
const git_error* error;
git_diff * diff;
git_repository * repo;
git_tree * old_tree;
git_index * index;
const git_diff_options * opts;
};
class TreeToIndexWorker : public Nan::AsyncWorker {
public:
TreeToIndexWorker(
TreeToIndexBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~TreeToIndexWorker() {};
void Execute();
void HandleOKCallback();
private:
TreeToIndexBaton *baton;
};
static NAN_METHOD(TreeToIndex);
struct TreeToTreeBaton {
int error_code;
const git_error* error;
git_diff * diff;
git_repository * repo;
git_tree * old_tree;
git_tree * new_tree;
const git_diff_options * opts;
};
class TreeToTreeWorker : public Nan::AsyncWorker {
public:
TreeToTreeWorker(
TreeToTreeBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~TreeToTreeWorker() {};
void Execute();
void HandleOKCallback();
private:
TreeToTreeBaton *baton;
};
static NAN_METHOD(TreeToTree);
struct TreeToWorkdirBaton {
int error_code;
const git_error* error;
git_diff * diff;
git_repository * repo;
git_tree * old_tree;
const git_diff_options * opts;
};
class TreeToWorkdirWorker : public Nan::AsyncWorker {
public:
TreeToWorkdirWorker(
TreeToWorkdirBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~TreeToWorkdirWorker() {};
void Execute();
void HandleOKCallback();
private:
TreeToWorkdirBaton *baton;
};
static NAN_METHOD(TreeToWorkdir);
struct TreeToWorkdirWithIndexBaton {
int error_code;
const git_error* error;
git_diff * diff;
git_repository * repo;
git_tree * old_tree;
const git_diff_options * opts;
};
class TreeToWorkdirWithIndexWorker : public Nan::AsyncWorker {
public:
TreeToWorkdirWithIndexWorker(
TreeToWorkdirWithIndexBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~TreeToWorkdirWithIndexWorker() {};
void Execute();
void HandleOKCallback();
private:
TreeToWorkdirWithIndexBaton *baton;
};
static NAN_METHOD(TreeToWorkdirWithIndex);
static NAN_METHOD(GetPerfdata);
struct BlobToBuffer_globalPayload {
Nan::Callback * file_cb;
Nan::Callback * binary_cb;
Nan::Callback * hunk_cb;
Nan::Callback * line_cb;
BlobToBuffer_globalPayload() {
file_cb = NULL;
binary_cb = NULL;
hunk_cb = NULL;
line_cb = NULL;
}
~BlobToBuffer_globalPayload() {
if (file_cb != NULL) {
delete file_cb;
}
if (binary_cb != NULL) {
delete binary_cb;
}
if (hunk_cb != NULL) {
delete hunk_cb;
}
if (line_cb != NULL) {
delete line_cb;
}
}
};
};
#endif
+74
View File
@@ -0,0 +1,74 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITDIFFBINARY_H
#define GITDIFFBINARY_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/diff_binary_file.h"
using namespace node;
using namespace v8;
class GitDiffBinary;
struct GitDiffBinaryTraits {
typedef GitDiffBinary cppClass;
typedef git_diff_binary cType;
static const bool isDuplicable = false;
static void duplicate(git_diff_binary **dest, git_diff_binary *src) {
Nan::ThrowError("duplicate called on GitDiffBinary which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff_binary *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiffBinary : public
NodeGitWrapper<GitDiffBinaryTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitDiffBinaryTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDiffBinary()
: NodeGitWrapper<GitDiffBinaryTraits>(
"A new GitDiffBinary cannot be instantiated."
)
{}
GitDiffBinary(git_diff_binary *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitDiffBinaryTraits>(raw, selfFreeing, owner)
{}
~GitDiffBinary();
static NAN_METHOD(ContainsData);
static NAN_METHOD(OldFile);
static NAN_METHOD(NewFile);
};
#endif
+74
View File
@@ -0,0 +1,74 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITDIFFBINARYFILE_H
#define GITDIFFBINARYFILE_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitDiffBinaryFile;
struct GitDiffBinaryFileTraits {
typedef GitDiffBinaryFile cppClass;
typedef git_diff_binary_file cType;
static const bool isDuplicable = false;
static void duplicate(git_diff_binary_file **dest, git_diff_binary_file *src) {
Nan::ThrowError("duplicate called on GitDiffBinaryFile which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff_binary_file *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiffBinaryFile : public
NodeGitWrapper<GitDiffBinaryFileTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitDiffBinaryFileTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDiffBinaryFile()
: NodeGitWrapper<GitDiffBinaryFileTraits>(
"A new GitDiffBinaryFile cannot be instantiated."
)
{}
GitDiffBinaryFile(git_diff_binary_file *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitDiffBinaryFileTraits>(raw, selfFreeing, owner)
{}
~GitDiffBinaryFile();
static NAN_METHOD(Type);
static NAN_METHOD(Data);
static NAN_METHOD(Datalen);
static NAN_METHOD(Inflatedlen);
};
#endif
+77
View File
@@ -0,0 +1,77 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITDIFFDELTA_H
#define GITDIFFDELTA_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/diff_file.h"
using namespace node;
using namespace v8;
class GitDiffDelta;
struct GitDiffDeltaTraits {
typedef GitDiffDelta cppClass;
typedef git_diff_delta cType;
static const bool isDuplicable = false;
static void duplicate(git_diff_delta **dest, git_diff_delta *src) {
Nan::ThrowError("duplicate called on GitDiffDelta which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff_delta *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiffDelta : public
NodeGitWrapper<GitDiffDeltaTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitDiffDeltaTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDiffDelta()
: NodeGitWrapper<GitDiffDeltaTraits>(
"A new GitDiffDelta cannot be instantiated."
)
{}
GitDiffDelta(git_diff_delta *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitDiffDeltaTraits>(raw, selfFreeing, owner)
{}
~GitDiffDelta();
static NAN_METHOD(Status);
static NAN_METHOD(Flags);
static NAN_METHOD(Similarity);
static NAN_METHOD(Nfiles);
static NAN_METHOD(OldFile);
static NAN_METHOD(NewFile);
};
#endif
+77
View File
@@ -0,0 +1,77 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITDIFFFILE_H
#define GITDIFFFILE_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/oid.h"
using namespace node;
using namespace v8;
class GitDiffFile;
struct GitDiffFileTraits {
typedef GitDiffFile cppClass;
typedef git_diff_file cType;
static const bool isDuplicable = false;
static void duplicate(git_diff_file **dest, git_diff_file *src) {
Nan::ThrowError("duplicate called on GitDiffFile which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff_file *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiffFile : public
NodeGitWrapper<GitDiffFileTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitDiffFileTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDiffFile()
: NodeGitWrapper<GitDiffFileTraits>(
"A new GitDiffFile cannot be instantiated."
)
{}
GitDiffFile(git_diff_file *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitDiffFileTraits>(raw, selfFreeing, owner)
{}
~GitDiffFile();
static NAN_METHOD(Id);
static NAN_METHOD(Path);
static NAN_METHOD(Size);
static NAN_METHOD(Flags);
static NAN_METHOD(Mode);
static NAN_METHOD(IdAbbrev);
};
#endif
+88
View File
@@ -0,0 +1,88 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITDIFFFINDOPTIONS_H
#define GITDIFFFINDOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
using namespace node;
using namespace v8;
class GitDiffFindOptions;
struct GitDiffFindOptionsTraits {
typedef GitDiffFindOptions cppClass;
typedef git_diff_find_options cType;
static const bool isDuplicable = false;
static void duplicate(git_diff_find_options **dest, git_diff_find_options *src) {
Nan::ThrowError("duplicate called on GitDiffFindOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff_find_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiffFindOptions : public NodeGitWrapper<GitDiffFindOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitDiffFindOptionsTraits>;
public:
GitDiffFindOptions(git_diff_find_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDiffFindOptions();
~GitDiffFindOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetFlags);
static NAN_SETTER(SetFlags);
static NAN_GETTER(GetRenameThreshold);
static NAN_SETTER(SetRenameThreshold);
static NAN_GETTER(GetRenameFromRewriteThreshold);
static NAN_SETTER(SetRenameFromRewriteThreshold);
static NAN_GETTER(GetCopyThreshold);
static NAN_SETTER(SetCopyThreshold);
static NAN_GETTER(GetBreakRewriteThreshold);
static NAN_SETTER(SetBreakRewriteThreshold);
static NAN_GETTER(GetRenameLimit);
static NAN_SETTER(SetRenameLimit);
};
#endif
+76
View File
@@ -0,0 +1,76 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITDIFFHUNK_H
#define GITDIFFHUNK_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitDiffHunk;
struct GitDiffHunkTraits {
typedef GitDiffHunk cppClass;
typedef git_diff_hunk cType;
static const bool isDuplicable = false;
static void duplicate(git_diff_hunk **dest, git_diff_hunk *src) {
Nan::ThrowError("duplicate called on GitDiffHunk which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff_hunk *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiffHunk : public
NodeGitWrapper<GitDiffHunkTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitDiffHunkTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDiffHunk()
: NodeGitWrapper<GitDiffHunkTraits>(
"A new GitDiffHunk cannot be instantiated."
)
{}
GitDiffHunk(git_diff_hunk *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitDiffHunkTraits>(raw, selfFreeing, owner)
{}
~GitDiffHunk();
static NAN_METHOD(OldStart);
static NAN_METHOD(OldLines);
static NAN_METHOD(NewStart);
static NAN_METHOD(NewLines);
static NAN_METHOD(HeaderLen);
static NAN_METHOD(Header);
};
#endif
+77
View File
@@ -0,0 +1,77 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITDIFFLINE_H
#define GITDIFFLINE_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitDiffLine;
struct GitDiffLineTraits {
typedef GitDiffLine cppClass;
typedef git_diff_line cType;
static const bool isDuplicable = false;
static void duplicate(git_diff_line **dest, git_diff_line *src) {
Nan::ThrowError("duplicate called on GitDiffLine which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff_line *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiffLine : public
NodeGitWrapper<GitDiffLineTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitDiffLineTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDiffLine()
: NodeGitWrapper<GitDiffLineTraits>(
"A new GitDiffLine cannot be instantiated."
)
{}
GitDiffLine(git_diff_line *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitDiffLineTraits>(raw, selfFreeing, owner)
{}
~GitDiffLine();
static NAN_METHOD(Origin);
static NAN_METHOD(OldLineno);
static NAN_METHOD(NewLineno);
static NAN_METHOD(NumLines);
static NAN_METHOD(ContentLen);
static NAN_METHOD(ContentOffset);
static NAN_METHOD(Content);
};
#endif
+166
View File
@@ -0,0 +1,166 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITDIFFOPTIONS_H
#define GITDIFFOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
#include "../include/strarray.h"
#include "../include/diff_delta.h"
using namespace node;
using namespace v8;
class GitDiffOptions;
struct GitDiffOptionsTraits {
typedef GitDiffOptions cppClass;
typedef git_diff_options cType;
static const bool isDuplicable = false;
static void duplicate(git_diff_options **dest, git_diff_options *src) {
Nan::ThrowError("duplicate called on GitDiffOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiffOptions : public NodeGitWrapper<GitDiffOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitDiffOptionsTraits>;
public:
GitDiffOptions(git_diff_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
static int notify_cb_cppCallback (
const git_diff * diff_so_far
,
git_diff_delta * delta_to_add
,
const char * matched_pathspec
,
void * payload
);
static void notify_cb_async(void *baton);
static void notify_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct NotifyCbBaton : public AsyncBatonWithResult<int> {
const git_diff * diff_so_far;
git_diff_delta * delta_to_add;
const char * matched_pathspec;
void * payload;
NotifyCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitDiffOptions * notify_cb_getInstanceFromBaton (
NotifyCbBaton *baton);
static int progress_cb_cppCallback (
const git_diff * diff_so_far
,
const char * old_path
,
const char * new_path
,
void * payload
);
static void progress_cb_async(void *baton);
static void progress_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct ProgressCbBaton : public AsyncBatonWithResult<int> {
const git_diff * diff_so_far;
const char * old_path;
const char * new_path;
void * payload;
ProgressCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitDiffOptions * progress_cb_getInstanceFromBaton (
ProgressCbBaton *baton);
private:
GitDiffOptions();
~GitDiffOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetFlags);
static NAN_SETTER(SetFlags);
static NAN_GETTER(GetIgnoreSubmodules);
static NAN_SETTER(SetIgnoreSubmodules);
Nan::Persistent<Object> pathspec;
static NAN_GETTER(GetPathspec);
static NAN_SETTER(SetPathspec);
CallbackWrapper notify_cb;
static NAN_GETTER(GetNotifyCb);
static NAN_SETTER(SetNotifyCb);
CallbackWrapper progress_cb;
static NAN_GETTER(GetProgressCb);
static NAN_SETTER(SetProgressCb);
Nan::Persistent<Value> payload;
static NAN_GETTER(GetPayload);
static NAN_SETTER(SetPayload);
static NAN_GETTER(GetContextLines);
static NAN_SETTER(SetContextLines);
static NAN_GETTER(GetInterhunkLines);
static NAN_SETTER(SetInterhunkLines);
static NAN_GETTER(GetIdAbbrev);
static NAN_SETTER(SetIdAbbrev);
static NAN_GETTER(GetMaxSize);
static NAN_SETTER(SetMaxSize);
static NAN_GETTER(GetOldPrefix);
static NAN_SETTER(SetOldPrefix);
static NAN_GETTER(GetNewPrefix);
static NAN_SETTER(SetNewPrefix);
};
#endif
+64
View File
@@ -0,0 +1,64 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITDIFFPATCHIDOPTIONS_H
#define GITDIFFPATCHIDOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
using namespace node;
using namespace v8;
class GitDiffPatchidOptions;
struct GitDiffPatchidOptionsTraits {
typedef GitDiffPatchidOptions cppClass;
typedef git_diff_patchid_options cType;
static const bool isDuplicable = false;
static void duplicate(git_diff_patchid_options **dest, git_diff_patchid_options *src) {
Nan::ThrowError("duplicate called on GitDiffPatchidOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff_patchid_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiffPatchidOptions : public NodeGitWrapper<GitDiffPatchidOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitDiffPatchidOptionsTraits>;
public:
GitDiffPatchidOptions(git_diff_patchid_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDiffPatchidOptions();
~GitDiffPatchidOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
};
#endif
+73
View File
@@ -0,0 +1,73 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITDIFFPERFDATA_H
#define GITDIFFPERFDATA_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
#include <git2/sys/diff.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitDiffPerfdata;
struct GitDiffPerfdataTraits {
typedef GitDiffPerfdata cppClass;
typedef git_diff_perfdata cType;
static const bool isDuplicable = false;
static void duplicate(git_diff_perfdata **dest, git_diff_perfdata *src) {
Nan::ThrowError("duplicate called on GitDiffPerfdata which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff_perfdata *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiffPerfdata : public
NodeGitWrapper<GitDiffPerfdataTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitDiffPerfdataTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDiffPerfdata()
: NodeGitWrapper<GitDiffPerfdataTraits>(
"A new GitDiffPerfdata cannot be instantiated."
)
{}
GitDiffPerfdata(git_diff_perfdata *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitDiffPerfdataTraits>(raw, selfFreeing, owner)
{}
~GitDiffPerfdata();
static NAN_METHOD(StatCalls);
static NAN_METHOD(OidCalculations);
};
#endif
+105
View File
@@ -0,0 +1,105 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITDIFFSTATS_H
#define GITDIFFSTATS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/buf.h"
// Forward declaration.
struct git_diff_stats {
};
using namespace node;
using namespace v8;
class GitDiffStats;
struct GitDiffStatsTraits {
typedef GitDiffStats cppClass;
typedef git_diff_stats cType;
static const bool isDuplicable = false;
static void duplicate(git_diff_stats **dest, git_diff_stats *src) {
Nan::ThrowError("duplicate called on GitDiffStats which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_diff_stats *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_diff_stats_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitDiffStats : public
NodeGitWrapper<GitDiffStatsTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitDiffStatsTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitDiffStats()
: NodeGitWrapper<GitDiffStatsTraits>(
"A new GitDiffStats cannot be instantiated."
)
{}
GitDiffStats(git_diff_stats *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitDiffStatsTraits>(raw, selfFreeing, owner)
{}
~GitDiffStats();
static NAN_METHOD(FilesChanged);
static NAN_METHOD(Insertions);
static NAN_METHOD(Deletions);
struct DiffStatsToBufBaton {
int error_code;
const git_error* error;
git_buf * out;
const git_diff_stats * stats;
git_diff_stats_format_t format;
size_t width;
};
class DiffStatsToBufWorker : public Nan::AsyncWorker {
public:
DiffStatsToBufWorker(
DiffStatsToBufBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~DiffStatsToBufWorker() {};
void Execute();
void HandleOKCallback();
private:
DiffStatsToBufBaton *baton;
};
static NAN_METHOD(DiffStatsToBuf);
};
#endif
+80
View File
@@ -0,0 +1,80 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITERROR_H
#define GITERROR_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitError;
struct GitErrorTraits {
typedef GitError cppClass;
typedef git_error cType;
static const bool isDuplicable = false;
static void duplicate(git_error **dest, git_error *src) {
Nan::ThrowError("duplicate called on GitError which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_error *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitError : public
NodeGitWrapper<GitErrorTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitErrorTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitError()
: NodeGitWrapper<GitErrorTraits>(
"A new GitError cannot be instantiated."
)
{}
GitError(git_error *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitErrorTraits>(raw, selfFreeing, owner)
{}
~GitError();
static NAN_METHOD(Message);
static NAN_METHOD(Klass);
static NAN_METHOD(Clear);
static NAN_METHOD(Last);
static NAN_METHOD(SetOom);
static NAN_METHOD(SetStr);
};
#endif
+39
View File
@@ -0,0 +1,39 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITFETCH_H
#define GITFETCH_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitFetch : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
};
#endif
+95
View File
@@ -0,0 +1,95 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITFETCHOPTIONS_H
#define GITFETCHOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
#include "../include/str_array_converter.h"
#include "../include/remote_callbacks.h"
#include "../include/proxy_options.h"
#include "../include/strarray.h"
using namespace node;
using namespace v8;
class GitFetchOptions;
struct GitFetchOptionsTraits {
typedef GitFetchOptions cppClass;
typedef git_fetch_options cType;
static const bool isDuplicable = false;
static void duplicate(git_fetch_options **dest, git_fetch_options *src) {
Nan::ThrowError("duplicate called on GitFetchOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_fetch_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitFetchOptions : public NodeGitWrapper<GitFetchOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitFetchOptionsTraits>;
public:
GitFetchOptions(git_fetch_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitFetchOptions();
~GitFetchOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
Nan::Persistent<Object> callbacks;
static NAN_GETTER(GetCallbacks);
static NAN_SETTER(SetCallbacks);
static NAN_GETTER(GetPrune);
static NAN_SETTER(SetPrune);
Nan::Persistent<Object> proxy_opts;
static NAN_GETTER(GetProxyOpts);
static NAN_SETTER(SetProxyOpts);
static NAN_GETTER(GetUpdateFetchhead);
static NAN_SETTER(SetUpdateFetchhead);
static NAN_GETTER(GetDownloadTags);
static NAN_SETTER(SetDownloadTags);
Nan::Persistent<Object> custom_headers;
static NAN_GETTER(GetCustomHeaders);
static NAN_SETTER(SetCustomHeaders);
};
#endif
+199
View File
@@ -0,0 +1,199 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITFILTER_H
#define GITFILTER_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
#include <git2/sys/filter.h>
}
#include "../include/filter_source.h"
#include "../include/buf.h"
using namespace node;
using namespace v8;
class GitFilter;
struct GitFilterTraits {
typedef GitFilter cppClass;
typedef git_filter cType;
static const bool isDuplicable = false;
static void duplicate(git_filter **dest, git_filter *src) {
Nan::ThrowError("duplicate called on GitFilter which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_filter *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
struct git_filter_extended {
git_filter raw;
void* payload;
};
class GitFilter : public NodeGitWrapper<GitFilterTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitFilterTraits>;
public:
GitFilter(git_filter* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
static int initialize_cppCallback (
git_filter * self
);
static void initialize_async(void *baton);
static void initialize_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct InitializeBaton : public AsyncBatonWithResult<int> {
git_filter * self;
InitializeBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitFilter * initialize_getInstanceFromBaton (
InitializeBaton *baton);
static void shutdown_cppCallback (
git_filter * self
);
static void shutdown_async(void *baton);
static void shutdown_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct ShutdownBaton : public AsyncBatonWithNoResult {
git_filter * self;
ShutdownBaton()
: AsyncBatonWithNoResult() {
}
};
static GitFilter * shutdown_getInstanceFromBaton (
ShutdownBaton *baton);
static int check_cppCallback (
git_filter * self
,
void ** payload
,
const git_filter_source * src
,
const char ** attr_values
);
static void check_async(void *baton);
static void check_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct CheckBaton : public AsyncBatonWithResult<int> {
git_filter * self;
void ** payload;
const git_filter_source * src;
const char ** attr_values;
CheckBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitFilter * check_getInstanceFromBaton (
CheckBaton *baton);
static int apply_cppCallback (
git_filter * self
,
void ** payload
,
git_buf * to
,
const git_buf * from
,
const git_filter_source * src
);
static void apply_async(void *baton);
static void apply_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct ApplyBaton : public AsyncBatonWithResult<int> {
git_filter * self;
void ** payload;
git_buf * to;
const git_buf * from;
const git_filter_source * src;
ApplyBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitFilter * apply_getInstanceFromBaton (
ApplyBaton *baton);
static void cleanup_cppCallback (
git_filter * self
,
void * payload
);
static void cleanup_async(void *baton);
static void cleanup_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct CleanupBaton : public AsyncBatonWithNoResult {
git_filter * self;
void * payload;
CleanupBaton()
: AsyncBatonWithNoResult() {
}
};
static GitFilter * cleanup_getInstanceFromBaton (
CleanupBaton *baton);
private:
GitFilter();
~GitFilter();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetAttributes);
static NAN_SETTER(SetAttributes);
CallbackWrapper initialize;
static NAN_GETTER(GetInitialize);
static NAN_SETTER(SetInitialize);
CallbackWrapper shutdown;
static NAN_GETTER(GetShutdown);
static NAN_SETTER(SetShutdown);
CallbackWrapper check;
static NAN_GETTER(GetCheck);
static NAN_SETTER(SetCheck);
CallbackWrapper apply;
static NAN_GETTER(GetApply);
static NAN_SETTER(SetApply);
CallbackWrapper cleanup;
static NAN_GETTER(GetCleanup);
static NAN_SETTER(SetCleanup);
};
#endif
+178
View File
@@ -0,0 +1,178 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITFILTERLIST_H
#define GITFILTERLIST_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/git_buf_converter.h"
#include "../include/filter_registry.h"
#include "../include/buf.h"
#include "../include/blob.h"
#include "../include/repository.h"
// Forward declaration.
struct git_filter_list {
};
using namespace node;
using namespace v8;
class GitFilterList;
struct GitFilterListTraits {
typedef GitFilterList cppClass;
typedef git_filter_list cType;
static const bool isDuplicable = false;
static void duplicate(git_filter_list **dest, git_filter_list *src) {
Nan::ThrowError("duplicate called on GitFilterList which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_filter_list *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_filter_list_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitFilterList : public
NodeGitWrapper<GitFilterListTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitFilterListTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitFilterList()
: NodeGitWrapper<GitFilterListTraits>(
"A new GitFilterList cannot be instantiated."
)
{}
GitFilterList(git_filter_list *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitFilterListTraits>(raw, selfFreeing, owner)
{}
~GitFilterList();
struct ApplyToBlobBaton {
int error_code;
const git_error* error;
git_buf * out;
git_filter_list * filters;
git_blob * blob;
};
class ApplyToBlobWorker : public Nan::AsyncWorker {
public:
ApplyToBlobWorker(
ApplyToBlobBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ApplyToBlobWorker() {};
void Execute();
void HandleOKCallback();
private:
ApplyToBlobBaton *baton;
};
static NAN_METHOD(ApplyToBlob);
struct ApplyToDataBaton {
int error_code;
const git_error* error;
git_buf * out;
git_filter_list * filters;
git_buf * in;
};
class ApplyToDataWorker : public Nan::AsyncWorker {
public:
ApplyToDataWorker(
ApplyToDataBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ApplyToDataWorker() {};
void Execute();
void HandleOKCallback();
private:
ApplyToDataBaton *baton;
};
static NAN_METHOD(ApplyToData);
struct ApplyToFileBaton {
int error_code;
const git_error* error;
git_buf * out;
git_filter_list * filters;
git_repository * repo;
const char * path;
};
class ApplyToFileWorker : public Nan::AsyncWorker {
public:
ApplyToFileWorker(
ApplyToFileBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ApplyToFileWorker() {};
void Execute();
void HandleOKCallback();
private:
ApplyToFileBaton *baton;
};
static NAN_METHOD(ApplyToFile);
struct LoadBaton {
int error_code;
const git_error* error;
git_filter_list * filters;
git_repository * repo;
git_blob * blob;
const char * path;
git_filter_mode_t mode;
uint32_t flags;
};
class LoadWorker : public Nan::AsyncWorker {
public:
LoadWorker(
LoadBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LoadWorker() {};
void Execute();
void HandleOKCallback();
private:
LoadBaton *baton;
};
static NAN_METHOD(Load);
};
#endif
+75
View File
@@ -0,0 +1,75 @@
#ifndef GITFILTERREGISTRY_H
#define GITFILTERREGISTRY_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/filter.h"
using namespace node;
using namespace v8;
class GitFilterRegistry : public Nan::ObjectWrap {
public:
static void InitializeComponent(v8::Local<v8::Object> target);
static Nan::Persistent<v8::Object> persistentHandle;
private:
static NAN_METHOD(GitFilterRegister);
static NAN_METHOD(GitFilterUnregister);
struct FilterRegisterBaton {
const git_error *error;
git_filter *filter;
char *filter_name;
int filter_priority;
int error_code;
};
struct FilterUnregisterBaton {
const git_error *error;
char *filter_name;
int error_code;
};
class RegisterWorker : public Nan::AsyncWorker {
public:
RegisterWorker(FilterRegisterBaton *_baton, Nan::Callback *callback)
: Nan::AsyncWorker(callback), baton(_baton) {};
~RegisterWorker() {};
void Execute();
void HandleOKCallback();
private:
FilterRegisterBaton *baton;
};
class UnregisterWorker : public Nan::AsyncWorker {
public:
UnregisterWorker(FilterUnregisterBaton *_baton, Nan::Callback *callback)
: Nan::AsyncWorker(callback), baton(_baton) {};
~UnregisterWorker() {};
void Execute();
void HandleOKCallback();
private:
FilterUnregisterBaton *baton;
};
};
#endif
+109
View File
@@ -0,0 +1,109 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITFILTERSOURCE_H
#define GITFILTERSOURCE_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
#include <git2/sys/filter.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
#include "../include/oid.h"
// Forward declaration.
struct git_filter_source {
};
using namespace node;
using namespace v8;
class GitFilterSource;
struct GitFilterSourceTraits {
typedef GitFilterSource cppClass;
typedef git_filter_source cType;
static const bool isDuplicable = false;
static void duplicate(git_filter_source **dest, git_filter_source *src) {
Nan::ThrowError("duplicate called on GitFilterSource which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_filter_source *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitFilterSource : public
NodeGitWrapper<GitFilterSourceTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitFilterSourceTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitFilterSource()
: NodeGitWrapper<GitFilterSourceTraits>(
"A new GitFilterSource cannot be instantiated."
)
{}
GitFilterSource(git_filter_source *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitFilterSourceTraits>(raw, selfFreeing, owner)
{}
~GitFilterSource();
struct RepoBaton {
int error_code;
const git_error* error;
git_repository * out;
const git_filter_source * src;
};
class RepoWorker : public Nan::AsyncWorker {
public:
RepoWorker(
RepoBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~RepoWorker() {};
void Execute();
void HandleOKCallback();
private:
RepoBaton *baton;
};
static NAN_METHOD(Repo);
static NAN_METHOD(Path);
static NAN_METHOD(Filemode);
static NAN_METHOD(Id);
static NAN_METHOD(Mode);
static NAN_METHOD(Flags);
};
#endif
+23
View File
@@ -0,0 +1,23 @@
#include <v8.h>
#include <string.h>
#include "git2.h"
#ifndef COPY_FUNCTIONS
#define COPY_FUNCTIONS
const git_error *git_error_dup(const git_error *arg);
const git_oid *git_oid_dup(const git_oid *arg);
const git_index_entry *git_index_entry_dup(const git_index_entry *arg);
const git_index_time *git_index_time_dup(const git_index_time *arg);
const git_time *git_time_dup(const git_time *arg);
const git_diff_delta *git_diff_delta_dup(const git_diff_delta *arg);
const git_diff_file *git_diff_file_dup(const git_diff_file *arg);
git_remote_head *git_remote_head_dup(const git_remote_head *src);
void git_time_dup(git_time **out, const git_time *arg);
void git_transfer_progress_dup(git_transfer_progress **out, const git_transfer_progress *arg);
#endif
+12
View File
@@ -0,0 +1,12 @@
#include <v8.h>
#include <string.h>
#include "git2.h"
#ifndef NODEGIT_FREE_FUNCTIONS
#define NODEGIT_FREE_FUNCTIONS
void git_remote_head_free(git_remote_head *remote_head);
#endif
+16
View File
@@ -0,0 +1,16 @@
#ifndef STR_ARRAY_H
#define STR_ARRAY_H
#include <v8.h>
#include "nan.h"
#include "git2/buffer.h"
using namespace v8;
class GitBufConverter {
public:
static git_buf *Convert(v8::Local<v8::Value> val);
};
#endif
+95
View File
@@ -0,0 +1,95 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITGRAPH_H
#define GITGRAPH_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
#include "../include/oid.h"
using namespace node;
using namespace v8;
class GitGraph : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
struct AheadBehindBaton {
int error_code;
const git_error* error;
size_t * ahead;
size_t * behind;
git_repository * repo;
const git_oid * local;
bool localNeedsFree;
const git_oid * upstream;
bool upstreamNeedsFree;
};
class AheadBehindWorker : public Nan::AsyncWorker {
public:
AheadBehindWorker(
AheadBehindBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AheadBehindWorker() {};
void Execute();
void HandleOKCallback();
private:
AheadBehindBaton *baton;
};
static NAN_METHOD(AheadBehind);
struct DescendantOfBaton {
int error_code;
const git_error* error;
git_repository * repo;
const git_oid * commit;
bool commitNeedsFree;
const git_oid * ancestor;
bool ancestorNeedsFree;
};
class DescendantOfWorker : public Nan::AsyncWorker {
public:
DescendantOfWorker(
DescendantOfBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~DescendantOfWorker() {};
void Execute();
void HandleOKCallback();
private:
DescendantOfBaton *baton;
};
static NAN_METHOD(DescendantOf);
};
#endif
+122
View File
@@ -0,0 +1,122 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITHASHSIG_H
#define GITHASHSIG_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
#include <git2/sys/hashsig.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitHashsig;
struct GitHashsigTraits {
typedef GitHashsig cppClass;
typedef git_hashsig cType;
static const bool isDuplicable = false;
static void duplicate(git_hashsig **dest, git_hashsig *src) {
Nan::ThrowError("duplicate called on GitHashsig which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_hashsig *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_hashsig_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitHashsig : public
NodeGitWrapper<GitHashsigTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitHashsigTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitHashsig()
: NodeGitWrapper<GitHashsigTraits>(
"A new GitHashsig cannot be instantiated."
)
{}
GitHashsig(git_hashsig *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitHashsigTraits>(raw, selfFreeing, owner)
{}
~GitHashsig();
static NAN_METHOD(Compare);
struct CreateBaton {
int error_code;
const git_error* error;
git_hashsig * out;
const char * buf;
size_t buflen;
git_hashsig_option_t opts;
};
class CreateWorker : public Nan::AsyncWorker {
public:
CreateWorker(
CreateBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateBaton *baton;
};
static NAN_METHOD(Create);
struct CreateFromfileBaton {
int error_code;
const git_error* error;
git_hashsig * out;
const char * path;
git_hashsig_option_t opts;
};
class CreateFromfileWorker : public Nan::AsyncWorker {
public:
CreateFromfileWorker(
CreateFromfileBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateFromfileWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateFromfileBaton *baton;
};
static NAN_METHOD(CreateFromfile);
};
#endif
+68
View File
@@ -0,0 +1,68 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITIGNORE_H
#define GITIGNORE_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
using namespace node;
using namespace v8;
class GitIgnore : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
static NAN_METHOD(AddRule);
static NAN_METHOD(ClearInternalRules);
struct PathIsIgnoredBaton {
int error_code;
const git_error* error;
int * ignored;
git_repository * repo;
const char * path;
};
class PathIsIgnoredWorker : public Nan::AsyncWorker {
public:
PathIsIgnoredWorker(
PathIsIgnoredBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~PathIsIgnoredWorker() {};
void Execute();
void HandleOKCallback();
private:
PathIsIgnoredBaton *baton;
};
static NAN_METHOD(PathIsIgnored);
};
#endif
+699
View File
@@ -0,0 +1,699 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITINDEX_H
#define GITINDEX_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/str_array_converter.h"
#include "../include/index_entry.h"
#include "../include/strarray.h"
#include "../include/oid.h"
#include "../include/tree.h"
#include "../include/repository.h"
// Forward declaration.
struct git_index {
};
using namespace node;
using namespace v8;
class GitIndex;
struct GitIndexTraits {
typedef GitIndex cppClass;
typedef git_index cType;
static const bool isDuplicable = false;
static void duplicate(git_index **dest, git_index *src) {
Nan::ThrowError("duplicate called on GitIndex which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_index *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_index_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitIndex : public
NodeGitWrapper<GitIndexTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitIndexTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
static int AddAll_callback_cppCallback (
const char * path
,
const char * matched_pathspec
,
void * payload
);
static void AddAll_callback_async(void *baton);
static void AddAll_callback_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct AddAll_CallbackBaton : public AsyncBatonWithResult<int> {
const char * path;
const char * matched_pathspec;
void * payload;
AddAll_CallbackBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static int RemoveAll_callback_cppCallback (
const char * path
,
const char * matched_pathspec
,
void * payload
);
static void RemoveAll_callback_async(void *baton);
static void RemoveAll_callback_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct RemoveAll_CallbackBaton : public AsyncBatonWithResult<int> {
const char * path;
const char * matched_pathspec;
void * payload;
RemoveAll_CallbackBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static int UpdateAll_callback_cppCallback (
const char * path
,
const char * matched_pathspec
,
void * payload
);
static void UpdateAll_callback_async(void *baton);
static void UpdateAll_callback_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct UpdateAll_CallbackBaton : public AsyncBatonWithResult<int> {
const char * path;
const char * matched_pathspec;
void * payload;
UpdateAll_CallbackBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
private:
GitIndex()
: NodeGitWrapper<GitIndexTraits>(
"A new GitIndex cannot be instantiated."
)
{}
GitIndex(git_index *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitIndexTraits>(raw, selfFreeing, owner)
{}
~GitIndex();
struct AddBaton {
int error_code;
const git_error* error;
git_index * index;
const git_index_entry * source_entry;
};
class AddWorker : public Nan::AsyncWorker {
public:
AddWorker(
AddBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AddWorker() {};
void Execute();
void HandleOKCallback();
private:
AddBaton *baton;
};
static NAN_METHOD(Add);
struct AddAllBaton {
int error_code;
const git_error* error;
git_index * index;
const git_strarray * pathspec;
unsigned int flags;
git_index_matched_path_cb callback;
void * payload;
};
class AddAllWorker : public Nan::AsyncWorker {
public:
AddAllWorker(
AddAllBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AddAllWorker() {};
void Execute();
void HandleOKCallback();
private:
AddAllBaton *baton;
};
static NAN_METHOD(AddAll);
struct AddBypathBaton {
int error_code;
const git_error* error;
git_index * index;
const char * path;
};
class AddBypathWorker : public Nan::AsyncWorker {
public:
AddBypathWorker(
AddBypathBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AddBypathWorker() {};
void Execute();
void HandleOKCallback();
private:
AddBypathBaton *baton;
};
static NAN_METHOD(AddBypath);
static NAN_METHOD(Caps);
static NAN_METHOD(Checksum);
struct ClearBaton {
int error_code;
const git_error* error;
git_index * index;
};
class ClearWorker : public Nan::AsyncWorker {
public:
ClearWorker(
ClearBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ClearWorker() {};
void Execute();
void HandleOKCallback();
private:
ClearBaton *baton;
};
static NAN_METHOD(Clear);
struct ConflictAddBaton {
int error_code;
const git_error* error;
git_index * index;
const git_index_entry * ancestor_entry;
const git_index_entry * our_entry;
const git_index_entry * their_entry;
};
class ConflictAddWorker : public Nan::AsyncWorker {
public:
ConflictAddWorker(
ConflictAddBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ConflictAddWorker() {};
void Execute();
void HandleOKCallback();
private:
ConflictAddBaton *baton;
};
static NAN_METHOD(ConflictAdd);
struct ConflictCleanupBaton {
int error_code;
const git_error* error;
git_index * index;
};
class ConflictCleanupWorker : public Nan::AsyncWorker {
public:
ConflictCleanupWorker(
ConflictCleanupBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ConflictCleanupWorker() {};
void Execute();
void HandleOKCallback();
private:
ConflictCleanupBaton *baton;
};
static NAN_METHOD(ConflictCleanup);
struct ConflictGetBaton {
int error_code;
const git_error* error;
const git_index_entry * ancestor_out;
const git_index_entry * our_out;
const git_index_entry * their_out;
git_index * index;
const char * path;
};
class ConflictGetWorker : public Nan::AsyncWorker {
public:
ConflictGetWorker(
ConflictGetBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ConflictGetWorker() {};
void Execute();
void HandleOKCallback();
private:
ConflictGetBaton *baton;
};
static NAN_METHOD(ConflictGet);
struct ConflictRemoveBaton {
int error_code;
const git_error* error;
git_index * index;
const char * path;
};
class ConflictRemoveWorker : public Nan::AsyncWorker {
public:
ConflictRemoveWorker(
ConflictRemoveBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ConflictRemoveWorker() {};
void Execute();
void HandleOKCallback();
private:
ConflictRemoveBaton *baton;
};
static NAN_METHOD(ConflictRemove);
static NAN_METHOD(EntryIsConflict);
static NAN_METHOD(EntryStage);
static NAN_METHOD(Entrycount);
struct FindBaton {
int error_code;
const git_error* error;
size_t * at_pos;
git_index * index;
const char * path;
};
class FindWorker : public Nan::AsyncWorker {
public:
FindWorker(
FindBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FindWorker() {};
void Execute();
void HandleOKCallback();
private:
FindBaton *baton;
};
static NAN_METHOD(Find);
struct FindPrefixBaton {
int error_code;
const git_error* error;
size_t * at_pos;
git_index * index;
const char * prefix;
};
class FindPrefixWorker : public Nan::AsyncWorker {
public:
FindPrefixWorker(
FindPrefixBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FindPrefixWorker() {};
void Execute();
void HandleOKCallback();
private:
FindPrefixBaton *baton;
};
static NAN_METHOD(FindPrefix);
static NAN_METHOD(GetByindex);
static NAN_METHOD(GetBypath);
static NAN_METHOD(HasConflicts);
struct OpenBaton {
int error_code;
const git_error* error;
git_index * out;
const char * index_path;
};
class OpenWorker : public Nan::AsyncWorker {
public:
OpenWorker(
OpenBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~OpenWorker() {};
void Execute();
void HandleOKCallback();
private:
OpenBaton *baton;
};
static NAN_METHOD(Open);
static NAN_METHOD(Path);
struct ReadBaton {
int error_code;
const git_error* error;
git_index * index;
int force;
};
class ReadWorker : public Nan::AsyncWorker {
public:
ReadWorker(
ReadBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ReadWorker() {};
void Execute();
void HandleOKCallback();
private:
ReadBaton *baton;
};
static NAN_METHOD(Read);
struct ReadTreeBaton {
int error_code;
const git_error* error;
git_index * index;
const git_tree * tree;
};
class ReadTreeWorker : public Nan::AsyncWorker {
public:
ReadTreeWorker(
ReadTreeBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ReadTreeWorker() {};
void Execute();
void HandleOKCallback();
private:
ReadTreeBaton *baton;
};
static NAN_METHOD(ReadTree);
struct RemoveBaton {
int error_code;
const git_error* error;
git_index * index;
const char * path;
int stage;
};
class RemoveWorker : public Nan::AsyncWorker {
public:
RemoveWorker(
RemoveBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~RemoveWorker() {};
void Execute();
void HandleOKCallback();
private:
RemoveBaton *baton;
};
static NAN_METHOD(Remove);
struct RemoveAllBaton {
int error_code;
const git_error* error;
git_index * index;
const git_strarray * pathspec;
git_index_matched_path_cb callback;
void * payload;
};
class RemoveAllWorker : public Nan::AsyncWorker {
public:
RemoveAllWorker(
RemoveAllBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~RemoveAllWorker() {};
void Execute();
void HandleOKCallback();
private:
RemoveAllBaton *baton;
};
static NAN_METHOD(RemoveAll);
struct RemoveBypathBaton {
int error_code;
const git_error* error;
git_index * index;
const char * path;
};
class RemoveBypathWorker : public Nan::AsyncWorker {
public:
RemoveBypathWorker(
RemoveBypathBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~RemoveBypathWorker() {};
void Execute();
void HandleOKCallback();
private:
RemoveBypathBaton *baton;
};
static NAN_METHOD(RemoveBypath);
struct RemoveDirectoryBaton {
int error_code;
const git_error* error;
git_index * index;
const char * dir;
int stage;
};
class RemoveDirectoryWorker : public Nan::AsyncWorker {
public:
RemoveDirectoryWorker(
RemoveDirectoryBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~RemoveDirectoryWorker() {};
void Execute();
void HandleOKCallback();
private:
RemoveDirectoryBaton *baton;
};
static NAN_METHOD(RemoveDirectory);
static NAN_METHOD(SetCaps);
static NAN_METHOD(SetVersion);
struct UpdateAllBaton {
int error_code;
const git_error* error;
git_index * index;
const git_strarray * pathspec;
git_index_matched_path_cb callback;
void * payload;
};
class UpdateAllWorker : public Nan::AsyncWorker {
public:
UpdateAllWorker(
UpdateAllBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~UpdateAllWorker() {};
void Execute();
void HandleOKCallback();
private:
UpdateAllBaton *baton;
};
static NAN_METHOD(UpdateAll);
static NAN_METHOD(Version);
struct WriteBaton {
int error_code;
const git_error* error;
git_index * index;
};
class WriteWorker : public Nan::AsyncWorker {
public:
WriteWorker(
WriteBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~WriteWorker() {};
void Execute();
void HandleOKCallback();
private:
WriteBaton *baton;
};
static NAN_METHOD(Write);
struct WriteTreeBaton {
int error_code;
const git_error* error;
git_oid * out;
git_index * index;
};
class WriteTreeWorker : public Nan::AsyncWorker {
public:
WriteTreeWorker(
WriteTreeBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~WriteTreeWorker() {};
void Execute();
void HandleOKCallback();
private:
WriteTreeBaton *baton;
};
static NAN_METHOD(WriteTree);
struct WriteTreeToBaton {
int error_code;
const git_error* error;
git_oid * out;
git_index * index;
git_repository * repo;
};
class WriteTreeToWorker : public Nan::AsyncWorker {
public:
WriteTreeToWorker(
WriteTreeToBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~WriteTreeToWorker() {};
void Execute();
void HandleOKCallback();
private:
WriteTreeToBaton *baton;
};
static NAN_METHOD(WriteTreeTo);
struct AddAll_globalPayload {
Nan::Callback * callback;
AddAll_globalPayload() {
callback = NULL;
}
~AddAll_globalPayload() {
if (callback != NULL) {
delete callback;
}
}
};
struct RemoveAll_globalPayload {
Nan::Callback * callback;
RemoveAll_globalPayload() {
callback = NULL;
}
~RemoveAll_globalPayload() {
if (callback != NULL) {
delete callback;
}
}
};
struct UpdateAll_globalPayload {
Nan::Callback * callback;
UpdateAll_globalPayload() {
callback = NULL;
}
~UpdateAll_globalPayload() {
if (callback != NULL) {
delete callback;
}
}
};
};
#endif
+100
View File
@@ -0,0 +1,100 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITINDEXCONFLICTITERATOR_H
#define GITINDEXCONFLICTITERATOR_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/index.h"
#include "../include/index_entry.h"
// Forward declaration.
struct git_index_conflict_iterator {
};
using namespace node;
using namespace v8;
class GitIndexConflictIterator;
struct GitIndexConflictIteratorTraits {
typedef GitIndexConflictIterator cppClass;
typedef git_index_conflict_iterator cType;
static const bool isDuplicable = false;
static void duplicate(git_index_conflict_iterator **dest, git_index_conflict_iterator *src) {
Nan::ThrowError("duplicate called on GitIndexConflictIterator which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_index_conflict_iterator *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_index_conflict_iterator_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitIndexConflictIterator : public
NodeGitWrapper<GitIndexConflictIteratorTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitIndexConflictIteratorTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitIndexConflictIterator()
: NodeGitWrapper<GitIndexConflictIteratorTraits>(
"A new GitIndexConflictIterator cannot be instantiated."
)
{}
GitIndexConflictIterator(git_index_conflict_iterator *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitIndexConflictIteratorTraits>(raw, selfFreeing, owner)
{}
~GitIndexConflictIterator();
struct CreateBaton {
int error_code;
const git_error* error;
git_index_conflict_iterator * iterator_out;
git_index * index;
};
class CreateWorker : public Nan::AsyncWorker {
public:
CreateWorker(
CreateBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateBaton *baton;
};
static NAN_METHOD(Create);
static NAN_METHOD(Next);
};
#endif
+113
View File
@@ -0,0 +1,113 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITINDEXENTRY_H
#define GITINDEXENTRY_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
#include "../include/index_time.h"
#include "../include/oid.h"
using namespace node;
using namespace v8;
class GitIndexEntry;
struct GitIndexEntryTraits {
typedef GitIndexEntry cppClass;
typedef git_index_entry cType;
static const bool isDuplicable = false;
static void duplicate(git_index_entry **dest, git_index_entry *src) {
Nan::ThrowError("duplicate called on GitIndexEntry which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_index_entry *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitIndexEntry : public NodeGitWrapper<GitIndexEntryTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitIndexEntryTraits>;
public:
GitIndexEntry(git_index_entry* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitIndexEntry();
~GitIndexEntry();
void ConstructFields();
Nan::Persistent<Object> ctime;
static NAN_GETTER(GetCtime);
static NAN_SETTER(SetCtime);
Nan::Persistent<Object> mtime;
static NAN_GETTER(GetMtime);
static NAN_SETTER(SetMtime);
static NAN_GETTER(GetDev);
static NAN_SETTER(SetDev);
static NAN_GETTER(GetIno);
static NAN_SETTER(SetIno);
static NAN_GETTER(GetMode);
static NAN_SETTER(SetMode);
static NAN_GETTER(GetUid);
static NAN_SETTER(SetUid);
static NAN_GETTER(GetGid);
static NAN_SETTER(SetGid);
static NAN_GETTER(GetFileSize);
static NAN_SETTER(SetFileSize);
Nan::Persistent<Object> id;
static NAN_GETTER(GetId);
static NAN_SETTER(SetId);
static NAN_GETTER(GetFlags);
static NAN_SETTER(SetFlags);
static NAN_GETTER(GetFlagsExtended);
static NAN_SETTER(SetFlagsExtended);
static NAN_GETTER(GetPath);
static NAN_SETTER(SetPath);
};
#endif
+100
View File
@@ -0,0 +1,100 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITINDEXITERATOR_H
#define GITINDEXITERATOR_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/index.h"
#include "../include/index_entry.h"
// Forward declaration.
struct git_index_iterator {
};
using namespace node;
using namespace v8;
class GitIndexIterator;
struct GitIndexIteratorTraits {
typedef GitIndexIterator cppClass;
typedef git_index_iterator cType;
static const bool isDuplicable = false;
static void duplicate(git_index_iterator **dest, git_index_iterator *src) {
Nan::ThrowError("duplicate called on GitIndexIterator which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_index_iterator *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_index_iterator_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitIndexIterator : public
NodeGitWrapper<GitIndexIteratorTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitIndexIteratorTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitIndexIterator()
: NodeGitWrapper<GitIndexIteratorTraits>(
"A new GitIndexIterator cannot be instantiated."
)
{}
GitIndexIterator(git_index_iterator *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitIndexIteratorTraits>(raw, selfFreeing, owner)
{}
~GitIndexIterator();
struct CreateBaton {
int error_code;
const git_error* error;
git_index_iterator * iterator_out;
git_index * index;
};
class CreateWorker : public Nan::AsyncWorker {
public:
CreateWorker(
CreateBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateBaton *baton;
};
static NAN_METHOD(Create);
static NAN_METHOD(Next);
};
#endif
+126
View File
@@ -0,0 +1,126 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITINDEXNAMEENTRY_H
#define GITINDEXNAMEENTRY_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
#include <git2/sys/index.h>
}
#include "../include/typedefs.h"
#include "../include/index.h"
using namespace node;
using namespace v8;
class GitIndexNameEntry;
struct GitIndexNameEntryTraits {
typedef GitIndexNameEntry cppClass;
typedef git_index_name_entry cType;
static const bool isDuplicable = false;
static void duplicate(git_index_name_entry **dest, git_index_name_entry *src) {
Nan::ThrowError("duplicate called on GitIndexNameEntry which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_index_name_entry *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitIndexNameEntry : public
NodeGitWrapper<GitIndexNameEntryTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitIndexNameEntryTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitIndexNameEntry()
: NodeGitWrapper<GitIndexNameEntryTraits>(
"A new GitIndexNameEntry cannot be instantiated."
)
{}
GitIndexNameEntry(git_index_name_entry *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitIndexNameEntryTraits>(raw, selfFreeing, owner)
{}
~GitIndexNameEntry();
static NAN_METHOD(Ancestor);
static NAN_METHOD(Ours);
static NAN_METHOD(Theirs);
struct AddBaton {
int error_code;
const git_error* error;
git_index * index;
const char * ancestor;
const char * ours;
const char * theirs;
};
class AddWorker : public Nan::AsyncWorker {
public:
AddWorker(
AddBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AddWorker() {};
void Execute();
void HandleOKCallback();
private:
AddBaton *baton;
};
static NAN_METHOD(Add);
struct ClearBaton {
int error_code;
const git_error* error;
git_index * index;
};
class ClearWorker : public Nan::AsyncWorker {
public:
ClearWorker(
ClearBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ClearWorker() {};
void Execute();
void HandleOKCallback();
private:
ClearBaton *baton;
};
static NAN_METHOD(Clear);
static NAN_METHOD(Entrycount);
static NAN_METHOD(GetByIndex);
};
#endif
+183
View File
@@ -0,0 +1,183 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITINDEXREUCENTRY_H
#define GITINDEXREUCENTRY_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
#include <git2/sys/index.h>
}
#include "../include/typedefs.h"
#include "../include/oid.h"
#include "../include/index.h"
using namespace node;
using namespace v8;
class GitIndexReucEntry;
struct GitIndexReucEntryTraits {
typedef GitIndexReucEntry cppClass;
typedef git_index_reuc_entry cType;
static const bool isDuplicable = false;
static void duplicate(git_index_reuc_entry **dest, git_index_reuc_entry *src) {
Nan::ThrowError("duplicate called on GitIndexReucEntry which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_index_reuc_entry *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitIndexReucEntry : public
NodeGitWrapper<GitIndexReucEntryTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitIndexReucEntryTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitIndexReucEntry()
: NodeGitWrapper<GitIndexReucEntryTraits>(
"A new GitIndexReucEntry cannot be instantiated."
)
{}
GitIndexReucEntry(git_index_reuc_entry *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitIndexReucEntryTraits>(raw, selfFreeing, owner)
{}
~GitIndexReucEntry();
static NAN_METHOD(Mode);
static NAN_METHOD(Oid);
static NAN_METHOD(Path);
struct AddBaton {
int error_code;
const git_error* error;
git_index * index;
const char * path;
int ancestor_mode;
const git_oid * ancestor_id;
bool ancestor_idNeedsFree;
int our_mode;
const git_oid * our_id;
bool our_idNeedsFree;
int their_mode;
const git_oid * their_id;
bool their_idNeedsFree;
};
class AddWorker : public Nan::AsyncWorker {
public:
AddWorker(
AddBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AddWorker() {};
void Execute();
void HandleOKCallback();
private:
AddBaton *baton;
};
static NAN_METHOD(Add);
struct ClearBaton {
int error_code;
const git_error* error;
git_index * index;
};
class ClearWorker : public Nan::AsyncWorker {
public:
ClearWorker(
ClearBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ClearWorker() {};
void Execute();
void HandleOKCallback();
private:
ClearBaton *baton;
};
static NAN_METHOD(Clear);
static NAN_METHOD(Entrycount);
struct FindBaton {
int error_code;
const git_error* error;
size_t * at_pos;
git_index * index;
const char * path;
};
class FindWorker : public Nan::AsyncWorker {
public:
FindWorker(
FindBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FindWorker() {};
void Execute();
void HandleOKCallback();
private:
FindBaton *baton;
};
static NAN_METHOD(Find);
static NAN_METHOD(GetByIndex);
static NAN_METHOD(GetByPath);
struct RemoveBaton {
int error_code;
const git_error* error;
git_index * index;
size_t n;
};
class RemoveWorker : public Nan::AsyncWorker {
public:
RemoveWorker(
RemoveBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~RemoveWorker() {};
void Execute();
void HandleOKCallback();
private:
RemoveBaton *baton;
};
static NAN_METHOD(Remove);
};
#endif
+72
View File
@@ -0,0 +1,72 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITINDEXTIME_H
#define GITINDEXTIME_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitIndexTime;
struct GitIndexTimeTraits {
typedef GitIndexTime cppClass;
typedef git_index_time cType;
static const bool isDuplicable = false;
static void duplicate(git_index_time **dest, git_index_time *src) {
Nan::ThrowError("duplicate called on GitIndexTime which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_index_time *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitIndexTime : public
NodeGitWrapper<GitIndexTimeTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitIndexTimeTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitIndexTime()
: NodeGitWrapper<GitIndexTimeTraits>(
"A new GitIndexTime cannot be instantiated."
)
{}
GitIndexTime(git_index_time *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitIndexTimeTraits>(raw, selfFreeing, owner)
{}
~GitIndexTime();
static NAN_METHOD(Seconds);
static NAN_METHOD(Nanoseconds);
};
#endif
+77
View File
@@ -0,0 +1,77 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITINDEXERPROGRESS_H
#define GITINDEXERPROGRESS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitIndexerProgress;
struct GitIndexerProgressTraits {
typedef GitIndexerProgress cppClass;
typedef git_indexer_progress cType;
static const bool isDuplicable = false;
static void duplicate(git_indexer_progress **dest, git_indexer_progress *src) {
Nan::ThrowError("duplicate called on GitIndexerProgress which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_indexer_progress *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitIndexerProgress : public
NodeGitWrapper<GitIndexerProgressTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitIndexerProgressTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitIndexerProgress()
: NodeGitWrapper<GitIndexerProgressTraits>(
"A new GitIndexerProgress cannot be instantiated."
)
{}
GitIndexerProgress(git_indexer_progress *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitIndexerProgressTraits>(raw, selfFreeing, owner)
{}
~GitIndexerProgress();
static NAN_METHOD(TotalObjects);
static NAN_METHOD(IndexedObjects);
static NAN_METHOD(ReceivedObjects);
static NAN_METHOD(LocalObjects);
static NAN_METHOD(TotalDeltas);
static NAN_METHOD(IndexedDeltas);
static NAN_METHOD(ReceivedBytes);
};
#endif
+6
View File
@@ -0,0 +1,6 @@
#ifndef INIT_SSH2
#define INIT_SSH2
void init_ssh2();
#endif
+49
View File
@@ -0,0 +1,49 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITLIBGIT2_H
#define GITLIBGIT2_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitLibgit2 : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
static NAN_METHOD(Features);
static NAN_METHOD(Init);
static NAN_METHOD(Opts);
static NAN_METHOD(Shutdown);
static NAN_METHOD(Version);
};
#endif
+201
View File
@@ -0,0 +1,201 @@
#ifndef LOCK_MASTER_H
#define LOCK_MASTER_H
#include <git2.h>
class LockMasterImpl;
class LockMaster {
public:
enum Status {
Disabled = 0,
EnabledForAsyncOnly,
Enabled
};
private:
static Status status;
LockMasterImpl *impl;
template<typename T>
void AddLocks(const T *t) {
// by default, don't lock anything
}
// base case for variadic template unwinding
void AddParameters() {
}
// processes a single parameter, then calls recursively on the rest
template<typename T, typename... Types>
void AddParameters(const T *t, const Types*... args) {
if(t) {
AddLocks(t);
}
AddParameters(args...);
}
void ConstructorImpl();
void DestructorImpl();
void ObjectToLock(const void *);
void ObjectsToLockAdded();
public:
// we lock on construction
template<typename ...Types> LockMaster(bool asyncAction, const Types*... types) {
if((status == Disabled) || ((status == EnabledForAsyncOnly) && !asyncAction)) {
impl = NULL;
return;
}
ConstructorImpl();
AddParameters(types...);
ObjectsToLockAdded();
}
// and unlock on destruction
~LockMaster() {
if(!impl) {
return;
}
DestructorImpl();
}
// TemporaryUnlock unlocks the LockMaster currently registered on the thread,
// and re-locks it on destruction.
class TemporaryUnlock {
LockMasterImpl *impl;
void ConstructorImpl();
void DestructorImpl();
public:
TemporaryUnlock() {
// We can't return here if disabled
// It's possible that a LockMaster was fully constructed and registered
// before the thread safety was disabled.
// So we rely on ConstructorImpl to abort if there is no registered LockMaster
ConstructorImpl();
}
~TemporaryUnlock() {
if(!impl) {
return;
}
DestructorImpl();
}
};
static void Initialize();
// Enables the thread safety system
static void Enable() {
status = Enabled;
}
static void SetStatus(Status status) {
LockMaster::status = status;
}
static void Disable() {
status = Disabled;
}
static Status GetStatus() {
return status;
}
// Diagnostic information that can be provided to the JavaScript layer
// for a minimal level of testing
struct Diagnostics {
// this counts all stored mutexes - even if they are unlocked:
int storedMutexesCount;
};
static Diagnostics GetDiagnostics();
};
template<> inline void LockMaster::AddLocks(const git_repository *repo) {
// when using a repo, lock the repo
ObjectToLock(repo);
}
template<> inline void LockMaster::AddLocks(const git_index *index) {
// when using an index, lock the repo, or if there isn't one lock the index
const void *owner = git_index_owner(index);
if(!owner) {
owner = index;
}
ObjectToLock(owner);
}
template<> inline void LockMaster::AddLocks(const git_commit *commit) {
// when using a commit, lock the repo
const void *owner = git_commit_owner(commit);
ObjectToLock(owner);
}
// ... more locking rules would go here. According to an analysis of idefs.json,
// the following types are passed as non-const * and may require locking
// (some likely, some probably not):
// 'git_annotated_commit',
// 'git_blame_options',
// 'git_blob',
// 'git_buf',
// 'git_checkout_options',
// 'git_cherrypick_options',
// 'git_clone_options',
// 'git_commit',
// 'git_config',
// 'git_diff',
// 'git_diff_perfdata',
// 'git_error',
// 'git_fetch_options',
// 'git_fetch_options',
// 'git_filter',
// 'git_filter_list',
// 'git_hashsig',
// 'git_index',
// 'git_merge_file_input',
// 'git_merge_options',
// 'git_merge_options',
// 'git_note',
// 'git_note_iterator',
// 'git_object',
// 'git_odb',
// 'git_odb_object',
// 'git_oid',
// 'git_oidarray',
// 'git_packbuilder',
// 'git_patch',
// 'git_pathspec',
// 'git_push_options',
// 'git_rebase',
// 'git_rebase_options',
// 'git_refdb',
// 'git_reference',
// 'git_reflog',
// 'git_remote',
// 'git_remote_callbacks',
// 'git_remote_callbacks',
// 'git_repository',
// 'git_repository_init_options',
// 'git_revwalk',
// 'git_signature',
// 'git_stash_apply_options',
// 'git_status_list',
// 'git_strarray',
// 'git_submodule',
// 'git_submodule_update_options',
// 'git_tag',
// 'git_transfer_progress',
// 'git_transport',
// 'git_tree',
// 'git_treebuilder',
// 'git_writestream'
//
// Other types are always passed as const * and perhaps don't require locking
// (it's not a guarantee though)
#endif
+220
View File
@@ -0,0 +1,220 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITMAILMAP_H
#define GITMAILMAP_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
#include "../include/signature.h"
// Forward declaration.
struct git_mailmap {
};
using namespace node;
using namespace v8;
class GitMailmap;
struct GitMailmapTraits {
typedef GitMailmap cppClass;
typedef git_mailmap cType;
static const bool isDuplicable = false;
static void duplicate(git_mailmap **dest, git_mailmap *src) {
Nan::ThrowError("duplicate called on GitMailmap which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_mailmap *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_mailmap_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitMailmap : public
NodeGitWrapper<GitMailmapTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitMailmapTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitMailmap()
: NodeGitWrapper<GitMailmapTraits>(
"A new GitMailmap cannot be instantiated."
)
{}
GitMailmap(git_mailmap *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitMailmapTraits>(raw, selfFreeing, owner)
{}
~GitMailmap();
struct AddEntryBaton {
int error_code;
const git_error* error;
git_mailmap * mm;
const char * real_name;
const char * real_email;
const char * replace_name;
const char * replace_email;
};
class AddEntryWorker : public Nan::AsyncWorker {
public:
AddEntryWorker(
AddEntryBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AddEntryWorker() {};
void Execute();
void HandleOKCallback();
private:
AddEntryBaton *baton;
};
static NAN_METHOD(AddEntry);
struct FromBufferBaton {
int error_code;
const git_error* error;
git_mailmap * out;
const char * buf;
size_t len;
};
class FromBufferWorker : public Nan::AsyncWorker {
public:
FromBufferWorker(
FromBufferBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FromBufferWorker() {};
void Execute();
void HandleOKCallback();
private:
FromBufferBaton *baton;
};
static NAN_METHOD(FromBuffer);
struct FromRepositoryBaton {
int error_code;
const git_error* error;
git_mailmap * out;
git_repository * repo;
};
class FromRepositoryWorker : public Nan::AsyncWorker {
public:
FromRepositoryWorker(
FromRepositoryBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~FromRepositoryWorker() {};
void Execute();
void HandleOKCallback();
private:
FromRepositoryBaton *baton;
};
static NAN_METHOD(FromRepository);
struct CreateBaton {
int error_code;
const git_error* error;
git_mailmap * out;
};
class CreateWorker : public Nan::AsyncWorker {
public:
CreateWorker(
CreateBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateBaton *baton;
};
static NAN_METHOD(Create);
struct ResolveBaton {
int error_code;
const git_error* error;
const char * real_name;
const char * real_email;
const git_mailmap * mm;
const char * name;
const char * email;
};
class ResolveWorker : public Nan::AsyncWorker {
public:
ResolveWorker(
ResolveBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ResolveWorker() {};
void Execute();
void HandleOKCallback();
private:
ResolveBaton *baton;
};
static NAN_METHOD(Resolve);
struct ResolveSignatureBaton {
int error_code;
const git_error* error;
git_signature * out;
const git_mailmap * mm;
const git_signature * sig;
};
class ResolveSignatureWorker : public Nan::AsyncWorker {
public:
ResolveSignatureWorker(
ResolveSignatureBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ResolveSignatureWorker() {};
void Execute();
void HandleOKCallback();
private:
ResolveSignatureBaton *baton;
};
static NAN_METHOD(ResolveSignature);
};
#endif
+235
View File
@@ -0,0 +1,235 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITMERGE_H
#define GITMERGE_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/repository.h"
#include "../include/annotated_commit.h"
#include "../include/merge_options.h"
#include "../include/checkout_options.h"
#include "../include/reference.h"
#include "../include/oid.h"
#include "../include/oidarray.h"
#include "../include/index.h"
#include "../include/commit.h"
#include "../include/tree.h"
using namespace node;
using namespace v8;
class GitMerge : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
struct MergeBaton {
int error_code;
const git_error* error;
git_repository * repo;
const git_annotated_commit ** their_heads;
size_t their_heads_len;
git_merge_options * merge_opts;
git_checkout_options * checkout_opts;
};
class MergeWorker : public Nan::AsyncWorker {
public:
MergeWorker(
MergeBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~MergeWorker() {};
void Execute();
void HandleOKCallback();
private:
MergeBaton *baton;
};
static NAN_METHOD(Merge);
struct AnalysisBaton {
int error_code;
const git_error* error;
git_merge_analysis_t * analysis_out;
git_merge_preference_t * preference_out;
git_repository * repo;
const git_annotated_commit ** their_heads;
size_t their_heads_len;
};
class AnalysisWorker : public Nan::AsyncWorker {
public:
AnalysisWorker(
AnalysisBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AnalysisWorker() {};
void Execute();
void HandleOKCallback();
private:
AnalysisBaton *baton;
};
static NAN_METHOD(Analysis);
struct AnalysisForRefBaton {
int error_code;
const git_error* error;
git_merge_analysis_t * analysis_out;
git_merge_preference_t * preference_out;
git_repository * repo;
git_reference * our_ref;
const git_annotated_commit ** their_heads;
size_t their_heads_len;
};
class AnalysisForRefWorker : public Nan::AsyncWorker {
public:
AnalysisForRefWorker(
AnalysisForRefBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AnalysisForRefWorker() {};
void Execute();
void HandleOKCallback();
private:
AnalysisForRefBaton *baton;
};
static NAN_METHOD(AnalysisForRef);
struct BaseBaton {
int error_code;
const git_error* error;
git_oid * out;
git_repository * repo;
const git_oid * one;
bool oneNeedsFree;
const git_oid * two;
bool twoNeedsFree;
};
class BaseWorker : public Nan::AsyncWorker {
public:
BaseWorker(
BaseBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~BaseWorker() {};
void Execute();
void HandleOKCallback();
private:
BaseBaton *baton;
};
static NAN_METHOD(Base);
struct BasesBaton {
int error_code;
const git_error* error;
git_oidarray * out;
git_repository * repo;
const git_oid * one;
bool oneNeedsFree;
const git_oid * two;
bool twoNeedsFree;
};
class BasesWorker : public Nan::AsyncWorker {
public:
BasesWorker(
BasesBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~BasesWorker() {};
void Execute();
void HandleOKCallback();
private:
BasesBaton *baton;
};
static NAN_METHOD(Bases);
struct CommitsBaton {
int error_code;
const git_error* error;
git_index * out;
git_repository * repo;
const git_commit * our_commit;
const git_commit * their_commit;
const git_merge_options * opts;
};
class CommitsWorker : public Nan::AsyncWorker {
public:
CommitsWorker(
CommitsBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CommitsWorker() {};
void Execute();
void HandleOKCallback();
private:
CommitsBaton *baton;
};
static NAN_METHOD(Commits);
struct TreesBaton {
int error_code;
const git_error* error;
git_index * out;
git_repository * repo;
const git_tree * ancestor_tree;
const git_tree * our_tree;
const git_tree * their_tree;
const git_merge_options * opts;
};
class TreesWorker : public Nan::AsyncWorker {
public:
TreesWorker(
TreesBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~TreesWorker() {};
void Execute();
void HandleOKCallback();
private:
TreesBaton *baton;
};
static NAN_METHOD(Trees);
};
#endif
+80
View File
@@ -0,0 +1,80 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITMERGEFILEINPUT_H
#define GITMERGEFILEINPUT_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
using namespace node;
using namespace v8;
class GitMergeFileInput;
struct GitMergeFileInputTraits {
typedef GitMergeFileInput cppClass;
typedef git_merge_file_input cType;
static const bool isDuplicable = false;
static void duplicate(git_merge_file_input **dest, git_merge_file_input *src) {
Nan::ThrowError("duplicate called on GitMergeFileInput which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_merge_file_input *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitMergeFileInput : public NodeGitWrapper<GitMergeFileInputTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitMergeFileInputTraits>;
public:
GitMergeFileInput(git_merge_file_input* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitMergeFileInput();
~GitMergeFileInput();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetPtr);
static NAN_SETTER(SetPtr);
static NAN_GETTER(GetSize);
static NAN_SETTER(SetSize);
static NAN_GETTER(GetPath);
static NAN_SETTER(SetPath);
static NAN_GETTER(GetMode);
static NAN_SETTER(SetMode);
};
#endif
+88
View File
@@ -0,0 +1,88 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITMERGEFILEOPTIONS_H
#define GITMERGEFILEOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
using namespace node;
using namespace v8;
class GitMergeFileOptions;
struct GitMergeFileOptionsTraits {
typedef GitMergeFileOptions cppClass;
typedef git_merge_file_options cType;
static const bool isDuplicable = false;
static void duplicate(git_merge_file_options **dest, git_merge_file_options *src) {
Nan::ThrowError("duplicate called on GitMergeFileOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_merge_file_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitMergeFileOptions : public NodeGitWrapper<GitMergeFileOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitMergeFileOptionsTraits>;
public:
GitMergeFileOptions(git_merge_file_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitMergeFileOptions();
~GitMergeFileOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetAncestorLabel);
static NAN_SETTER(SetAncestorLabel);
static NAN_GETTER(GetOurLabel);
static NAN_SETTER(SetOurLabel);
static NAN_GETTER(GetTheirLabel);
static NAN_SETTER(SetTheirLabel);
static NAN_GETTER(GetFavor);
static NAN_SETTER(SetFavor);
static NAN_GETTER(GetFlags);
static NAN_SETTER(SetFlags);
static NAN_GETTER(GetMarkerSize);
static NAN_SETTER(SetMarkerSize);
};
#endif
+92
View File
@@ -0,0 +1,92 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITMERGEOPTIONS_H
#define GITMERGEOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
using namespace node;
using namespace v8;
class GitMergeOptions;
struct GitMergeOptionsTraits {
typedef GitMergeOptions cppClass;
typedef git_merge_options cType;
static const bool isDuplicable = false;
static void duplicate(git_merge_options **dest, git_merge_options *src) {
Nan::ThrowError("duplicate called on GitMergeOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_merge_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitMergeOptions : public NodeGitWrapper<GitMergeOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitMergeOptionsTraits>;
public:
GitMergeOptions(git_merge_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitMergeOptions();
~GitMergeOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetFlags);
static NAN_SETTER(SetFlags);
static NAN_GETTER(GetRenameThreshold);
static NAN_SETTER(SetRenameThreshold);
static NAN_GETTER(GetTargetLimit);
static NAN_SETTER(SetTargetLimit);
static NAN_GETTER(GetRecursionLimit);
static NAN_SETTER(SetRecursionLimit);
static NAN_GETTER(GetDefaultDriver);
static NAN_SETTER(SetDefaultDriver);
static NAN_GETTER(GetFileFavor);
static NAN_SETTER(SetFileFavor);
static NAN_GETTER(GetFileFlags);
static NAN_SETTER(SetFileFlags);
};
#endif
+15
View File
@@ -0,0 +1,15 @@
#ifndef NODEGIT_H
#define NODEGIT_H
#include "thread_pool.h"
extern ThreadPool libgit2ThreadPool;
v8::Local<v8::Value> GetPrivate(v8::Local<v8::Object> object,
v8::Local<v8::String> key);
void SetPrivate(v8::Local<v8::Object> object,
v8::Local<v8::String> key,
v8::Local<v8::Value> value);
#endif
+65
View File
@@ -0,0 +1,65 @@
#ifndef NODEGIT_WRAPPER_H
#define NODEGIT_WRAPPER_H
#include <nan.h>
#include <unordered_map>
// the Traits template parameter supplies:
// typename cppClass - the C++ type of the NodeGit wrapper (e.g. GitRepository)
// typename cType - the C type of the libgit2 object being wrapped (e.g. git_repository)
//
// static const bool isDuplicable
// static void duplicate(cType **dest, cType *src) - duplicates src using dupFunction or cpyFunction
//
// static const bool isFreeable
// static void free(cType *raw) - frees the object using freeFunctionName
template<typename Traits>
class NodeGitWrapper : public Nan::ObjectWrap {
public:
// replicate Traits typedefs for ease of use
typedef typename Traits::cType cType;
typedef typename Traits::cppClass cppClass;
// whether raw should be freed on destruction
// TODO: this should be protected but we have a few use cases that change this to
// false from the outside. I suspect it gets turned to false to avoid
// double-free problems in cases like when we pass cred objects to libgit2
// and it frees them. We should probably be NULLing raw in that case
// (and through a method) instead of changing selfFreeing, but that's
// a separate issue.
bool selfFreeing;
protected:
cType *raw;
// owner of the object, in the memory management sense. only populated
// when using ownedByThis, and the type doesn't have a dupFunction
// CopyablePersistentTraits are used to get the reset-on-destruct behavior.
Nan::Persistent<v8::Object, Nan::CopyablePersistentTraits<v8::Object> > owner;
static Nan::Persistent<v8::Function> constructor_template;
// diagnostic count of self-freeing object instances
static int SelfFreeingInstanceCount;
// diagnostic count of constructed non-self-freeing object instances
static int NonSelfFreeingConstructedCount;
static void InitializeTemplate(v8::Local<v8::FunctionTemplate> &tpl);
NodeGitWrapper(cType *raw, bool selfFreeing, v8::Local<v8::Object> owner);
NodeGitWrapper(const char *error); // calls ThrowError
~NodeGitWrapper();
static NAN_METHOD(JSNewFunction);
static NAN_METHOD(GetSelfFreeingInstanceCount);
static NAN_METHOD(GetNonSelfFreeingConstructedCount);
public:
static v8::Local<v8::Value> New(const cType *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
cType *GetValue();
void ClearValue();
};
#endif
+330
View File
@@ -0,0 +1,330 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITNOTE_H
#define GITNOTE_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/signature.h"
#include "../include/oid.h"
#include "../include/repository.h"
#include "../include/commit.h"
#include "../include/note_iterator.h"
#include "../include/buf.h"
// Forward declaration.
struct git_note {
};
using namespace node;
using namespace v8;
class GitNote;
struct GitNoteTraits {
typedef GitNote cppClass;
typedef git_note cType;
static const bool isDuplicable = false;
static void duplicate(git_note **dest, git_note *src) {
Nan::ThrowError("duplicate called on GitNote which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_note *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_note_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitNote : public
NodeGitWrapper<GitNoteTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitNoteTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
static int Foreach_note_cb_cppCallback (
const git_oid * blob_id
,
const git_oid * annotated_object_id
,
void * payload
);
static void Foreach_note_cb_async(void *baton);
static void Foreach_note_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct Foreach_NoteCbBaton : public AsyncBatonWithResult<int> {
const git_oid * blob_id;
const git_oid * annotated_object_id;
void * payload;
Foreach_NoteCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
private:
GitNote()
: NodeGitWrapper<GitNoteTraits>(
"A new GitNote cannot be instantiated."
)
{}
GitNote(git_note *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitNoteTraits>(raw, selfFreeing, owner)
{}
~GitNote();
static NAN_METHOD(Author);
static NAN_METHOD(CommitCreate);
struct CommitIteratorNewBaton {
int error_code;
const git_error* error;
git_note_iterator * out;
git_commit * notes_commit;
};
class CommitIteratorNewWorker : public Nan::AsyncWorker {
public:
CommitIteratorNewWorker(
CommitIteratorNewBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CommitIteratorNewWorker() {};
void Execute();
void HandleOKCallback();
private:
CommitIteratorNewBaton *baton;
};
static NAN_METHOD(CommitIteratorNew);
struct CommitReadBaton {
int error_code;
const git_error* error;
git_note * out;
git_repository * repo;
git_commit * notes_commit;
const git_oid * oid;
bool oidNeedsFree;
};
class CommitReadWorker : public Nan::AsyncWorker {
public:
CommitReadWorker(
CommitReadBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CommitReadWorker() {};
void Execute();
void HandleOKCallback();
private:
CommitReadBaton *baton;
};
static NAN_METHOD(CommitRead);
struct CommitRemoveBaton {
int error_code;
const git_error* error;
git_oid * notes_commit_out;
git_repository * repo;
git_commit * notes_commit;
const git_signature * author;
const git_signature * committer;
const git_oid * oid;
bool oidNeedsFree;
};
class CommitRemoveWorker : public Nan::AsyncWorker {
public:
CommitRemoveWorker(
CommitRemoveBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CommitRemoveWorker() {};
void Execute();
void HandleOKCallback();
private:
CommitRemoveBaton *baton;
};
static NAN_METHOD(CommitRemove);
static NAN_METHOD(Committer);
struct CreateBaton {
int error_code;
const git_error* error;
git_oid * out;
git_repository * repo;
const char * notes_ref;
const git_signature * author;
const git_signature * committer;
const git_oid * oid;
bool oidNeedsFree;
const char * note;
int force;
};
class CreateWorker : public Nan::AsyncWorker {
public:
CreateWorker(
CreateBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CreateWorker() {};
void Execute();
void HandleOKCallback();
private:
CreateBaton *baton;
};
static NAN_METHOD(Create);
struct DefaultRefBaton {
int error_code;
const git_error* error;
git_buf * out;
git_repository * repo;
};
class DefaultRefWorker : public Nan::AsyncWorker {
public:
DefaultRefWorker(
DefaultRefBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~DefaultRefWorker() {};
void Execute();
void HandleOKCallback();
private:
DefaultRefBaton *baton;
};
static NAN_METHOD(DefaultRef);
struct ForeachBaton {
int error_code;
const git_error* error;
git_repository * repo;
const char * notes_ref;
git_note_foreach_cb note_cb;
void * payload;
};
class ForeachWorker : public Nan::AsyncWorker {
public:
ForeachWorker(
ForeachBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ForeachWorker() {};
void Execute();
void HandleOKCallback();
private:
ForeachBaton *baton;
};
static NAN_METHOD(Foreach);
static NAN_METHOD(Id);
static NAN_METHOD(Message);
struct ReadBaton {
int error_code;
const git_error* error;
git_note * out;
git_repository * repo;
const char * notes_ref;
const git_oid * oid;
bool oidNeedsFree;
};
class ReadWorker : public Nan::AsyncWorker {
public:
ReadWorker(
ReadBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ReadWorker() {};
void Execute();
void HandleOKCallback();
private:
ReadBaton *baton;
};
static NAN_METHOD(Read);
struct RemoveBaton {
int error_code;
const git_error* error;
git_repository * repo;
const char * notes_ref;
const git_signature * author;
const git_signature * committer;
const git_oid * oid;
bool oidNeedsFree;
};
class RemoveWorker : public Nan::AsyncWorker {
public:
RemoveWorker(
RemoveBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~RemoveWorker() {};
void Execute();
void HandleOKCallback();
private:
RemoveBaton *baton;
};
static NAN_METHOD(Remove);
struct Foreach_globalPayload {
Nan::Callback * note_cb;
Foreach_globalPayload() {
note_cb = NULL;
}
~Foreach_globalPayload() {
if (note_cb != NULL) {
delete note_cb;
}
}
};
};
#endif
+70
View File
@@ -0,0 +1,70 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITNOTEITERATOR_H
#define GITNOTEITERATOR_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitNoteIterator;
struct GitNoteIteratorTraits {
typedef GitNoteIterator cppClass;
typedef git_note_iterator cType;
static const bool isDuplicable = false;
static void duplicate(git_note_iterator **dest, git_note_iterator *src) {
Nan::ThrowError("duplicate called on GitNoteIterator which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_note_iterator *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitNoteIterator : public
NodeGitWrapper<GitNoteIteratorTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitNoteIteratorTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitNoteIterator()
: NodeGitWrapper<GitNoteIteratorTraits>(
"A new GitNoteIterator cannot be instantiated."
)
{}
GitNoteIterator(git_note_iterator *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitNoteIteratorTraits>(raw, selfFreeing, owner)
{}
~GitNoteIterator();
};
#endif
+238
View File
@@ -0,0 +1,238 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITOBJECT_H
#define GITOBJECT_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/oid.h"
#include "../include/repository.h"
#include "../include/buf.h"
// Forward declaration.
struct git_object {
};
using namespace node;
using namespace v8;
class GitObject;
struct GitObjectTraits {
typedef GitObject cppClass;
typedef git_object cType;
static const bool isDuplicable = false;
static void duplicate(git_object **dest, git_object *src) {
Nan::ThrowError("duplicate called on GitObject which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_object *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_object_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitObject : public
NodeGitWrapper<GitObjectTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitObjectTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitObject()
: NodeGitWrapper<GitObjectTraits>(
"A new GitObject cannot be instantiated."
)
{}
GitObject(git_object *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitObjectTraits>(raw, selfFreeing, owner)
{}
~GitObject();
static NAN_METHOD(Size);
struct DupBaton {
int error_code;
const git_error* error;
git_object * dest;
git_object * source;
};
class DupWorker : public Nan::AsyncWorker {
public:
DupWorker(
DupBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~DupWorker() {};
void Execute();
void HandleOKCallback();
private:
DupBaton *baton;
};
static NAN_METHOD(Dup);
static NAN_METHOD(Id);
struct LookupBaton {
int error_code;
const git_error* error;
git_object * object;
git_repository * repo;
const git_oid * id;
bool idNeedsFree;
git_object_t type;
};
class LookupWorker : public Nan::AsyncWorker {
public:
LookupWorker(
LookupBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LookupWorker() {};
void Execute();
void HandleOKCallback();
private:
LookupBaton *baton;
};
static NAN_METHOD(Lookup);
struct LookupBypathBaton {
int error_code;
const git_error* error;
git_object * out;
const git_object * treeish;
const char * path;
git_object_t type;
};
class LookupBypathWorker : public Nan::AsyncWorker {
public:
LookupBypathWorker(
LookupBypathBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LookupBypathWorker() {};
void Execute();
void HandleOKCallback();
private:
LookupBypathBaton *baton;
};
static NAN_METHOD(LookupBypath);
struct LookupPrefixBaton {
int error_code;
const git_error* error;
git_object * object_out;
git_repository * repo;
const git_oid * id;
bool idNeedsFree;
size_t len;
git_object_t type;
};
class LookupPrefixWorker : public Nan::AsyncWorker {
public:
LookupPrefixWorker(
LookupPrefixBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~LookupPrefixWorker() {};
void Execute();
void HandleOKCallback();
private:
LookupPrefixBaton *baton;
};
static NAN_METHOD(LookupPrefix);
static NAN_METHOD(Owner);
struct PeelBaton {
int error_code;
const git_error* error;
git_object * peeled;
const git_object * object;
git_object_t target_type;
};
class PeelWorker : public Nan::AsyncWorker {
public:
PeelWorker(
PeelBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~PeelWorker() {};
void Execute();
void HandleOKCallback();
private:
PeelBaton *baton;
};
static NAN_METHOD(Peel);
struct ShortIdBaton {
int error_code;
const git_error* error;
git_buf * out;
const git_object * obj;
};
class ShortIdWorker : public Nan::AsyncWorker {
public:
ShortIdWorker(
ShortIdBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ShortIdWorker() {};
void Execute();
void HandleOKCallback();
private:
ShortIdBaton *baton;
};
static NAN_METHOD(ShortId);
static NAN_METHOD(String2type);
static NAN_METHOD(Type);
static NAN_METHOD(Type2string);
static NAN_METHOD(Typeisloose);
};
#endif
+248
View File
@@ -0,0 +1,248 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITODB_H
#define GITODB_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/oid.h"
#include "../include/odb_object.h"
// Forward declaration.
struct git_odb {
};
using namespace node;
using namespace v8;
class GitOdb;
struct GitOdbTraits {
typedef GitOdb cppClass;
typedef git_odb cType;
static const bool isDuplicable = false;
static void duplicate(git_odb **dest, git_odb *src) {
Nan::ThrowError("duplicate called on GitOdb which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_odb *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_odb_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitOdb : public
NodeGitWrapper<GitOdbTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitOdbTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitOdb()
: NodeGitWrapper<GitOdbTraits>(
"A new GitOdb cannot be instantiated."
)
{}
GitOdb(git_odb *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitOdbTraits>(raw, selfFreeing, owner)
{}
~GitOdb();
struct AddDiskAlternateBaton {
int error_code;
const git_error* error;
git_odb * odb;
const char * path;
};
class AddDiskAlternateWorker : public Nan::AsyncWorker {
public:
AddDiskAlternateWorker(
AddDiskAlternateBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AddDiskAlternateWorker() {};
void Execute();
void HandleOKCallback();
private:
AddDiskAlternateBaton *baton;
};
static NAN_METHOD(AddDiskAlternate);
struct ExistsPrefixBaton {
int error_code;
const git_error* error;
git_oid * out;
git_odb * db;
const git_oid * short_id;
bool short_idNeedsFree;
size_t len;
};
class ExistsPrefixWorker : public Nan::AsyncWorker {
public:
ExistsPrefixWorker(
ExistsPrefixBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ExistsPrefixWorker() {};
void Execute();
void HandleOKCallback();
private:
ExistsPrefixBaton *baton;
};
static NAN_METHOD(ExistsPrefix);
struct HashfileBaton {
int error_code;
const git_error* error;
git_oid * out;
const char * path;
git_object_t type;
};
class HashfileWorker : public Nan::AsyncWorker {
public:
HashfileWorker(
HashfileBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~HashfileWorker() {};
void Execute();
void HandleOKCallback();
private:
HashfileBaton *baton;
};
static NAN_METHOD(Hashfile);
struct OpenBaton {
int error_code;
const git_error* error;
git_odb * out;
const char * objects_dir;
};
class OpenWorker : public Nan::AsyncWorker {
public:
OpenWorker(
OpenBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~OpenWorker() {};
void Execute();
void HandleOKCallback();
private:
OpenBaton *baton;
};
static NAN_METHOD(Open);
struct OdbReadBaton {
int error_code;
const git_error* error;
git_odb_object * out;
git_odb * db;
const git_oid * id;
bool idNeedsFree;
};
class OdbReadWorker : public Nan::AsyncWorker {
public:
OdbReadWorker(
OdbReadBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~OdbReadWorker() {};
void Execute();
void HandleOKCallback();
private:
OdbReadBaton *baton;
};
static NAN_METHOD(OdbRead);
struct ReadPrefixBaton {
int error_code;
const git_error* error;
git_odb_object * out;
git_odb * db;
const git_oid * short_id;
bool short_idNeedsFree;
size_t len;
};
class ReadPrefixWorker : public Nan::AsyncWorker {
public:
ReadPrefixWorker(
ReadPrefixBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ReadPrefixWorker() {};
void Execute();
void HandleOKCallback();
private:
ReadPrefixBaton *baton;
};
static NAN_METHOD(ReadPrefix);
struct WriteBaton {
int error_code;
const git_error* error;
git_oid * out;
git_odb * odb;
const void * data;
size_t len;
git_object_t type;
};
class WriteWorker : public Nan::AsyncWorker {
public:
WriteWorker(
WriteBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~WriteWorker() {};
void Execute();
void HandleOKCallback();
private:
WriteBaton *baton;
};
static NAN_METHOD(Write);
};
#endif
+84
View File
@@ -0,0 +1,84 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITODBOBJECT_H
#define GITODBOBJECT_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/wrapper.h"
#include "node_buffer.h"
#include "../include/oid.h"
// Forward declaration.
struct git_odb_object {
};
using namespace node;
using namespace v8;
class GitOdbObject;
struct GitOdbObjectTraits {
typedef GitOdbObject cppClass;
typedef git_odb_object cType;
static const bool isDuplicable = false;
static void duplicate(git_odb_object **dest, git_odb_object *src) {
Nan::ThrowError("duplicate called on GitOdbObject which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_odb_object *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_odb_object_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitOdbObject : public
NodeGitWrapper<GitOdbObjectTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitOdbObjectTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitOdbObject()
: NodeGitWrapper<GitOdbObjectTraits>(
"A new GitOdbObject cannot be instantiated."
)
{}
GitOdbObject(git_odb_object *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitOdbObjectTraits>(raw, selfFreeing, owner)
{}
~GitOdbObject();
static NAN_METHOD(Data);
static NAN_METHOD(Id);
static NAN_METHOD(Size);
static NAN_METHOD(Type);
};
#endif
+92
View File
@@ -0,0 +1,92 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITOID_H
#define GITOID_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitOid;
struct GitOidTraits {
typedef GitOid cppClass;
typedef git_oid cType;
static const bool isDuplicable = true;
static void duplicate(git_oid **dest, git_oid *src) {
git_oid *copy = (git_oid *)malloc(sizeof(git_oid));
git_oid_cpy(copy, src);
*dest = copy;
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_oid *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitOid : public
NodeGitWrapper<GitOidTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitOidTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitOid()
: NodeGitWrapper<GitOidTraits>(
"A new GitOid cannot be instantiated."
)
{}
GitOid(git_oid *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitOidTraits>(raw, selfFreeing, owner)
{}
~GitOid();
static NAN_METHOD(Cmp);
static NAN_METHOD(Cpy);
static NAN_METHOD(Equal);
static NAN_METHOD(Fromstrp);
static NAN_METHOD(IsZero);
static NAN_METHOD(Iszero);
static NAN_METHOD(Ncmp);
static NAN_METHOD(Strcmp);
static NAN_METHOD(Streq);
static NAN_METHOD(TostrS);
};
#endif
+77
View File
@@ -0,0 +1,77 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITOIDSHORTEN_H
#define GITOIDSHORTEN_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
// Forward declaration.
struct git_oid_shorten {
};
using namespace node;
using namespace v8;
class GitOidShorten;
struct GitOidShortenTraits {
typedef GitOidShorten cppClass;
typedef git_oid_shorten cType;
static const bool isDuplicable = false;
static void duplicate(git_oid_shorten **dest, git_oid_shorten *src) {
Nan::ThrowError("duplicate called on GitOidShorten which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_oid_shorten *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_oid_shorten_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitOidShorten : public
NodeGitWrapper<GitOidShortenTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitOidShortenTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitOidShorten()
: NodeGitWrapper<GitOidShortenTraits>(
"A new GitOidShorten cannot be instantiated."
)
{}
GitOidShorten(git_oid_shorten *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitOidShortenTraits>(raw, selfFreeing, owner)
{}
~GitOidShorten();
static NAN_METHOD(Add);
static NAN_METHOD(Create);
};
#endif
+73
View File
@@ -0,0 +1,73 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITOIDARRAY_H
#define GITOIDARRAY_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/oid.h"
using namespace node;
using namespace v8;
class GitOidarray;
struct GitOidarrayTraits {
typedef GitOidarray cppClass;
typedef git_oidarray cType;
static const bool isDuplicable = false;
static void duplicate(git_oidarray **dest, git_oidarray *src) {
Nan::ThrowError("duplicate called on GitOidarray which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_oidarray *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_oidarray_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitOidarray : public
NodeGitWrapper<GitOidarrayTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitOidarrayTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitOidarray()
: NodeGitWrapper<GitOidarrayTraits>(
"A new GitOidarray cannot be instantiated."
)
{}
GitOidarray(git_oidarray *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitOidarrayTraits>(raw, selfFreeing, owner)
{}
~GitOidarray();
static NAN_METHOD(Ids);
static NAN_METHOD(Count);
};
#endif
+185
View File
@@ -0,0 +1,185 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITPACKBUILDER_H
#define GITPACKBUILDER_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/oid.h"
#include "../include/revwalk.h"
#include "../include/repository.h"
// Forward declaration.
struct git_packbuilder {
};
using namespace node;
using namespace v8;
class GitPackbuilder;
struct GitPackbuilderTraits {
typedef GitPackbuilder cppClass;
typedef git_packbuilder cType;
static const bool isDuplicable = false;
static void duplicate(git_packbuilder **dest, git_packbuilder *src) {
Nan::ThrowError("duplicate called on GitPackbuilder which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_packbuilder *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_packbuilder_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitPackbuilder : public
NodeGitWrapper<GitPackbuilderTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitPackbuilderTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitPackbuilder()
: NodeGitWrapper<GitPackbuilderTraits>(
"A new GitPackbuilder cannot be instantiated."
)
{}
GitPackbuilder(git_packbuilder *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitPackbuilderTraits>(raw, selfFreeing, owner)
{}
~GitPackbuilder();
static NAN_METHOD(Hash);
struct InsertBaton {
int error_code;
const git_error* error;
git_packbuilder * pb;
const git_oid * id;
bool idNeedsFree;
const char * name;
};
class InsertWorker : public Nan::AsyncWorker {
public:
InsertWorker(
InsertBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~InsertWorker() {};
void Execute();
void HandleOKCallback();
private:
InsertBaton *baton;
};
static NAN_METHOD(Insert);
struct InsertCommitBaton {
int error_code;
const git_error* error;
git_packbuilder * pb;
const git_oid * id;
bool idNeedsFree;
};
class InsertCommitWorker : public Nan::AsyncWorker {
public:
InsertCommitWorker(
InsertCommitBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~InsertCommitWorker() {};
void Execute();
void HandleOKCallback();
private:
InsertCommitBaton *baton;
};
static NAN_METHOD(InsertCommit);
struct InsertRecurBaton {
int error_code;
const git_error* error;
git_packbuilder * pb;
const git_oid * id;
bool idNeedsFree;
const char * name;
};
class InsertRecurWorker : public Nan::AsyncWorker {
public:
InsertRecurWorker(
InsertRecurBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~InsertRecurWorker() {};
void Execute();
void HandleOKCallback();
private:
InsertRecurBaton *baton;
};
static NAN_METHOD(InsertRecur);
static NAN_METHOD(InsertTree);
struct InsertWalkBaton {
int error_code;
const git_error* error;
git_packbuilder * pb;
git_revwalk * walk;
};
class InsertWalkWorker : public Nan::AsyncWorker {
public:
InsertWalkWorker(
InsertWalkBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~InsertWalkWorker() {};
void Execute();
void HandleOKCallback();
private:
InsertWalkBaton *baton;
};
static NAN_METHOD(InsertWalk);
static NAN_METHOD(Create);
static NAN_METHOD(ObjectCount);
static NAN_METHOD(SetThreads);
static NAN_METHOD(Written);
};
#endif
+214
View File
@@ -0,0 +1,214 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITPATCH_H
#define GITPATCH_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/convenient_patch.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;
struct GitPatchTraits {
typedef GitPatch cppClass;
typedef git_patch cType;
static const bool isDuplicable = false;
static void duplicate(git_patch **dest, git_patch *src) {
Nan::ThrowError("duplicate called on GitPatch which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_patch *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_patch_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitPatch : public
NodeGitWrapper<GitPatchTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitPatchTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitPatch()
: NodeGitWrapper<GitPatchTraits>(
"A new GitPatch cannot be instantiated."
)
{}
GitPatch(git_patch *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitPatchTraits>(raw, selfFreeing, owner)
{}
~GitPatch();
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(LineStats);
static NAN_METHOD(NumHunks);
static NAN_METHOD(NumLinesInHunk);
static NAN_METHOD(Size);
struct ConvenientFromDiffBaton {
int error_code;
const git_error* error;
git_diff * diff;
std::vector<PatchData*> * out;
};
class ConvenientFromDiffWorker : public Nan::AsyncWorker {
public:
ConvenientFromDiffWorker(
ConvenientFromDiffBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~ConvenientFromDiffWorker() {};
void Execute();
void HandleOKCallback();
private:
ConvenientFromDiffBaton *baton;
};
static NAN_METHOD(ConvenientFromDiff);
};
#endif
+42
View File
@@ -0,0 +1,42 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITPATH_H
#define GITPATH_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
#include <git2/sys/path.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitPath : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
static NAN_METHOD(IsGitfile);
};
#endif
+184
View File
@@ -0,0 +1,184 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITPATHSPEC_H
#define GITPATHSPEC_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/str_array_converter.h"
#include "../include/pathspec_match_list.h"
#include "../include/diff.h"
#include "../include/index.h"
#include "../include/tree.h"
#include "../include/repository.h"
#include "../include/strarray.h"
// Forward declaration.
struct git_pathspec {
};
using namespace node;
using namespace v8;
class GitPathspec;
struct GitPathspecTraits {
typedef GitPathspec cppClass;
typedef git_pathspec cType;
static const bool isDuplicable = false;
static void duplicate(git_pathspec **dest, git_pathspec *src) {
Nan::ThrowError("duplicate called on GitPathspec which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_pathspec *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_pathspec_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitPathspec : public
NodeGitWrapper<GitPathspecTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitPathspecTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitPathspec()
: NodeGitWrapper<GitPathspecTraits>(
"A new GitPathspec cannot be instantiated."
)
{}
GitPathspec(git_pathspec *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitPathspecTraits>(raw, selfFreeing, owner)
{}
~GitPathspec();
struct MatchDiffBaton {
int error_code;
const git_error* error;
git_pathspec_match_list * out;
git_diff * diff;
uint32_t flags;
git_pathspec * ps;
};
class MatchDiffWorker : public Nan::AsyncWorker {
public:
MatchDiffWorker(
MatchDiffBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~MatchDiffWorker() {};
void Execute();
void HandleOKCallback();
private:
MatchDiffBaton *baton;
};
static NAN_METHOD(MatchDiff);
struct MatchIndexBaton {
int error_code;
const git_error* error;
git_pathspec_match_list * out;
git_index * index;
uint32_t flags;
git_pathspec * ps;
};
class MatchIndexWorker : public Nan::AsyncWorker {
public:
MatchIndexWorker(
MatchIndexBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~MatchIndexWorker() {};
void Execute();
void HandleOKCallback();
private:
MatchIndexBaton *baton;
};
static NAN_METHOD(MatchIndex);
struct MatchTreeBaton {
int error_code;
const git_error* error;
git_pathspec_match_list * out;
git_tree * tree;
uint32_t flags;
git_pathspec * ps;
};
class MatchTreeWorker : public Nan::AsyncWorker {
public:
MatchTreeWorker(
MatchTreeBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~MatchTreeWorker() {};
void Execute();
void HandleOKCallback();
private:
MatchTreeBaton *baton;
};
static NAN_METHOD(MatchTree);
struct MatchWorkdirBaton {
int error_code;
const git_error* error;
git_pathspec_match_list * out;
git_repository * repo;
uint32_t flags;
git_pathspec * ps;
};
class MatchWorkdirWorker : public Nan::AsyncWorker {
public:
MatchWorkdirWorker(
MatchWorkdirBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~MatchWorkdirWorker() {};
void Execute();
void HandleOKCallback();
private:
MatchWorkdirBaton *baton;
};
static NAN_METHOD(MatchWorkdir);
static NAN_METHOD(MatchesPath);
static NAN_METHOD(Create);
};
#endif
+84
View File
@@ -0,0 +1,84 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITPATHSPECMATCHLIST_H
#define GITPATHSPECMATCHLIST_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/diff_delta.h"
// Forward declaration.
struct git_pathspec_match_list {
};
using namespace node;
using namespace v8;
class GitPathspecMatchList;
struct GitPathspecMatchListTraits {
typedef GitPathspecMatchList cppClass;
typedef git_pathspec_match_list cType;
static const bool isDuplicable = false;
static void duplicate(git_pathspec_match_list **dest, git_pathspec_match_list *src) {
Nan::ThrowError("duplicate called on GitPathspecMatchList which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_pathspec_match_list *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_pathspec_match_list_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitPathspecMatchList : public
NodeGitWrapper<GitPathspecMatchListTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitPathspecMatchListTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitPathspecMatchList()
: NodeGitWrapper<GitPathspecMatchListTraits>(
"A new GitPathspecMatchList cannot be instantiated."
)
{}
GitPathspecMatchList(git_pathspec_match_list *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitPathspecMatchListTraits>(raw, selfFreeing, owner)
{}
~GitPathspecMatchList();
static NAN_METHOD(DiffEntry);
static NAN_METHOD(Entry);
static NAN_METHOD(Entrycount);
static NAN_METHOD(FailedEntry);
static NAN_METHOD(FailedEntrycount);
};
#endif
+46
View File
@@ -0,0 +1,46 @@
#ifndef PROMISE_COMPLETION
#define PROMISE_COMPLETION
#include <nan.h>
#include "async_baton.h"
// PromiseCompletion forwards either the resolved result or the rejection reason
// to the native layer, once the promise completes
//
// inherits ObjectWrap so it can be used in v8 and managed by the garbage collector
// it isn't wired up to be instantiated or accessed from the JS layer other than
// for the purpose of promise result forwarding
class PromiseCompletion : public Nan::ObjectWrap
{
// callback type called when a promise completes
typedef void (*Callback) (bool isFulfilled, AsyncBaton *baton, v8::Local<v8::Value> resultOfPromise);
static NAN_METHOD(New);
static NAN_METHOD(PromiseFulfilled);
static NAN_METHOD(PromiseRejected);
// persistent handles for NAN_METHODs
static Nan::Persistent<v8::Function> newFn;
static Nan::Persistent<v8::Function> promiseFulfilled;
static Nan::Persistent<v8::Function> promiseRejected;
static v8::Local<v8::Value> Bind(Nan::Persistent<v8::Function> &method, v8::Local<v8::Object> object);
static void CallCallback(bool isFulfilled, const Nan::FunctionCallbackInfo<v8::Value> &info);
// callback and baton stored for the promise that this PromiseCompletion is
// attached to. when the promise completes, the callback will be called with
// the result, and the stored baton.
Callback callback;
AsyncBaton *baton;
void Setup(v8::Local<v8::Function> thenFn, v8::Local<v8::Value> result, AsyncBaton *baton, Callback callback);
public:
// If result is a promise, this will instantiate a new PromiseCompletion
// and have it forward the promise result / reason via the baton and callback
static bool ForwardIfPromise(v8::Local<v8::Value> result, AsyncBaton *baton, Callback callback);
static void InitializeComponent();
};
#endif
+39
View File
@@ -0,0 +1,39 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITPROXY_H
#define GITPROXY_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
using namespace node;
using namespace v8;
class GitProxy : public
Nan::ObjectWrap
{
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
};
#endif
+140
View File
@@ -0,0 +1,140 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITPROXYOPTIONS_H
#define GITPROXYOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
#include "../include/cred.h"
#include "../include/cert.h"
using namespace node;
using namespace v8;
class GitProxyOptions;
struct GitProxyOptionsTraits {
typedef GitProxyOptions cppClass;
typedef git_proxy_options cType;
static const bool isDuplicable = false;
static void duplicate(git_proxy_options **dest, git_proxy_options *src) {
Nan::ThrowError("duplicate called on GitProxyOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_proxy_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitProxyOptions : public NodeGitWrapper<GitProxyOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitProxyOptionsTraits>;
public:
GitProxyOptions(git_proxy_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
static int credentials_cppCallback (
git_cred ** cred
,
const char * url
,
const char * username_from_url
,
unsigned int allowed_types
,
void * payload
);
static void credentials_async(void *baton);
static void credentials_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct CredentialsBaton : public AsyncBatonWithResult<int> {
git_cred ** cred;
const char * url;
const char * username_from_url;
unsigned int allowed_types;
void * payload;
CredentialsBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitProxyOptions * credentials_getInstanceFromBaton (
CredentialsBaton *baton);
static int certificate_check_cppCallback (
git_cert * cert
,
int valid
,
const char * host
,
void * payload
);
static void certificate_check_async(void *baton);
static void certificate_check_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct CertificateCheckBaton : public AsyncBatonWithResult<int> {
git_cert * cert;
int valid;
const char * host;
void * payload;
CertificateCheckBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitProxyOptions * certificate_check_getInstanceFromBaton (
CertificateCheckBaton *baton);
private:
GitProxyOptions();
~GitProxyOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetType);
static NAN_SETTER(SetType);
static NAN_GETTER(GetUrl);
static NAN_SETTER(SetUrl);
CallbackWrapper credentials;
static NAN_GETTER(GetCredentials);
static NAN_SETTER(SetCredentials);
CallbackWrapper certificate_check;
static NAN_GETTER(GetCertificateCheck);
static NAN_SETTER(SetCertificateCheck);
Nan::Persistent<Value> payload;
static NAN_GETTER(GetPayload);
static NAN_SETTER(SetPayload);
};
#endif
+87
View File
@@ -0,0 +1,87 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITPUSHOPTIONS_H
#define GITPUSHOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
#include "../include/str_array_converter.h"
#include "../include/remote_callbacks.h"
#include "../include/proxy_options.h"
#include "../include/strarray.h"
using namespace node;
using namespace v8;
class GitPushOptions;
struct GitPushOptionsTraits {
typedef GitPushOptions cppClass;
typedef git_push_options cType;
static const bool isDuplicable = false;
static void duplicate(git_push_options **dest, git_push_options *src) {
Nan::ThrowError("duplicate called on GitPushOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_push_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitPushOptions : public NodeGitWrapper<GitPushOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitPushOptionsTraits>;
public:
GitPushOptions(git_push_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitPushOptions();
~GitPushOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetPbParallelism);
static NAN_SETTER(SetPbParallelism);
Nan::Persistent<Object> callbacks;
static NAN_GETTER(GetCallbacks);
static NAN_SETTER(SetCallbacks);
Nan::Persistent<Object> proxy_opts;
static NAN_GETTER(GetProxyOpts);
static NAN_SETTER(SetProxyOpts);
Nan::Persistent<Object> custom_headers;
static NAN_GETTER(GetCustomHeaders);
static NAN_SETTER(SetCustomHeaders);
};
#endif
+75
View File
@@ -0,0 +1,75 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITPUSHUPDATE_H
#define GITPUSHUPDATE_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/oid.h"
using namespace node;
using namespace v8;
class GitPushUpdate;
struct GitPushUpdateTraits {
typedef GitPushUpdate cppClass;
typedef git_push_update cType;
static const bool isDuplicable = false;
static void duplicate(git_push_update **dest, git_push_update *src) {
Nan::ThrowError("duplicate called on GitPushUpdate which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_push_update *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitPushUpdate : public
NodeGitWrapper<GitPushUpdateTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitPushUpdateTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitPushUpdate()
: NodeGitWrapper<GitPushUpdateTraits>(
"A new GitPushUpdate cannot be instantiated."
)
{}
GitPushUpdate(git_push_update *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitPushUpdateTraits>(raw, selfFreeing, owner)
{}
~GitPushUpdate();
static NAN_METHOD(SrcRefname);
static NAN_METHOD(DstRefname);
static NAN_METHOD(Src);
static NAN_METHOD(Dst);
};
#endif
+221
View File
@@ -0,0 +1,221 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITREBASE_H
#define GITREBASE_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/oid.h"
#include "../include/signature.h"
#include "../include/repository.h"
#include "../include/annotated_commit.h"
#include "../include/rebase_options.h"
#include "../include/index.h"
#include "../include/rebase_operation.h"
// Forward declaration.
struct git_rebase {
};
using namespace node;
using namespace v8;
class GitRebase;
struct GitRebaseTraits {
typedef GitRebase cppClass;
typedef git_rebase cType;
static const bool isDuplicable = false;
static void duplicate(git_rebase **dest, git_rebase *src) {
Nan::ThrowError("duplicate called on GitRebase which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_rebase *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::git_rebase_free(raw); // :: to avoid calling this free recursively
}
}
};
class GitRebase : public
NodeGitWrapper<GitRebaseTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitRebaseTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitRebase()
: NodeGitWrapper<GitRebaseTraits>(
"A new GitRebase cannot be instantiated."
)
{}
GitRebase(git_rebase *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitRebaseTraits>(raw, selfFreeing, owner)
{}
~GitRebase();
struct AbortBaton {
int error_code;
const git_error* error;
git_rebase * rebase;
};
class AbortWorker : public Nan::AsyncWorker {
public:
AbortWorker(
AbortBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~AbortWorker() {};
void Execute();
void HandleOKCallback();
private:
AbortBaton *baton;
};
static NAN_METHOD(Abort);
struct CommitBaton {
int error_code;
const git_error* error;
git_oid * id;
git_rebase * rebase;
const git_signature * author;
const git_signature * committer;
const char * message_encoding;
const char * message;
};
class CommitWorker : public Nan::AsyncWorker {
public:
CommitWorker(
CommitBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~CommitWorker() {};
void Execute();
void HandleOKCallback();
private:
CommitBaton *baton;
};
static NAN_METHOD(Commit);
static NAN_METHOD(Finish);
struct InitBaton {
int error_code;
const git_error* error;
git_rebase * out;
git_repository * repo;
const git_annotated_commit * branch;
const git_annotated_commit * upstream;
const git_annotated_commit * onto;
const git_rebase_options * opts;
};
class InitWorker : public Nan::AsyncWorker {
public:
InitWorker(
InitBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~InitWorker() {};
void Execute();
void HandleOKCallback();
private:
InitBaton *baton;
};
static NAN_METHOD(Init);
static NAN_METHOD(InmemoryIndex);
struct NextBaton {
int error_code;
const git_error* error;
git_rebase_operation * operation;
git_rebase * rebase;
};
class NextWorker : public Nan::AsyncWorker {
public:
NextWorker(
NextBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~NextWorker() {};
void Execute();
void HandleOKCallback();
private:
NextBaton *baton;
};
static NAN_METHOD(Next);
static NAN_METHOD(OntoId);
static NAN_METHOD(OntoName);
struct OpenBaton {
int error_code;
const git_error* error;
git_rebase * out;
git_repository * repo;
const git_rebase_options * opts;
};
class OpenWorker : public Nan::AsyncWorker {
public:
OpenWorker(
OpenBaton *_baton,
Nan::Callback *callback
) : Nan::AsyncWorker(callback)
, baton(_baton) {};
~OpenWorker() {};
void Execute();
void HandleOKCallback();
private:
OpenBaton *baton;
};
static NAN_METHOD(Open);
static NAN_METHOD(OperationByindex);
static NAN_METHOD(OperationCurrent);
static NAN_METHOD(OperationEntrycount);
static NAN_METHOD(OrigHeadId);
static NAN_METHOD(OrigHeadName);
};
#endif
+74
View File
@@ -0,0 +1,74 @@
// This is a generated file, modify: generate/templates/templates/class_header.h
#ifndef GITREBASEOPERATION_H
#define GITREBASEOPERATION_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include <sstream>
#include "async_baton.h"
#include "nodegit_wrapper.h"
#include "promise_completion.h"
#include "reference_counter.h"
extern "C" {
#include <git2.h>
}
#include "../include/typedefs.h"
#include "../include/oid.h"
using namespace node;
using namespace v8;
class GitRebaseOperation;
struct GitRebaseOperationTraits {
typedef GitRebaseOperation cppClass;
typedef git_rebase_operation cType;
static const bool isDuplicable = false;
static void duplicate(git_rebase_operation **dest, git_rebase_operation *src) {
Nan::ThrowError("duplicate called on GitRebaseOperation which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_rebase_operation *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitRebaseOperation : public
NodeGitWrapper<GitRebaseOperationTraits>
{
// grant full access to base class
friend class NodeGitWrapper<GitRebaseOperationTraits>;
public:
static void InitializeComponent (v8::Local<v8::Object> target);
private:
GitRebaseOperation()
: NodeGitWrapper<GitRebaseOperationTraits>(
"A new GitRebaseOperation cannot be instantiated."
)
{}
GitRebaseOperation(git_rebase_operation *raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>())
: NodeGitWrapper<GitRebaseOperationTraits>(raw, selfFreeing, owner)
{}
~GitRebaseOperation();
static NAN_METHOD(Type);
static NAN_METHOD(Id);
static NAN_METHOD(Exec);
};
#endif
+123
View File
@@ -0,0 +1,123 @@
// This is a generated file, modify: generate/templates/templates/struct_header.h
#ifndef GITREBASEOPTIONS_H
#define GITREBASEOPTIONS_H
#include <nan.h>
#include <string>
#include <queue>
#include <utility>
#include <unordered_map>
#include "async_baton.h"
#include "callback_wrapper.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
extern "C" {
#include <git2.h>
}
#include "../include/checkout_options.h"
#include "../include/merge_options.h"
#include "../include/buf.h"
using namespace node;
using namespace v8;
class GitRebaseOptions;
struct GitRebaseOptionsTraits {
typedef GitRebaseOptions cppClass;
typedef git_rebase_options cType;
static const bool isDuplicable = false;
static void duplicate(git_rebase_options **dest, git_rebase_options *src) {
Nan::ThrowError("duplicate called on GitRebaseOptions which cannot be duplicated");
}
static const bool isSingleton = false;
static const bool isFreeable = true;
static void free(git_rebase_options *raw) {
unsigned long referenceCount = 0;
if (referenceCount == 0) {
::free(raw); // :: to avoid calling this free recursively
}
}
};
class GitRebaseOptions : public NodeGitWrapper<GitRebaseOptionsTraits> {
// grant full access to base class
friend class NodeGitWrapper<GitRebaseOptionsTraits>;
public:
GitRebaseOptions(git_rebase_options* raw, bool selfFreeing, v8::Local<v8::Object> owner = v8::Local<v8::Object>());
static void InitializeComponent (v8::Local<v8::Object> target);
static int signing_cb_cppCallback (
git_buf * signature
,
git_buf * signature_field
,
const char * commit_content
,
void * payload
);
static void signing_cb_async(void *baton);
static void signing_cb_promiseCompleted(bool isFulfilled, AsyncBaton *_baton, v8::Local<v8::Value> result);
struct SigningCbBaton : public AsyncBatonWithResult<int> {
git_buf * signature;
git_buf * signature_field;
const char * commit_content;
void * payload;
SigningCbBaton(const int &defaultResult)
: AsyncBatonWithResult<int>(defaultResult) {
}
};
static GitRebaseOptions * signing_cb_getInstanceFromBaton (
SigningCbBaton *baton);
private:
GitRebaseOptions();
~GitRebaseOptions();
void ConstructFields();
static NAN_GETTER(GetVersion);
static NAN_SETTER(SetVersion);
static NAN_GETTER(GetQuiet);
static NAN_SETTER(SetQuiet);
static NAN_GETTER(GetRewriteNotesRef);
static NAN_SETTER(SetRewriteNotesRef);
Nan::Persistent<Object> checkout_options;
static NAN_GETTER(GetCheckoutOptions);
static NAN_SETTER(SetCheckoutOptions);
Nan::Persistent<Object> merge_options;
static NAN_GETTER(GetMergeOptions);
static NAN_SETTER(SetMergeOptions);
CallbackWrapper signing_cb;
static NAN_GETTER(GetSigningCb);
static NAN_SETTER(SetSigningCb);
Nan::Persistent<Value> payload;
static NAN_GETTER(GetPayload);
static NAN_SETTER(SetPayload);
static NAN_GETTER(GetInmemory);
static NAN_SETTER(SetInmemory);
};
#endif

Some files were not shown because too many files have changed in this diff Show More