mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Move require path into filesystem module
--HG-- branch : minor
This commit is contained in:
@@ -77,6 +77,7 @@ Filesystem::Filesystem()
|
||||
, fused(false)
|
||||
, fusedSet(false)
|
||||
{
|
||||
requirePath = {"?.lua", "?/init.lua"};
|
||||
}
|
||||
|
||||
Filesystem::~Filesystem()
|
||||
@@ -671,6 +672,11 @@ bool Filesystem::isSymlink(const char *filename) const
|
||||
return PHYSFS_isSymbolicLink(filename) != 0;
|
||||
}
|
||||
|
||||
std::vector<std::string> &Filesystem::getRequirePath()
|
||||
{
|
||||
return requirePath;
|
||||
}
|
||||
|
||||
} // physfs
|
||||
} // filesystem
|
||||
} // love
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// LOVE
|
||||
#include "common/Module.h"
|
||||
@@ -262,6 +263,10 @@ public:
|
||||
**/
|
||||
static int lines_i(lua_State *L);
|
||||
|
||||
// Require path accessors
|
||||
// Not const because it's R/W
|
||||
std::vector<std::string> &getRequirePath();
|
||||
|
||||
private:
|
||||
|
||||
// Contains the current working directory (UTF8).
|
||||
@@ -290,6 +295,9 @@ private:
|
||||
bool fused;
|
||||
bool fusedSet;
|
||||
|
||||
// Search path for require
|
||||
std::vector<std::string> requirePath;
|
||||
|
||||
}; // Filesystem
|
||||
|
||||
} // physfs
|
||||
|
||||
Reference in New Issue
Block a user