CClash.FileCacheStore.ContainsEntry C# (CSharp) Method

ContainsEntry() public method

public ContainsEntry ( string key, string filename ) : bool
key string
filename string
return bool
        public bool ContainsEntry(string key, string filename)
        {
            var p = MakePath(key, filename);
            if (CacheEntryChecksInMemory)
            {
                if (entryCache.Contains(p))
                {
                    return true;
                }
            }
            var rv = FileUtils.Exists(p);
            if (CacheEntryChecksInMemory && rv)
            {
                entryCache.Add(p);
            }
            return rv;
        }

Usage Example

        protected CacheManifest GetCachedManifestLocked(DataHash commonkey)
        {
            CacheManifest manifest = null;

            if (outputCache.ContainsEntry(commonkey.Hash, F_Manifest))
            {
                var mn = outputCache.MakePath(commonkey.Hash, F_Manifest);
                using (var fs = new FileStream(mn, FileMode.Open)){
                    manifest = CacheManifest.Deserialize(fs);
                }
            }

            return(manifest);
        }
All Usage Examples Of CClash.FileCacheStore::ContainsEntry