Skip to content
SiteEmail

cohtml::ScriptCompiler

#include <Library.h>

Name
enumScriptType { ST_Classic, ST_Module}
The enumeration tells the ScriptCompiler how to compile the provided source.
Name
virtual DataBuffer *Compile(DataBuffer * utf8Source, ScriptType scriptType) =0
Compiles a script file synchronously.
virtual voidDestroy() =0
Destroys the ScriptCompiler and frees memory.
Name
virtual~ScriptCompiler()
EnumeratorValueDescription
ST_ClassicTry to compile the provided source as a classic script.
ST_ModuleTry to compile the provided source as a module.

The enumeration tells the ScriptCompiler how to compile the provided source.

virtual DataBuffer * Compile(
DataBuffer * utf8Source,
ScriptType scriptType
) =0

Compiles a script file synchronously.

Parameters:

  • utf8Source a data buffer, containing an utf8 encoded script source
  • scriptType specify if the provided source is classic script or module

Return: A data buffer, containing the compiled data.

virtual void Destroy() =0

Destroys the ScriptCompiler and frees memory.

virtual ~ScriptCompiler()