GITPackFile Class Reference

#import <GITPackFile.h>

Inherited by GITPackFileVersion2, and GITPlaceholderPackFile.

List of all members.

Public Member Functions

(NSUInteger) - version
(GITPackIndex *) - index
(id) - initWithPath:
(NSData *) - dataForObjectWithSha1:
(BOOL) - loadObjectWithSha1:intoData:type:error:
(NSData *) - checksum
(NSString *) - checksumString
(BOOL) - verifyChecksum
(NSUInteger) - numberOfObjects
(BOOL) - hasObjectWithSha1:


Detailed Description

GITPackFile is a class which provides access to individual PACK files within a git repository.

A PACK file is an archive format used by git primarily for network transmission of repository objects. Once transmitted the received PACK files are then used for access to the stored objects.

Attention:
GITPackFile is a class cluster, subclasses must override the following primitive methods.

Member Function Documentation

- (NSData *) checksum  

Returns checksum data for the receiver

Returns:
Checksum data of the receiver

- (NSString *) checksumString  

Returns checksum string for the receiver

Returns:
Checksum string of the receiver

- (NSData *) dataForObjectWithSha1: (NSString*)  sha1  

Returns the data for the object specified by the given sha1. The sha1 will first be checked to see if it exists

Parameters:
sha1 The SHA1 of the object to retrieve the data for.
Returns:
Data for the object or nil if the object is not in the receiver
Deprecated:
use -loadObjectWithSha1:intoData:type:error: instead

- (BOOL) hasObjectWithSha1: (NSString*)  sha1  

Indicates whether the receiver contains the object specified by the given sha1.

Parameters:
sha1 The SHA1 of the object to check the presence of
Returns:
BOOL indicating if the receiver contains the object

- (GITPackIndex *) index  

Returns the corresponding index for the receiver

Returns:
The index for the receiver

For internal use only.

Subclasses must override this method

- (id) initWithPath: (NSString*)  path  

Creates and returns a new PACK object at the specified path.

Parameters:
path Path of the PACK file in the repository
Returns:
A new PACK object

For internal use only.

Subclasses must override this method, failure to do so will result in an error. The overriding implementation should not call this implementation as part of itself. Instead it is recommended to use [super init] instead.

- (BOOL) loadObjectWithSha1: (NSString*)  sha1
intoData: (NSData**)  data
type: (GITObjectType*)  type
error: (NSError**)  error 

Loads and returns the contents of an object.

Parameters:
sha1 The SHA1 name of the object to load
[out] data Data to load the object contents into
[out] type The GITObjectType of the object
[out] error NSError object containing any errors, pass NULL if you don't care
Returns:
YES on successful load, NO if an error occurred

For internal use only.

We might possibly consider the following extension to this method once Deltas are being parsed. If the type parameter has a non-zero value then this will be perceived as an expected type setting, an error should be returned if this expected type is not met.

- (NSUInteger) numberOfObjects  

Returns the number of objects in the receiver

Returns:
Number of objects in the receiver

- (BOOL) verifyChecksum  

Verifies if the checksum matches for the contents of the receiver.

Returns:
YES if checksum matches, NO if it does not.

- (NSUInteger) version  

Returns the version of PACK file which the receiver is providing access to.

Returns:
Numerical version of the receiver

For internal use only.

Subclasses must override this method


The documentation for this class was generated from the following files:

Generated on Mon Dec 8 22:57:08 2008 for CocoaGit by  doxygen 1.5.7