Skip to content
SiteEmail

FCohtmlScriptCompiler

Name
structScriptCompilerDeleter
Name
FCohtmlScriptCompiler(FCohtmlSystemWrapperSharedPtr InExistingSystem)
CohtmlCompiledScriptDataCompileScript(const FString & FilePath, TArray< uint8 > FileData =TArray< uint8 >(), bool IsModule =false)
Compile a script for faster initial execution later.
Name
FCriticalSectionConcurrentCompileGuard
TUniquePtr< cohtml::ScriptCompiler, ScriptCompilerDeleter >ScriptCompiler
FCohtmlSystemWrapperSharedPtrExistingSystem
FCohtmlScriptCompiler(
FCohtmlSystemWrapperSharedPtr InExistingSystem
)
CohtmlCompiledScriptData CompileScript(
const FString & FilePath,
TArray< uint8 > FileData =TArray< uint8 >(),
bool IsModule =false
)

Compile a script for faster initial execution later.

Parameters:

  • FilePath - A relative (with respect to the working dir) or absolute path to a given JavaScript file.
  • FileData - optional array with the contents of the file, which must be in UTF8. If FileData is provided, the FilePath will not be accessed/read.
  • IsModule - whether the supplied script will be used as module or script. Wrong compile data will be rejected by V8. Should log warnings/errors on unsuccessful pre-compilation, file not found, or other similar errors that might arise.

Return: Structure with the compiled JS data and the file contents. If compilation is not successful, CohtmlCompiledScriptData::CompiledData will be nullptr.

FCriticalSection ConcurrentCompileGuard;
TUniquePtr< cohtml::ScriptCompiler, ScriptCompilerDeleter > ScriptCompiler;
FCohtmlSystemWrapperSharedPtr ExistingSystem;