Git.framework Reference Library

GITTreeItem Class Reference

GITTreeItem Class Reference

Declared in GITTreeItem.h

Overview

The GITTreeItem class represents the information stored in a GITree object.

GITTrees are made up of items specifying the mode, name and SHA1 reference of objects which are part of that tree. The GITTree parses the items of its object data and creates and array of GITTreeItem objects. The Tree Item is then capable of lazily loading the target objects of the reference.

Tasks

Properties

parent

Tree the item belongs to.

@property GITTree *parent
Declared In
GITTreeItem.h

mode

File/directory mode of the item.

@property NSUInteger mode
Declared In
GITTreeItem.h

name

Name of the file or directory.

@property NSString *name
Declared In
GITTreeItem.h

item

Item being pointed to.

@property GITObject *item
Declared In
GITTreeItem.h

sha1

Hash of the item (tree/blob) referred to.

@property GITObjectHash *sha1
Declared In
GITTreeItem.h

Class Methods

itemInTree:withMode:name:sha1:

+ (GITTreeItem *)itemInTree:(GITTree *)tree withMode:(NSUInteger)mode name:(NSString *)name sha1:(GITObjectHash *)sha1
Parameters
tree

The tree the item is a part of

mode

The file mode of the object referenced

name

The name of the object referenced

sha1

The sha1 of the object referenced

Return Value

a tree item object

Discussion

Creates and returns a tree content item with the mode, name and sha1.

See Also
Declared In
GITTreeItem.h

Instance Methods

initInTree:withMode:name:sha1:

- (id)initInTree:(GITTree *)tree withMode:(NSUInteger)mode name:(NSString *)name sha1:(GITObjectHash *)sha1
Parameters
tree

The tree the item is a part of

mode

The file mode of the object referenced

name

The name of the object referenced

sha1

The sha1 of the object referenced

Return Value

a tree item object

Discussion

Creates and returns a tree content item with the mode, name and sha1.

See Also
Declared In
GITTreeItem.h

isFile

- (BOOL)isFile
Return Value

YES if the receiver represents a file, NO if not

Discussion

Indicates if the receiver represents a file (blob).

Declared In
GITTreeItem.h

isDirectory

- (BOOL)isDirectory
Return Value

YES if the receiver represents a directory, NO if not

Discussion

Indicates if the receiver represents a directory (tree).

Declared In
GITTreeItem.h

isModule

- (BOOL)isModule
Return Value

YES if the receiver represents a submodule, NO if not

Discussion

Indicates if the receiver represents a submodule.

Declared In
GITTreeItem.h

isEqual:

- (BOOL)isEqual:(id)other
Parameters
other

The object to be compared to the receiver

Return Value

YES if the receiver and other are equal, otherwise NO

Discussion

Returns a Boolean value that indicates whether the receiver and a given object are equal.

See Also
Declared In
GITTreeItem.h

isEqualToTreeItem:

- (BOOL)isEqualToTreeItem:(GITTreeItem *)rhs
Parameters
rhs

The Tree Item with which to compare the receiver

Return Value

YES if the receiver and hash are equal, otherwise NO

Discussion

Returns a Boolean value that indicates whether the receiver and a given Tree Item are equal.

See Also
Declared In
GITTreeItem.h

isEqualToObject:

- (BOOL)isEqualToObject:(GITObject *)rhs
Parameters
rhs

The GITObject with which to compare the receiver

Return Value

YES if the receiver and hash are equal, otherwise NO

Discussion

Returns a Boolean value that indicates whether the receiver and a given GITObject are equal.

See Also
Declared In
GITTreeItem.h

Last updated: 2011-2-20