FCohtmlScriptCompiler
Public Classes
Name | |
---|---|
struct | ScriptCompilerDeleter |
Public Functions
Name | |
---|---|
FCohtmlScriptCompiler(FCohtmlSystemWrapperSharedPtr InExistingSystem) | |
CohtmlCompiledScriptData | CompileScript(const FString & FilePath, TArray< uint8 > FileData =TArray< uint8 >()) Compile a script for faster initial execution later. |
Public Attributes
Name | |
---|---|
FCriticalSection | ConcurrentCompileGuard |
TUniquePtr< cohtml::ScriptCompiler, ScriptCompilerDeleter > | ScriptCompiler |
FCohtmlSystemWrapperSharedPtr | ExistingSystem |
Public Functions Documentation
function FCohtmlScriptCompiler
FCohtmlScriptCompiler(
FCohtmlSystemWrapperSharedPtr InExistingSystem
)
function CompileScript
CohtmlCompiledScriptData CompileScript(
const FString & FilePath,
TArray< uint8 > FileData =TArray< uint8 >()
)
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. 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.
Note: Can be called on multiple threads, but only one call can be processed at a time.
Public Attributes Documentation
variable ConcurrentCompileGuard
FCriticalSection ConcurrentCompileGuard;
variable ScriptCompiler
TUniquePtr< cohtml::ScriptCompiler, ScriptCompilerDeleter > ScriptCompiler;
variable ExistingSystem
FCohtmlSystemWrapperSharedPtr ExistingSystem;