Atlas-Launcher/source/javascript/module/file_system/FsJsModule.cpp

15 lines
425 B
C++

#include "FsJsModule.hpp"
#include "object/FileJsObject.hpp"
#include "object/PathJsObject.hpp"
FsJsModule::FsJsModule(AtlasJsEngine* engine) : BaseJsModule(engine) {}
QJSValue FsJsModule::newPath(const QString& virtualPath) const {
// TODO(Faraphel): risk of memory leak ?
return this->engine->newQObject(new PathJsObject(
this->engine,
std::filesystem::path(virtualPath.toStdString())
));
}