mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 14:07:46 +00:00
44 lines
904 B
C++
44 lines
904 B
C++
#ifndef SAPPHIRE_SCRIPTLOADER_H
|
|
#define SAPPHIRE_SCRIPTLOADER_H
|
|
|
|
#include <string>
|
|
#include "NativeScriptApi.h"
|
|
#include "ScriptInfo.h"
|
|
#include <unordered_map>
|
|
|
|
#ifdef _WIN32
|
|
#include <windows.h>
|
|
typedef HMODULE ModuleHandle;
|
|
#else
|
|
#include <dlfcn.h>
|
|
typedef void* ModuleHandle;
|
|
#endif
|
|
|
|
namespace Core {
|
|
namespace Scripting {
|
|
|
|
class ScriptLoader {
|
|
protected:
|
|
std::unordered_map< std::string, ScriptInfo* > m_scriptMap;
|
|
|
|
bool unloadModule( ModuleHandle );
|
|
|
|
public:
|
|
ScriptLoader();
|
|
|
|
const std::string getModuleExtension();
|
|
ScriptInfo* loadModule( const std::string& );
|
|
bool unloadScript( ScriptInfo* );
|
|
bool unloadScript( ModuleHandle );
|
|
ScriptInfo* getScriptInfo( std::string name );
|
|
ScriptObject* getScriptObject(ModuleHandle handle);
|
|
bool isModuleLoaded( std::string name );
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif //SAPPHIRE_SCRIPTLOADER_H
|