GITObjectStore Class Reference

#import <GITObjectStore.h>

Inherited by GITCombinedStore, GITFileStore, and GITPackStore.

List of all members.

Public Member Functions

(id) - initWithRoot:
(NSData *) - dataWithContentsOfObject:
(BOOL) - extractFromObject:type:size:data:
(BOOL) - loadObjectWithSha1:intoData:type:error:


Detailed Description

Generic object storage class. Desendants of GITObjectStore implement different ways of accessing the objects of a repository.

Member Function Documentation

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

Returns the contents of an object for the given sha1. The data returned should be in a form which is usable to initialise an object. If the data is stored compressed or encrypted it should be decompressed or decrypted before returning.

Attention:
This method must be overridden
Parameters:
sha1 The object reference to return the data for
Returns:
Contents of an object, nil if the object cannot be found
Deprecated:
use -loadObjectWithSha1:intoData:type:error: instead

- (BOOL) extractFromObject: (NSString*)  sha1
type: (NSString**)  type
size: (NSUInteger*)  size
data: (NSData**)  data 

For internal use only.

Returns if the receiver can return the object with the given sha1. Indicates if the receiver is able to return data for an object with the given sha1 identifer.

Parameters:
sha1 Name of the object to check for
Returns:
YES if has data for object, NO if not.
Extracts the basic information from a git object file.
Parameters:
sha1 The object reference to extract the data from
[out] type The type of the object as a string
[out] size The size of data in bytes
[out] data The data content of the object
Returns:
Indication that the extraction was successful.
Deprecated:
use -loadObjectWithSha1:intoData:type:error: instead

- (id) initWithRoot: (NSString*)  root  

Creates and returns a new store object from the provided .git root

Attention:
This method must be overridden
Parameters:
root Path to the .git root directory
Returns:
A new store object.

- (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.


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