Exemplo n.º 1
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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 3
0
 protected FileContents(FileContentsMemory contents, DateTime utcLastModified) {
   _contents = contents;
   _utcLastModified = utcLastModified;
   _hash = new Lazy<FileContentsHash>(CreateHash);
 }
Exemplo n.º 4
0
 protected FileContents(FileContentsMemory contents, DateTime utcLastModified)
 {
     _contents        = contents;
     _utcLastModified = utcLastModified;
     _hash            = new Lazy <FileContentsHash>(CreateHash);
 }
Exemplo n.º 5
0
 public AsciiFileContents(FileContentsMemory heap, DateTime utcLastWriteTime)
     : base(utcLastWriteTime)
 {
     _heap = heap;
 }
Exemplo n.º 6
0
 public AsciiTextLineOffsets(FileContentsMemory heap) {
   _impl = new TextLineOffsetsImpl(heap, sizeof(byte));
   _impl.CollectLineOffsets();
 }
Exemplo n.º 7
0
 private static string CreateHash(FileContentsMemory memory)
 {
     using (var stream = memory.CreateSteam()) {
         return(MD5Hash.CreateHash(stream));
     }
 }
Exemplo n.º 8
0
 public FileContentsHash(FileContentsMemory memory)
 {
     _md5      = CreateHash(memory);
     _hashCode = StringComparer.Ordinal.GetHashCode(_md5);
 }
Exemplo n.º 9
0
 public AsciiTextLineOffsets(FileContentsMemory heap)
 {
     _heap       = heap;
     _blockStart = (byte *)heap.ContentsPointer.ToPointer();
     _blockEnd   = _blockStart + heap.ContentsByteLength;
 }
Exemplo n.º 10
0
 public AsciiFileContents(FileContentsMemory contents, DateTime utcLastModified)
   : base(contents, utcLastModified) {
 }
Exemplo n.º 11
0
 protected FileContents(FileContentsMemory contents, DateTime utcLastModified)
 {
     _contents        = contents;
     _utcLastModified = utcLastModified;
 }
Exemplo n.º 12
0
 public Utf16TextLineOffsets(FileContentsMemory heap) {
   _impl = new TextLineOffsetsImpl(heap, sizeof(char));
   _impl.CollectLineOffsets();
 }
Exemplo n.º 13
0
 public AsciiTextLineOffsets(FileContentsMemory heap)
 {
     _impl = new TextLineOffsetsImpl(heap, sizeof(byte));
     _impl.CollectLineOffsets();
 }
Exemplo n.º 14
0
 public Utf16TextLineOffsets(FileContentsMemory heap)
 {
     _impl = new TextLineOffsetsImpl(heap, sizeof(char));
     _impl.CollectLineOffsets();
 }
Exemplo n.º 15
0
 public AsciiFileContents(FileContentsMemory heap, DateTime utcLastWriteTime)
     : base(utcLastWriteTime)
 {
     _heap = heap;
 }
Exemplo n.º 16
0
 public AsciiFileContents(FileContentsMemory contents, DateTime utcLastModified)
     : base(contents, utcLastModified)
 {
 }
 public AsciiTextLineOffsets(FileContentsMemory heap)
 {
     _heap = heap;
       _blockStart = (byte *)heap.ContentsPointer.ToPointer();
       _blockEnd = _blockStart + heap.ContentsByteLength;
 }