FCohtmlScriptProvider

Inherits from ICohtmlScriptProvider

Public Functions

Name
virtual FCohtmlCompiledScriptDataPtrGetScriptCacheEntry(const FString & FilePath) override
virtual voidAddScriptCacheEntry(const FString & FilePath, const CohtmlCompiledScriptData & Data)
virtual TMap< FString, FCohtmlCompiledScriptDataPtr > &ModifyCachedScripts()
Returns a reference to all currently cached compiled scripts. This is useful for saving them to disk, packaging them, or modifying them after the pre-loading process has finished.
virtual voidSetCachedScripts(TMap< FString, FCohtmlCompiledScriptDataPtr > && ScriptCollection)
virtual voidRemoveScriptCacheEntry(const FString & FilePath)
virtual voidClearScriptCache()
Removes all cached scripts from memory.
virtual~FCohtmlScriptProvider() =default

Protected Attributes

Name
TMap< FString, FCohtmlCompiledScriptDataPtr >CachedScripts

Additional inherited members

Public Functions inherited from ICohtmlScriptProvider

Name
virtual~ICohtmlScriptProvider() =default

Public Functions Documentation

function GetScriptCacheEntry

virtual FCohtmlCompiledScriptDataPtr GetScriptCacheEntry(
    const FString & FilePath
) override

Parameters:

  • FilePath - A relative or absolute path to a given JavaScript file. Relative path should be with respect to the working directory. Will return a script from the internal TMap storage if such exists, or nullptr.

Reimplements: ICohtmlScriptProvider::GetScriptCacheEntry

function AddScriptCacheEntry

virtual void AddScriptCacheEntry(
    const FString & FilePath,
    const CohtmlCompiledScriptData & Data
)

Parameters:

  • FilePath - A relative or absolute path to a given JavaScript file. Relative path should be with respect to the working directory. The path needs to serve as a unique id for the data provided, so it can be retrieved later.

function ModifyCachedScripts

virtual TMap< FString, FCohtmlCompiledScriptDataPtr > & ModifyCachedScripts()

Returns a reference to all currently cached compiled scripts. This is useful for saving them to disk, packaging them, or modifying them after the pre-loading process has finished.

function SetCachedScripts

virtual void SetCachedScripts(
    TMap< FString, FCohtmlCompiledScriptDataPtr > && ScriptCollection
)

function RemoveScriptCacheEntry

virtual void RemoveScriptCacheEntry(
    const FString & FilePath
)

Parameters:

  • FilePath - A relative or absolute path to a given JavaScript file. Relative path should be with respect to the working directory. Removes a single cached script from memory.

function ClearScriptCache

virtual void ClearScriptCache()

Removes all cached scripts from memory.

function ~FCohtmlScriptProvider

virtual ~FCohtmlScriptProvider() =default

Protected Attributes Documentation

variable CachedScripts

TMap< FString, FCohtmlCompiledScriptDataPtr > CachedScripts;