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.
파일 보기 프로젝트 열기: stschake/GitSharp 1 사용 예제들

공개 메소드들

메소드 설명
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