1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-28 07:07:45 +00:00
sapphire/src/servers/sapphire_zone/Script/ScriptLoader.h

56 lines
1 KiB
C
Raw Normal View History

2018-03-02 07:39:38 -03:00
#ifndef CORE_SCRIPTLOADER_H
#define CORE_SCRIPTLOADER_H
#include <string>
2017-12-12 17:29:31 +11:00
#include <unordered_map>
#include <set>
#include "NativeScriptApi.h"
#include "ScriptInfo.h"
#ifdef _WIN32
2018-03-04 18:13:05 +11:00
#define WIN32_LEAN_AND_MEAN
2018-03-04 18:13:05 +11:00
#include <winbase.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& );
2017-12-12 17:29:31 +11:00
bool unloadScript( ScriptInfo* );
bool unloadScript( ModuleHandle );
ScriptInfo* getScriptInfo( std::string name );
ScriptObject** getScripts( ModuleHandle handle );
bool isModuleLoaded( std::string name );
void findScripts( std::set< Core::Scripting::ScriptInfo* >& scripts, const std::string& search );
};
}
}
2018-03-02 07:39:38 -03:00
#endif // CORE_SCRIPTLOADER_H