public TextLineOffsetsImpl(FileContentsMemory heap, int characterSize) { // Only ascii and unicode. if (characterSize != 1 && characterSize != 2) { throw new ArgumentException(); } _heap = heap; _characterSize = characterSize; _blockStart = (byte *)heap.Pointer.ToPointer(); _blockEnd = _blockStart + heap.ByteLength; }
protected FileContents(FileContentsMemory contents, DateTime utcLastModified) { _contents = contents; _utcLastModified = utcLastModified; _hash = new Lazy<FileContentsHash>(CreateHash); }
protected FileContents(FileContentsMemory contents, DateTime utcLastModified) { _contents = contents; _utcLastModified = utcLastModified; _hash = new Lazy <FileContentsHash>(CreateHash); }
public AsciiFileContents(FileContentsMemory heap, DateTime utcLastWriteTime) : base(utcLastWriteTime) { _heap = heap; }
public AsciiTextLineOffsets(FileContentsMemory heap) { _impl = new TextLineOffsetsImpl(heap, sizeof(byte)); _impl.CollectLineOffsets(); }
private static string CreateHash(FileContentsMemory memory) { using (var stream = memory.CreateSteam()) { return(MD5Hash.CreateHash(stream)); } }
public FileContentsHash(FileContentsMemory memory) { _md5 = CreateHash(memory); _hashCode = StringComparer.Ordinal.GetHashCode(_md5); }
public AsciiTextLineOffsets(FileContentsMemory heap) { _heap = heap; _blockStart = (byte *)heap.ContentsPointer.ToPointer(); _blockEnd = _blockStart + heap.ContentsByteLength; }
public AsciiFileContents(FileContentsMemory contents, DateTime utcLastModified) : base(contents, utcLastModified) { }
protected FileContents(FileContentsMemory contents, DateTime utcLastModified) { _contents = contents; _utcLastModified = utcLastModified; }
public Utf16TextLineOffsets(FileContentsMemory heap) { _impl = new TextLineOffsetsImpl(heap, sizeof(char)); _impl.CollectLineOffsets(); }