C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DEFAULT_PATH_SIZE int

Защищенные свойства (Protected)

Свойство Тип Описание
ZeroId byte[]

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
AlreadyMatch ( AbstractTreeIterator a, AbstractTreeIterator b ) : int
LastPathChar ( int mode ) : int
SetPathCapacity ( int capacity, int length ) : void

Set path buffer capacity to the specified size

Описание методов

AbstractTreeIterator() защищенный Метод

Create a new iterator with no parent.
protected AbstractTreeIterator ( ) : System
Результат System

AbstractTreeIterator() защищенный Метод

Create an iterator for a subtree of an existing iterator.
protected AbstractTreeIterator ( AbstractTreeIterator p ) : System
p AbstractTreeIterator parent tree iterator.
Результат System

AbstractTreeIterator() защищенный Метод

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 '/'. ///
Результат System

AbstractTreeIterator() защищенный Метод

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 '/'. ///
Результат System

AbstractTreeIterator() защищенный Метод

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 '/'. ///
Результат System

back() публичный абстрактный Метод

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. ///
Результат void

createEmptyTreeIterator() публичный Метод

public createEmptyTreeIterator ( ) : GitSharp.Core.TreeWalk.EmptyTreeIterator
Результат GitSharp.Core.TreeWalk.EmptyTreeIterator

createSubtreeIterator() публичный абстрактный Метод

public abstract createSubtreeIterator ( Repository repo ) : AbstractTreeIterator
repo Repository
Результат AbstractTreeIterator

createSubtreeIterator() публичный Метод

public createSubtreeIterator ( Repository repo, MutableObjectId idBuffer, WindowCursor curs ) : AbstractTreeIterator
repo Repository
idBuffer MutableObjectId
curs WindowCursor
Результат AbstractTreeIterator

ensurePathCapacity() защищенный Метод

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
Результат void

eof() публичный абстрактный Метод

public abstract eof ( ) : bool
Результат bool

first() публичный абстрактный Метод

public abstract first ( ) : bool
Результат bool

getEntryObjectId() публичный Метод

Gets the ObjectId of the current entry.
public getEntryObjectId ( ) : ObjectId
Результат ObjectId

getEntryObjectId() публичный Метод

Gets the ObjectId of the current entry.
public getEntryObjectId ( MutableObjectId objectId ) : void
objectId MutableObjectId buffer to copy the object id into.
Результат void

getName() публичный Метод

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 ///
Результат void

growPath() публичный Метод

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. ///
Результат void

idBuffer() публичный абстрактный Метод

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[]
Результат byte[]

idEqual() публичный Метод

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.
Результат bool

idOffset() публичный абстрактный Метод

public abstract idOffset ( ) : int
Результат int

next() публичный абстрактный Метод

public abstract next ( int delta ) : void
delta int
Результат void

pathCompare() публичный Метод

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. ///
Результат int

pathCompare() публичный Метод

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. ///
Результат int

skip() публичный Метод

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
Результат void

stopWalk() публичный Метод

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
Результат void

Описание свойств

DEFAULT_PATH_SIZE публичное статическое свойство

Default size for the Path buffer.
public static int DEFAULT_PATH_SIZE
Результат int

ZeroId защищенное статическое свойство

A dummy ObjectId buffer that matches the zero ObjectId.
protected static byte[] ZeroId
Результат byte[]