migrate from std::filesystem::path to io::path (WIP)
This commit is contained in:
@@ -26,10 +26,15 @@ class LuaGeneratorScript : public GeneratorScript {
|
||||
const GeneratorDef& def;
|
||||
scriptenv env = nullptr;
|
||||
|
||||
fs::path file;
|
||||
io::path file;
|
||||
std::string dirPath;
|
||||
public:
|
||||
LuaGeneratorScript(State* L, const GeneratorDef& def, const fs::path& file, const std::string& dirPath)
|
||||
LuaGeneratorScript(
|
||||
State* L,
|
||||
const GeneratorDef& def,
|
||||
const io::path& file,
|
||||
const std::string& dirPath
|
||||
)
|
||||
: L(L), def(def), file(file), dirPath(dirPath) {
|
||||
}
|
||||
|
||||
@@ -54,10 +59,10 @@ public:
|
||||
|
||||
pop(L);
|
||||
|
||||
if (fs::exists(file)) {
|
||||
if (io::exists(file)) {
|
||||
std::string src = io::read_string(file);
|
||||
logger.info() << "script (generator) " << file.u8string();
|
||||
pop(L, execute(L, *env, src, file.u8string()));
|
||||
logger.info() << "script (generator) " << file.string();
|
||||
pop(L, execute(L, *env, src, file.string()));
|
||||
} else {
|
||||
// Use default (empty) script
|
||||
pop(L, execute(L, *env, "", "<empty>"));
|
||||
@@ -252,7 +257,7 @@ public:
|
||||
|
||||
std::unique_ptr<GeneratorScript> scripting::load_generator(
|
||||
const GeneratorDef& def,
|
||||
const fs::path& file,
|
||||
const io::path& file,
|
||||
const std::string& dirPath
|
||||
) {
|
||||
auto L = create_state(engine->getPaths(), StateType::GENERATOR);
|
||||
|
||||
Reference in New Issue
Block a user