GitBlob

class GitBlob : public ObjectWrap

Wrapper for libgit2 git_blob.

Summary
GitBlobWrapper for libgit2 git_blob.
Variables
constructor_templateUsed to create Node.js constructor.
Functions
InitializeUsed to intialize the EventEmitter from Node.js
LookupLookup a blob object from a repository.
RawContentGet a read-only buffer with the raw content of a blob.
RawSizeLookup a blob object from a repository.
CloseFree a blob object.
CreateFromFileRead a file into the ODB.
CreateFromBufferRead a buffer into the ODB.
GitBlob
Newargs v8::Arguments function call
Lookupargs v8::Arguments function call
EIO_Lookup
EIO_AfterLookup
RawContentargs v8::Arguments function call
RawSizeargs v8::Arguments function call
Closeargs v8::Arguments function call
CreateFromFileargs v8::Arguments function call
CreateFromBufferargs v8::Arguments function call
Variables
blobInternal reference to git_blob object
lookup_requestContains references to the current blob, repo, and oid for a commit lookup, also contains references to an error code post lookup, and a callback function to execute.

Variables

constructor_template

static v8::Persistent<v8::FunctionTemplate> constructor_template

Used to create Node.js constructor.

Functions

Initialize

static void Initialize(v8::Handle<v8::Object> target)

Used to intialize the EventEmitter from Node.js

Parameters

targetv8::Object the Node.js global module object

Lookup

int Lookup(git_repository *repo,
const git_oid *id)

Lookup a blob object from a repository.

Parameters

repo the repo to use when locating the blob. id identity of the blob to locate.

Returns

0 on success; error code otherwise

RawContent

const void* RawContent()

Get a read-only buffer with the raw content of a blob.

Returns

raw content buffer; NULL if the blob has no contents

RawSize

int RawSize()

Lookup a blob object from a repository.

Returns

size in bytes

Close

void Close()

Free a blob object.

CreateFromFile

int CreateFromFile(git_oid *oid,
git_repository *repo,
const char *path)

Read a file into the ODB.

Returns

0 on success, error code otherwise

CreateFromBuffer

int CreateFromBuffer(git_oid *oid,
git_repository *repo,
const void *buffer,
size_t len)

Read a buffer into the ODB.

Returns

0 on success, error code otherwise

GitBlob

GitBlob()

New

static v8::Handle<v8::Value> New(const v8::Arguments &args)

Parameters

args v8::Arguments function call

Returns

v8::Object args.This()

Lookup

static v8::Handle<v8::Value> Lookup(const v8::Arguments &args)

Parameters

args v8::Arguments function call

Returns

v8::Object args.This()

EIO_Lookup

static int EIO_Lookup(eio_req *req)

Parameters

reqan eio_req pointer

Returns

completion code integer

EIO_AfterLookup

static int EIO_AfterLookup(eio_req *req)

Parameters

reqan eio_req pointer

Returns

completion code integer

RawContent

static v8::Handle<v8::Value> RawContent(const v8::Arguments &args)

Parameters

args v8::Arguments function call

Returns

v8::Object args.This()

RawSize

static v8::Handle<v8::Value> RawSize(const v8::Arguments &args)

Parameters

args v8::Arguments function call

Returns

v8::Object args.This()

Close

static v8::Handle<v8::Value> Close(const v8::Arguments &args)

Parameters

args v8::Arguments function call

Returns

v8::Object args.This()

CreateFromFile

static v8::Handle<v8::Value> CreateFromFile(const v8::Arguments &args)

Parameters

args v8::Arguments function call

Returns

v8::Object args.This()

CreateFromBuffer

static v8::Handle<v8::Value> CreateFromBuffer(const v8::Arguments &args)

Parameters

args v8::Arguments function call

Returns

v8::Object args.This()

Variables

blob

git_blob* blob

Internal reference to git_blob object

lookup_request

struct lookup_request

Contains references to the current blob, repo, and oid for a commit lookup, also contains references to an error code post lookup, and a callback function to execute.

class GitBlob : public ObjectWrap
Wrapper for libgit2 git_blob.
static v8::Persistent<v8::FunctionTemplate> constructor_template
Used to create Node.js constructor.
static void Initialize(v8::Handle<v8::Object> target)
Used to intialize the EventEmitter from Node.js
int Lookup(git_repository *repo,
const git_oid *id)
Lookup a blob object from a repository.
const void* RawContent()
Get a read-only buffer with the raw content of a blob.
int RawSize()
Lookup a blob object from a repository.
void Close()
Free a blob object.
int CreateFromFile(git_oid *oid,
git_repository *repo,
const char *path)
Read a file into the ODB.
int CreateFromBuffer(git_oid *oid,
git_repository *repo,
const void *buffer,
size_t len)
Read a buffer into the ODB.
GitBlob()
static v8::Handle<v8::Value> New(const v8::Arguments &args)
args v8::Arguments function call
static int EIO_Lookup(eio_req *req)
static int EIO_AfterLookup(eio_req *req)
git_blob* blob
Internal reference to git_blob object
struct lookup_request
Contains references to the current blob, repo, and oid for a commit lookup, also contains references to an error code post lookup, and a callback function to execute.
Close