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;
 }
Exemple #2
0
 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;
 }
Exemple #3
0
 protected FileContents(FileContentsMemory contents, DateTime utcLastModified) {
   _contents = contents;
   _utcLastModified = utcLastModified;
   _hash = new Lazy<FileContentsHash>(CreateHash);
 }
Exemple #4
0
 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) {
 }
Exemple #11
0
 protected FileContents(FileContentsMemory contents, DateTime utcLastModified)
 {
     _contents        = contents;
     _utcLastModified = utcLastModified;
 }
 public Utf16TextLineOffsets(FileContentsMemory heap) {
   _impl = new TextLineOffsetsImpl(heap, sizeof(char));
   _impl.CollectLineOffsets();
 }
 public AsciiTextLineOffsets(FileContentsMemory heap)
 {
     _impl = new TextLineOffsetsImpl(heap, sizeof(byte));
     _impl.CollectLineOffsets();
 }
 public Utf16TextLineOffsets(FileContentsMemory heap)
 {
     _impl = new TextLineOffsetsImpl(heap, sizeof(char));
     _impl.CollectLineOffsets();
 }
 public AsciiFileContents(FileContentsMemory heap, DateTime utcLastWriteTime)
     : base(utcLastWriteTime)
 {
     _heap = heap;
 }
 public AsciiFileContents(FileContentsMemory contents, DateTime utcLastModified)
     : base(contents, utcLastModified)
 {
 }
 public AsciiTextLineOffsets(FileContentsMemory heap)
 {
     _heap = heap;
       _blockStart = (byte *)heap.ContentsPointer.ToPointer();
       _blockEnd = _blockStart + heap.ContentsByteLength;
 }