Atlas-Launcher/source/script/module/filesystem/_load.cpp

23 lines
572 B
C++

#include "_load.hpp"
#include <stdexcept>
namespace atlas::script::module::filesystem {
void load(const engine::Engine* atlasEngine) {
asIScriptEngine* asEngine = atlasEngine->getAsEngine();
int error;
// start namespace
error = asEngine->SetDefaultNamespace("atlas::filesystem");
if (error < 0)
throw std::runtime_error("Could not enter the \"atlas::filesystem\" namespace.");
// end namespace
error = asEngine->SetDefaultNamespace("");
if (error < 0)
throw std::runtime_error("Could not reset the namespace.");
}
}