Git.framework Reference Library

GITPackFileWriter Class Reference

GITPackFileWriter Class Reference

Declared in GITPackFileWriter.h

Overview

GITPackFileWriter is a class cluster which provides the ability to generate PACK files from a given set of objects.

Tasks

Class Methods

packWriter

+ (GITPackFileWriter *)packWriter
Return Value

PACK file writer for the default version

Discussion

Creates an autoreleased PACK file writer for the default PACK file version.

Declared In
GITPackFileWriter.h

packWriterVersion:

+ (GITPackFileWriter *)packWriterVersion:(NSUInteger)version
Parameters
version

Version of writer to create

Return Value

PACK file writer with the specified version, nil if version is unsupported.

Discussion

Creates an autoreleased PACK file writer for the specified version.

Declared In
GITPackFileWriter.h

Instance Methods

initWithDefaultVersion

- (id)initWithDefaultVersion
Return Value

PACK file writer for the default version

Discussion

Initialises a PACK file writer for the default PACK file version.

Declared In
GITPackFileWriter.h

initWithVersion:error:

- (id)initWithVersion:(NSUInteger)version error:(NSError **)error
Parameters
version

Version of the writer to create

error

NSError describing the error that occurred

Return Value

PACK file writer for the specified version, or nil on error

Discussion

Initialises a PACK file writer for the specified version.

Declared In
GITPackFileWriter.h

addObjectsFromRevList:

- (void)addObjectsFromRevList:(GITRevList *)revList
Parameters
revList

Rev list of objects to add to the receiver.

Discussion

Add the objects reachable from the provided revList to the reciever.

Declared In
GITPackFileWriter.h

addObjectsFromCommit:

- (void)addObjectsFromCommit:(GITCommit *)commit
Parameters
commit

Commit object to reach objects from.

Discussion

Add the objects reachable from the provided commit to the receiver.

See Also
Declared In
GITPackFileWriter.h

name

- (NSString *)name
Return Value

SHA1 string name of the receiver derived from the objects to the packed

Discussion

Returns the name of the receiver derived from the objects to be packed.

Declared In
GITPackFileWriter.h

fileName

- (NSString *)fileName
Return Value

File name of the receiver.

Discussion

Returns the file name of the receiver.

See Also
Declared In
GITPackFileWriter.h

writeToStream:inRunLoop:

- (void)writeToStream:(NSOutputStream *)stream inRunLoop:(NSRunLoop *)runLoop
Parameters
stream

Output stream to write the PACK index data to

runLoop

NSRunLoop to schedule the writing in

Discussion

Writes the PACK file contents to the provided stream in the NSRunLoop specified.

Bug

We need a way of getting any stream errors sent back to the client

Declared In
GITPackFileWriter.h

writeToStream:error:

- (NSInteger)writeToStream:(NSOutputStream *)stream error:(NSError **)error
Parameters
stream

Output stream to write the PACK index data to

error

NSError describing any error which occurred

Return Value

0 if writing was successful, -1 if an error occurred.

Discussion

Writes the PACK file contents to the provided steam.

This method using Polling rather than run-loop scheduling to perform the writing.

Declared In
GITPackFileWriter.h

indexWriter

- (GITPackIndexWriter *)indexWriter
Return Value

PACK index writer of the receiver

Discussion

Returns the PACK index writer of the receiver.

Declared In
GITPackFileWriter.h

setIndexWriter:

- (void)setIndexWriter:(GITPackIndexWriter *)indexWriter
Parameters
indexWriter

PACK index writer for the receiver to populate when it writes itself.

Discussion

Sets the provided indexWriter on the receiver.

Declared In
GITPackFileWriter.h

Last updated: 2011-2-20