Interface IContentCache
- Assembly
- MonoGame.Framework.Content.Pipeline.dll
An interface for storing information about the compiled content.
public interface IContentCache
Methods
CleanCache(ContentBuilder)
Clears out any unused content files from the cache and the disk that were not marked by MarkUsed(IContentFileCache).
void CleanCache(ContentBuilder builder)
Parameters
builderContentBuilderA ContentBuilder that the cache file is related to.
CreateContentFileCache(ContentBuilder, ContentInfo)
Creates a new insteance of IContentFileCache that the current implementation of IContentCache uses.
IContentFileCache CreateContentFileCache(ContentBuilder builder, ContentInfo info)
Parameters
builderContentBuilderA ContentBuilder that the cache file is related to.
infoContentInfoA ContentInfo for which to create the IContentFileCache for.
Returns
FlushCache(ContentBuilder)
Saves any pending content cache information to disk for the specified builder.
void FlushCache(ContentBuilder builder)
Parameters
builderContentBuilderA ContentBuilder that the cache file is related to.
LoadCache(ContentBuilder)
Loads the content cache for the specified builder.
void LoadCache(ContentBuilder builder)
Parameters
builderContentBuilderA ContentBuilder that the cache file is related to.
MarkUsed(IContentFileCache)
Marks the specified IContentFileCache as being used by the ContentBuilder and that is should not get cleaned up by the CleanCache(ContentBuilder)
void MarkUsed(IContentFileCache fileCache)
Parameters
fileCacheIContentFileCacheAn insteance of IContentFileCache that contains information about the built content.
ReadContentFileCache(ContentBuilder, string)
Reads (from memory or disk) cached information about the content file and returns it if its valid.
IContentFileCache? ReadContentFileCache(ContentBuilder builder, string relativeDstPath)
Parameters
builderContentBuilderA ContentBuilder that the cache file is related to.
relativeDstPathstringA relative path to the content file.
Returns
- IContentFileCache
An instance of ContentFileCache if cached information about the content is found,
nullotherwise.
WriteContentFileCache(ContentBuilder, string, IContentFileCache?)
Writes down (to memory or disk) information about the content file.
Do note that FlushCache(ContentBuilder) will always be called before exiting the content builder.
void WriteContentFileCache(ContentBuilder builder, string relativeDstPath, IContentFileCache? fileCache)
Parameters
builderContentBuilderA ContentBuilder that the cache file is related to.
relativeDstPathstringA relative path to the content file.
fileCacheIContentFileCacheAn insteance of IContentFileCache that contains information about the built content.