Example #1
0
        public bool KnowFileExists(string outputFilename)
        {
            string path = GetPath(outputFilename);

            Manifest.ManifestRecord manifestRecord = manifest.FindFirstEqual(path);
            return(manifestRecord.fileExists);
        }
Example #2
0
 internal Manifest.ManifestRecord FindFirstEqual(string path)
 {
     Manifest.ManifestRecord manifestRecord = this.FindFirstGreaterEqual(path);
     if (manifestRecord.path == path)
     {
         return(manifestRecord);
     }
     return(Manifest.ManifestRecord.TailRecord);
 }
Example #3
0
 public void Remove(string p)
 {
     Manifest.ManifestRecord manifestRecord = this.FindFirstEqual(p);
     if (manifestRecord.IsTailRecord)
     {
         return;
     }
     manifestRecord.fileExists = false;
     manifestRecord.fileLength = -1L;
 }
        public FileIdentification GetFileIdentification(string relativePath)
        {
            string path = this.GetPath(relativePath);

            Manifest.ManifestRecord manifestRecord = this.manifest.FindFirstEqual(path);
            if (!manifestRecord.fileExists)
            {
                return(new FileIdentification(-1L));
            }
            return(new FileIdentification(manifestRecord.fileLength));
        }
 public void EmptyDirectory()
 {
     Manifest.ManifestRecord manifestRecord = this.manifest.FindFirstGreaterEqual(this.basePath);
     while (!manifestRecord.IsTailRecord && manifestRecord.path.StartsWith(this.basePath))
     {
         if (manifestRecord.fileExists)
         {
             this.manifest.Remove(manifestRecord.path);
         }
         manifestRecord = this.manifest.FindFirstGreaterThan(manifestRecord.path);
     }
     this.CommitChanges();
     this.baseMethod.EmptyDirectory();
 }
Example #6
0
 internal void Add(string path, long fileLength)
 {
     Manifest.ManifestRecord manifestRecord = this.FindFirstGreaterEqual(path);
     if (manifestRecord.path == path)
     {
         manifestRecord.fileExists = true;
         manifestRecord.fileLength = fileLength;
         return;
     }
     Manifest.ManifestBlock  manifestBlock = (manifestRecord.block == null) ? this.rootBlock : manifestRecord.block;
     Manifest.ManifestRecord newRecord     = new Manifest.ManifestRecord(manifestBlock, path, true, fileLength, -1);
     manifestBlock.Insert(newRecord, manifestRecord);
     if (manifestBlock.Count > this.rootBlock.superBlock.splitThreshold)
     {
         manifestBlock.Split(new Manifest.ManifestBlock.CreateBlock(this.CreateBlock));
     }
 }