Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Script::anonymous_namespace{ModuleLoader.cpp} Namespace Reference

Functions

VfsPath GetBaseFilename (const VfsPath &filename)
 When provided with an appendix name (containing a "~" and ending with ".append.js") the name of the base file is returned. More...
 
std::vector< VfsPath > GetAppendices (const VfsPath &baseFilepath)
 
std::string GetCode (const ModuleLoader::AllowModuleFunc &allowModule, const VfsPath &filePath)
 
template<typename Requester >
JSObject * CompileModule (const Script::Request &rq, const ModuleLoader::AllowModuleFunc &allowModule, ModuleLoader::RegistryType &registry, const VfsPath &filePath, Requester &&requester)
 
JSObject * Resolve (const Script::Request &rq, const ModuleLoader::AllowModuleFunc &allowModule, ModuleLoader::RegistryType &registry, JS::HandleValue referencingModule, JS::HandleObject moduleRequest)
 
JSObject * Evaluate (const Script::Request &rq, JS::HandleObject mod)
 
Status FileChangedHook (void *param, const VfsPath &changedFile)
 
template<bool reject>
bool Call (JSContext *cx, const unsigned argc, JS::Value *vp)
 

Variables

template<bool reject>
constexpr JSClassOps callbackClassOps
 
template<bool reject>
constexpr JSClass callbackClass {"Callback", JSCLASS_HAS_RESERVED_SLOTS(1), &callbackClassOps<reject>}
 

Function Documentation

◆ Call()

template<bool reject>
bool Script::anonymous_namespace{ModuleLoader.cpp}::Call ( JSContext *  cx,
const unsigned  argc,
JS::Value *  vp 
)

◆ CompileModule()

template<typename Requester >
JSObject * Script::anonymous_namespace{ModuleLoader.cpp}::CompileModule ( const Script::Request &  rq,
const ModuleLoader::AllowModuleFunc &  allowModule,
ModuleLoader::RegistryType &  registry,
const VfsPath &  filePath,
Requester &&  requester 
)

◆ Evaluate()

JSObject * Script::anonymous_namespace{ModuleLoader.cpp}::Evaluate ( const Script::Request &  rq,
JS::HandleObject  mod 
)

◆ FileChangedHook()

Status Script::anonymous_namespace{ModuleLoader.cpp}::FileChangedHook ( void *  param,
const VfsPath &  changedFile 
)

◆ GetAppendices()

std::vector< VfsPath > Script::anonymous_namespace{ModuleLoader.cpp}::GetAppendices ( const VfsPath &  baseFilepath)

◆ GetBaseFilename()

VfsPath Script::anonymous_namespace{ModuleLoader.cpp}::GetBaseFilename ( const VfsPath &  filename)

When provided with an appendix name (containing a "~" and ending with ".append.js") the name of the base file is returned.

When it's not an appendix name an empty string is returned. E.g. "base_file~mod_name.append.js" -> "base_file.js" "base-name~0.append.js" -> "base-name.js" "base_file~mod_name.js" -> "" "base_file_mod_name.append.js" -> ""

◆ GetCode()

std::string Script::anonymous_namespace{ModuleLoader.cpp}::GetCode ( const ModuleLoader::AllowModuleFunc &  allowModule,
const VfsPath &  filePath 
)

◆ Resolve()

JSObject * Script::anonymous_namespace{ModuleLoader.cpp}::Resolve ( const Script::Request &  rq,
const ModuleLoader::AllowModuleFunc &  allowModule,
ModuleLoader::RegistryType &  registry,
JS::HandleValue  referencingModule,
JS::HandleObject  moduleRequest 
)

Variable Documentation

◆ callbackClass

template<bool reject>
constexpr JSClass Script::anonymous_namespace{ModuleLoader.cpp}::callbackClass {"Callback", JSCLASS_HAS_RESERVED_SLOTS(1), &callbackClassOps<reject>}
constexpr

◆ callbackClassOps

template<bool reject>
constexpr JSClassOps Script::anonymous_namespace{ModuleLoader.cpp}::callbackClassOps
constexpr
Initial value:
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
Call<reject>, nullptr, nullptr}