Table of Contents

Interface IContentCache

Namespace
MonoGame.Framework.Content.Pipeline.Builder
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

builder ContentBuilder

A 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

builder ContentBuilder

A ContentBuilder that the cache file is related to.

info ContentInfo

A ContentInfo for which to create the IContentFileCache for.

Returns

IContentFileCache

FlushCache(ContentBuilder)

Saves any pending content cache information to disk for the specified builder.

void FlushCache(ContentBuilder builder)

Parameters

builder ContentBuilder

A ContentBuilder that the cache file is related to.

LoadCache(ContentBuilder)

Loads the content cache for the specified builder.

void LoadCache(ContentBuilder builder)

Parameters

builder ContentBuilder

A 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

fileCache IContentFileCache

An 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

builder ContentBuilder

A ContentBuilder that the cache file is related to.

relativeDstPath string

A relative path to the content file.

Returns

IContentFileCache

An instance of ContentFileCache if cached information about the content is found, null otherwise.

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

builder ContentBuilder

A ContentBuilder that the cache file is related to.

relativeDstPath string

A relative path to the content file.

fileCache IContentFileCache

An insteance of IContentFileCache that contains information about the built content.