[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'LazFileCache' (#lazutils)

TFileStateCache.FindFile

Gets (or creates) the cached item with the specified name.

Declaration

Source position: lazfilecache.pas line 85

public function TFileStateCache.FindFile(

  const Filename: string;

  CreateIfNotExists: Boolean

):TFileStateCacheItem;

Arguments

Filename

  

Name for the file or directory to locate in the cache.

CreateIfNotExists

  

True to create a cache item if it does not already exist.

Function result

Cached item with the specified name, or Nil.

Description

FindFile is a TFileStateCacheItem function used to get, or optionally create, a cache entry for the file or directory in Filename.

FindFile resolves a relative path used in Filename by calling the ResolveDots routine. The normalized name is used to get the TFileStateCacheItem instance in the cache used as the return value for the method.

If Filename was not found in the cache, and CreateIfNotExists is set to True, a TFileStateCacheItem instance is created with the Timestamp for the cache and added to the internal storage. An Exception is raised if the cache item could not be added (and retrieved) using the internal AVL tree storage.

If Filename was not found in the cache, and CreateIfNotExists is set to False, the return value is Nil.

FindFile is used to implement the Check and IncreaseTimeStamp methods.

See also

TFileStateCache.TimeStamp

  

Timestamp (or revision) value for the cache storage.

TFileStateCache.Check

  

Checks the specified cache item to get a specific flag value.

TFileStateCache.IncreaseTimeStamp

  

Increments the change counter or updates an item in the state cache.

TFileStateCacheItem

  

Contains information about a file or directory in the state caching mechanism.


Version 4.0 Generated 2025-05-03 Home