# GitBlob

> class GitBlob : public ObjectWrap

Wrapper for libgit2 git_blob.

Summary

GitBlob | Wrapper for libgit2 git_blob.
Variables |
constructor_template | Used to create Node.js constructor.
Functions |
Initialize | Used to intialize the EventEmitter from Node.js
Lookup | Lookup a blob object from a repository.
RawContent | Get a read-only buffer with the raw content of a blob.
RawSize | Lookup a blob object from a repository.
Close | Free a blob object.
CreateFromFile | Read a file into the ODB.
CreateFromBuffer | Read a buffer into the ODB.
GitBlob |
New | args v8::Arguments function call
Lookup | args v8::Arguments function call
EIO_Lookup |
EIO_AfterLookup |
RawContent | args v8::Arguments function call
RawSize | args v8::Arguments function call
Close | args v8::Arguments function call
CreateFromFile | args v8::Arguments function call
CreateFromBuffer | args v8::Arguments function call
Variables |
blob | Internal reference to git_blob object
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.

### 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

target | v8::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

req | an eio_req pointer

#### Returns

completion code integer

### EIO_AfterLookup

> static int EIO_AfterLookup( | eio_req | * | req | )

#### Parameters

req | an 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