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.

void CleanCache(ContentBuilder builder)

Parameters

builder ContentBuilder

A ContentBuilder that the cache file is related to.

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.

ReadContentFileCache(ContentBuilder, string, string, bool, IContentImporter?, IContentProcessor?)

Reads (from memory or disk) cached information about the content file and returns it if its valid.

ContentFileCache? ReadContentFileCache(ContentBuilder builder, string relativePath, string contentRoot, bool shouldBuild = false, IContentImporter? importer = null, IContentProcessor? processor = null)

Parameters

builder ContentBuilder

A ContentBuilder that the cache file is related to.

relativePath string

A relative path to the content file.

contentRoot string

A relative path that is added as prefix to the output.

shouldBuild bool

If the content file will be built or copied.

importer IContentImporter

An IContentImporter the content file will be passed through.

processor IContentProcessor

An IContentProcessor the content file will be passed through.

Returns

ContentFileCache

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

WriteContentFileCache(ContentBuilder, string, ContentFileCache)

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 relativePath, ContentFileCache fileCache)

Parameters

builder ContentBuilder

A ContentBuilder that the cache file is related to.

relativePath string

A relative path to the content file.

fileCache ContentFileCache

A ContentFileCache containing the information about the source file and compiled content.