C# Класс GitSharp.Core.DirectoryCache.DirCacheEntry

A single file (or stage of a file) in a DirCache. An entry represents exactly one stage of a file. If a file path is unmerged then multiple DirCacheEntry instances may appear for the same path name.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
DirCacheEntry ( byte newPath ) : System

Create an empty entry at stage 0.

DirCacheEntry ( byte newPath, int stage ) : System

Create an empty entry at the specified stage.

DirCacheEntry ( byte sharedInfo, int infoAt, Stream @in, MessageDigest md ) : System
DirCacheEntry ( string newPath ) : System

Create an empty entry at stage 0.

DirCacheEntry ( string newPath, int stage ) : System

Create an empty entry at the specified stage.

copyMetaData ( DirCacheEntry src ) : void

Copy the ObjectId and other meta fields from an existing entry. This method copies everything except the path from one entry to another, supporting renaming.

getFileMode ( ) : FileMode

Obtain the FileMode for this entry.

getLastModified ( ) : long

Get the cached last modification date of this file, in milliseconds. One of the indicators that the file has been modified by an application changing the working tree is if the last modification time for the file differs from the time stored in this entry.

getLength ( ) : int

Get the cached size (in bytes) of this file. One of the indicators that the file has been modified by an application changing the working tree is if the size of the file (in bytes) differs from the size stored in this entry. Note that this is the length of the file in the working directory, which may differ from the size of the decompressed blob if work tree filters are being used, such as LF<->CRLF conversion.

getObjectId ( ) : ObjectId

Obtain the ObjectId for the entry. Using this method to compare ObjectId values between entries is inefficient as it causes memory allocation.

getPathString ( ) : string

Get the entry's complete path. This method is not very efficient and is primarily meant for debugging and final output generation. Applications should try to avoid calling it, and if invoked do so only once per interesting entry, where the name is absolutely required for correct function.

getRawMode ( ) : int

Obtain the raw FileMode bits for this entry.

getStage ( ) : int

Get the stage of this entry. Entries have one of 4 possible stages: 0-3.

idBuffer ( ) : byte[]
idOffset ( ) : int
isAssumeValid ( ) : bool

Is this entry always thought to be unmodified? Most entries in the index do not have this flag set. Users may however set them on if the file system stat() costs are too high on this working directory, such as on NFS or SMB volumes.

mightBeRacilyClean ( int smudge_s, int smudge_ns ) : bool

Is it possible for this entry to be accidentally assumed clean? The "racy git" problem happens when a work file can be updated faster than the filesystem records file modification timestamps. It is possible for an application to edit a work file, update the index, then edit it again before the filesystem will give the work file a new modification timestamp. This method tests to see if file was written out at the same time as the index.

setAssumeValid ( bool assume ) : void

Set the assume valid flag for this entry,

setFileMode ( FileMode mode ) : void

Set the file mode for this entry.

setLastModified ( long when ) : void

Set the cached last modification date of this file, using milliseconds.

setLength ( int sz ) : void

Set the cached size (in bytes) of this file.

setObjectId ( AnyObjectId id ) : void

Set the ObjectId for the entry.

setObjectIdFromRaw ( byte bs, int p ) : void

Set the ObjectId for the entry from the raw binary representation.

smudgeRacilyClean ( ) : void

Force this entry to no longer match its working tree file. This avoids the "racy git" problem by making this index entry no longer match the file in the working directory. Later git will be forced to compare the file content to ensure the file matches the working tree.

write ( Stream os ) : void

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

Метод Описание
DecodeTimestamp ( int pIdx ) : long
EncodeTimestamp ( int pIdx, long when ) : void

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

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

Create an empty entry at stage 0.
public DirCacheEntry ( byte newPath ) : System
newPath byte /// name of the cache entry, in the standard encoding. ///
Результат System

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

Create an empty entry at the specified stage.
public DirCacheEntry ( byte newPath, int stage ) : System
newPath byte /// Name of the cache entry, in the standard encoding. ///
stage int The stage index of the new entry.
Результат System

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

public DirCacheEntry ( byte sharedInfo, int infoAt, Stream @in, MessageDigest md ) : System
sharedInfo byte
infoAt int
@in Stream
md GitSharp.Core.Util.MessageDigest
Результат System

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

