C# Class GitSharp.Core.TreeWalk.AbstractTreeIterator

Walks a Git tree (directory) in Git sort order. A new iterator instance should be positioned on the first entry, or at eof. Data for the first entry (if not at eof) should be available immediately. Implementors must walk a tree in the Git sort order, which has the following odd sorting: A.c A/c A0c In the second item, A is the name of a subtree and c is a file within that subtree. The other two items are files in the root level tree.
Afficher le fichier Open project: jagregory/GitSharp Class Usage Examples

Méthodes publiques

Свойство Type Description
DEFAULT_PATH_SIZE int

Protected Properties

Свойство Type Description
ZeroId byte[]

Méthodes publiques

Méthode Description
back ( int delta ) : void

Move to prior entry, populating this iterator with the entry data. The delta indicates how many moves backward should occur. The most common delta is 1 to move to the prior entry. Implementations must populate the following members:

  • Mode
  • {@link #_path} (from {@link #_pathOffset} to {@link #_pathLen})
  • {@link #_pathLen}
as well as any implementation dependent information necessary to accurately return data from idBuffer() and idOffset() when demanded.

createEmptyTreeIterator ( ) : GitSharp.Core.TreeWalk.EmptyTreeIterator
createSubtreeIterator ( Repository repo ) : AbstractTreeIterator
createSubtreeIterator ( Repository repo, MutableObjectId idBuffer, WindowCursor curs ) : AbstractTreeIterator
eof ( ) : bool
first ( ) : bool
getEntryObjectId ( ) : ObjectId

Gets the ObjectId of the current entry.

getEntryObjectId ( MutableObjectId objectId ) : void

Gets the ObjectId of the current entry.

getName ( byte buffer, int offset ) : void

Get the name component of the current entry path into the provided buffer.

growPath ( int len ) : void

Grow the _path buffer larger.

idBuffer ( ) : byte[]

Get the byte array buffer object IDs must be copied out of. The id buffer contains the bytes necessary to construct an ObjectId for the current entry of this iterator. The buffer can be the same buffer for all entries, or it can be a unique buffer per-entry. Implementations are encouraged to expose their private buffer whenever possible to reduce garbage generation and copying costs.

idEqual ( AbstractTreeIterator otherIterator ) : bool

Check if the current entry of both iterators has the same id. This method is faster than getEntryObjectId()as it does not require copying the bytes out of the buffers. A direct idBuffer compare operation is performed.

idOffset ( ) : int
next ( int delta ) : void
pathCompare ( AbstractTreeIterator treeIterator ) : int

Compare the path of this current entry to another iterator's entry.

pathCompare ( AbstractTreeIterator treeIterator, int treeIteratorMode ) : int

Compare the path of this current entry to another iterator's entry.

skip ( ) : void

Advance to the next tree entry, populating this iterator with its data. This method behaves like seek(1) but is called by TreeWalk only if a TreeFilter was used and ruled out the current entry from the results. In such cases this tree iterator may perform special behavior.

stopWalk ( ) : void

Indicates to the iterator that no more entries will be Read. This is only invoked by TreeWalk when the iteration is aborted early due to a StopWalkException being thrown from within a TreeFilter.

Méthodes protégées

Méthode Description
AbstractTreeIterator ( ) : System

Create a new iterator with no parent.

AbstractTreeIterator ( AbstractTreeIterator p ) : System

Create an iterator for a subtree of an existing iterator.

AbstractTreeIterator ( AbstractTreeIterator p, byte childPath, int childPathOffset ) : System

Create an iterator for a subtree of an existing iterator. The caller is responsible for setting up the path of the child iterator.

AbstractTreeIterator ( byte prefix ) : System

Create a new iterator with no parent and a prefix. The prefix path supplied is inserted in front of all paths generated by this iterator. It is intended to be used when an iterator is being created for a subsection of an overall repository and needs to be combined with other iterators that are created to run over the entire repository namespace.

AbstractTreeIterator ( string prefix ) : System

Create a new iterator with no parent and a prefix. The prefix path supplied is inserted in front of all paths generated by this iterator. It is intended to be used when an iterator is being created for a subsection of an overall repository and needs to be combined with other iterators that are created to run over the entire repository namespace.

ensurePathCapacity ( int capacity, int length ) : void

Ensure that path is capable to hold at least capacity bytes.

Private Methods

Méthode Description
AlreadyMatch ( AbstractTreeIterator a, AbstractTreeIterator b ) : int
LastPathChar ( int mode ) : int
SetPathCapacity ( int capacity, int length ) : void

Set path buffer capacity to the specified size

Method Details

AbstractTreeIterator() protected méthode

Create a new iterator with no parent.
protected AbstractTreeIterator ( ) : System
Résultat System

AbstractTreeIterator() protected méthode

Create an iterator for a subtree of an existing iterator.
protected AbstractTreeIterator ( AbstractTreeIterator p ) : System
p AbstractTreeIterator parent tree iterator.
Résultat System

AbstractTreeIterator() protected méthode

Create an iterator for a subtree of an existing iterator. The caller is responsible for setting up the path of the child iterator.
protected AbstractTreeIterator ( AbstractTreeIterator p, byte childPath, int childPathOffset ) : System
p AbstractTreeIterator parent tree iterator.
childPath byte /// Path array to be used by the child iterator. This path must /// contain the path from the top of the walk to the first child /// and must end with a '/'. ///
childPathOffset int /// position within childPath where the child can /// insert its data. The value at /// childPath[childPathOffset-1] must be '/'. ///
Résultat System

AbstractTreeIterator() protected méthode

Create a new iterator with no parent and a prefix. The prefix path supplied is inserted in front of all paths generated by this iterator. It is intended to be used when an iterator is being created for a subsection of an overall repository and needs to be combined with other iterators that are created to run over the entire repository namespace.
protected AbstractTreeIterator ( byte prefix ) : System
prefix byte /// position of this iterator in the repository tree. The value /// may be null or the empty array to indicate the prefix is the /// root of the repository. A trailing slash ('/') is /// automatically appended if the prefix does not end in '/'. ///
Résultat System

AbstractTreeIterator() protected méthode

Create a new iterator with no parent and a prefix. The prefix path supplied is inserted in front of all paths generated by this iterator. It is intended to be used when an iterator is being created for a subsection of an overall repository and needs to be combined with other iterators that are created to run over the entire repository namespace.
protected AbstractTreeIterator ( string prefix ) : System
prefix string /// position of this iterator in the repository tree. The value /// may be null or the empty string to indicate the prefix is the /// root of the repository. A trailing slash ('/') is /// automatically appended if the prefix does not end in '/'. ///
Résultat System

back() public abstract méthode

Move to prior entry, populating this iterator with the entry data. The delta indicates how many moves backward should occur. The most common delta is 1 to move to the prior entry. Implementations must populate the following members:
  • Mode
  • {@link #_path} (from {@link #_pathOffset} to {@link #_pathLen})
  • {@link #_pathLen}
as well as any implementation dependent information necessary to accurately return data from idBuffer() and idOffset() when demanded.
public abstract back ( int delta ) : void
delta int /// Number of entries to move the iterator by. Must be a positive, /// non-zero integer. ///
Résultat void

createEmptyTreeIterator() public méthode

public createEmptyTreeIterator ( ) : GitSharp.Core.TreeWalk.EmptyTreeIterator
Résultat GitSharp.Core.TreeWalk.EmptyTreeIterator

createSubtreeIterator() public abstract méthode

public abstract createSubtreeIterator ( Repository repo ) : AbstractTreeIterator
repo Repository
Résultat AbstractTreeIterator

createSubtreeIterator() public méthode

public createSubtreeIterator ( Repository repo, MutableObjectId idBuffer, WindowCursor curs ) : AbstractTreeIterator
repo Repository
idBuffer MutableObjectId
curs WindowCursor
Résultat AbstractTreeIterator

ensurePathCapacity() protected méthode

Ensure that path is capable to hold at least capacity bytes.
protected ensurePathCapacity ( int capacity, int length ) : void
capacity int the amount of bytes to hold
length int the amount of live bytes in path buffer
Résultat void

eof() public abstract méthode

public abstract eof ( ) : bool
Résultat bool

first() public abstract méthode

public abstract first ( ) : bool
Résultat bool

getEntryObjectId() public méthode

Gets the ObjectId of the current entry.
public getEntryObjectId ( ) : ObjectId
Résultat ObjectId

getEntryObjectId() public méthode

Gets the ObjectId of the current entry.
public getEntryObjectId ( MutableObjectId objectId ) : void
objectId MutableObjectId buffer to copy the object id into.
Résultat void

getName() public méthode

Get the name component of the current entry path into the provided buffer.
public getName ( byte buffer, int offset ) : void
buffer byte /// The buffer to get the name into, it is assumed that buffer can hold the name. ///
offset int /// The offset of the name in the ///
Résultat void

growPath() public méthode

Grow the _path buffer larger.
public growPath ( int len ) : void
len int /// Number of live bytes in the path buffer. This many bytes will /// be moved into the larger buffer. ///
Résultat void

idBuffer() public abstract méthode

Get the byte array buffer object IDs must be copied out of. The id buffer contains the bytes necessary to construct an ObjectId for the current entry of this iterator. The buffer can be the same buffer for all entries, or it can be a unique buffer per-entry. Implementations are encouraged to expose their private buffer whenever possible to reduce garbage generation and copying costs.
public abstract idBuffer ( ) : byte[]
Résultat byte[]

idEqual() public méthode

Check if the current entry of both iterators has the same id. This method is faster than getEntryObjectId()as it does not require copying the bytes out of the buffers. A direct idBuffer compare operation is performed.
public idEqual ( AbstractTreeIterator otherIterator ) : bool
otherIterator AbstractTreeIterator the other iterator to test against.
Résultat bool

idOffset() public abstract méthode

public abstract idOffset ( ) : int
Résultat int

next() public abstract méthode

public abstract next ( int delta ) : void
delta int
Résultat void

pathCompare() public méthode

Compare the path of this current entry to another iterator's entry.
public pathCompare ( AbstractTreeIterator treeIterator ) : int
treeIterator AbstractTreeIterator /// The other iterator to compare the path against. ///
Résultat int

pathCompare() public méthode

Compare the path of this current entry to another iterator's entry.
public pathCompare ( AbstractTreeIterator treeIterator, int treeIteratorMode ) : int
treeIterator AbstractTreeIterator /// The other iterator to compare the path against. ///
treeIteratorMode int /// The other iterator bits. ///
Résultat int

skip() public méthode

Advance to the next tree entry, populating this iterator with its data. This method behaves like seek(1) but is called by TreeWalk only if a TreeFilter was used and ruled out the current entry from the results. In such cases this tree iterator may perform special behavior.
public skip ( ) : void
Résultat void

stopWalk() public méthode

Indicates to the iterator that no more entries will be Read. This is only invoked by TreeWalk when the iteration is aborted early due to a StopWalkException being thrown from within a TreeFilter.
public stopWalk ( ) : void
Résultat void

Property Details

DEFAULT_PATH_SIZE public_oe static_oe property

Default size for the Path buffer.
public static int DEFAULT_PATH_SIZE
Résultat int

ZeroId protected_oe static_oe property

A dummy ObjectId buffer that matches the zero ObjectId.
protected static byte[] ZeroId
Résultat byte[]