Create an empty entry at stage 0.
public DirCacheEntry ( string newPath ) : System
newPath string Name of the cache entry.
Результат System

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

Create an empty entry at the specified stage.
public DirCacheEntry ( string newPath, int stage ) : System
newPath string name of the cache entry.
stage int the stage index of the new entry.
Результат System

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

Copy the ObjectId and other meta fields from an existing entry. This method copies everything except the path from one entry to another, supporting renaming.
public copyMetaData ( DirCacheEntry src ) : void
src DirCacheEntry /// The entry to copy ObjectId and meta fields from. ///
Результат void

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

Obtain the FileMode for this entry.
public getFileMode ( ) : FileMode
Результат FileMode

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

Get the cached last modification date of this file, in milliseconds. One of the indicators that the file has been modified by an application changing the working tree is if the last modification time for the file differs from the time stored in this entry.
public getLastModified ( ) : long
Результат long

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

Get the cached size (in bytes) of this file. One of the indicators that the file has been modified by an application changing the working tree is if the size of the file (in bytes) differs from the size stored in this entry. Note that this is the length of the file in the working directory, which may differ from the size of the decompressed blob if work tree filters are being used, such as LF<->CRLF conversion.
public getLength ( ) : int
Результат int

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

Obtain the ObjectId for the entry. Using this method to compare ObjectId values between entries is inefficient as it causes memory allocation.
public getObjectId ( ) : ObjectId
Результат ObjectId

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

Get the entry's complete path. This method is not very efficient and is primarily meant for debugging and final output generation. Applications should try to avoid calling it, and if invoked do so only once per interesting entry, where the name is absolutely required for correct function.
public getPathString ( ) : string
Результат string

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

Obtain the raw FileMode bits for this entry.
public getRawMode ( ) : int
Результат int

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

Get the stage of this entry. Entries have one of 4 possible stages: 0-3.
public getStage ( ) : int
Результат int

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

public idBuffer ( ) : byte[]
Результат byte[]

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

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

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

Is this entry always thought to be unmodified? Most entries in the index do not have this flag set. Users may however set them on if the file system stat() costs are too high on this working directory, such as on NFS or SMB volumes.
public isAssumeValid ( ) : bool
Результат bool

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

Is it possible for this entry to be accidentally assumed clean? The "racy git" problem happens when a work file can be updated faster than the filesystem records file modification timestamps. It is possible for an application to edit a work file, update the index, then edit it again before the filesystem will give the work file a new modification timestamp. This method tests to see if file was written out at the same time as the index.
public mightBeRacilyClean ( int smudge_s, int smudge_ns ) : bool
smudge_s int /// Seconds component of the index's last modified time. ///
smudge_ns int /// Nanoseconds component of the index's last modified time. ///
Результат bool

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

Set the assume valid flag for this entry,
public setAssumeValid ( bool assume ) : void
assume bool /// True to ignore apparent modifications; false to look at last /// modified to detect file modifications. ///
Результат void

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

Set the file mode for this entry.
public setFileMode ( FileMode mode ) : void
mode FileMode The new mode constant.
Результат void

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

Set the cached last modification date of this file, using milliseconds.
public setLastModified ( long when ) : void
when long /// new cached modification date of the file, in milliseconds. ///
Результат void

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

Set the cached size (in bytes) of this file.
public setLength ( int sz ) : void
sz int new cached size of the file, as bytes.
Результат void

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

Set the ObjectId for the entry.
public setObjectId ( AnyObjectId id ) : void
id AnyObjectId /// New object identifier for the entry. May be /// to remove the current identifier. ///
Результат void

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

Set the ObjectId for the entry from the raw binary representation.
public setObjectIdFromRaw ( byte bs, int p ) : void
bs byte /// The raw byte buffer to read from. At least 20 bytes after /// must be available within this byte array. ///
p int position to read the first byte of data from.
Результат void

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

Force this entry to no longer match its working tree file. This avoids the "racy git" problem by making this index entry no longer match the file in the working directory. Later git will be forced to compare the file content to ensure the file matches the working tree.
public smudgeRacilyClean ( ) : void
Результат void

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

public write ( Stream os ) : void
os Stream
Результат void