Rename DirectoryFileSystem::{physicalPath → PathToPhysical}

This commit is contained in:
yvt 2019-07-20 17:19:34 +09:00
parent 770f11a0d1
commit 92a4b2466f
No known key found for this signature in database
GPG Key ID: 48F2768FA8D07C92
2 changed files with 7 additions and 7 deletions

View File

@ -48,7 +48,7 @@ namespace spades {
DirectoryFileSystem::~DirectoryFileSystem() { SPADES_MARK_FUNCTION(); }
std::string DirectoryFileSystem::physicalPath(const std::string &lg) {
std::string DirectoryFileSystem::PathToPhysical(const std::string &lg) {
// TODO: check ".."?
return rootPath + '/' + lg;
}
@ -82,7 +82,7 @@ namespace spades {
std::vector<std::string> ret;
std::wstring filePath;
std::wstring path = Utf8ToWString(physicalPath(p).c_str());
std::wstring path = Utf8ToWString(PathToPhysical(p).c_str());
// open the Win32 find handle.
h = FindFirstFileExW((path + L"\\*").c_str(), FindExInfoStandard, &fd,
FindExSearchNameMatch, NULL, 0);
@ -116,7 +116,7 @@ namespace spades {
#else
// open the directory.
std::string path = physicalPath(p);
std::string path = PathToPhysical(p);
DIR *dir = opendir(path.c_str());
struct dirent *ent;
@ -149,7 +149,7 @@ namespace spades {
IStream *DirectoryFileSystem::OpenForReading(const char *fn) {
SPADES_MARK_FUNCTION();
std::string path = physicalPath(fn);
std::string path = PathToPhysical(fn);
SDL_RWops *f = SDL_RWFromFile(path.c_str(), "rb");
if (f == NULL) {
SPRaise("I/O error while opening %s for reading: %s", fn, SDL_GetError());
@ -163,7 +163,7 @@ namespace spades {
SPRaise("Writing prohibited for root path '%s'", rootPath.c_str());
}
std::string path = physicalPath(fn);
std::string path = PathToPhysical(fn);
// create required directory
if (path.find_first_of("/\\") != std::string::npos) {
@ -194,7 +194,7 @@ namespace spades {
bool DirectoryFileSystem::FileExists(const char *fn) {
SPADES_MARK_FUNCTION();
std::string path = physicalPath(fn);
std::string path = PathToPhysical(fn);
SDL_RWops *f = SDL_RWFromFile(path.c_str(), "rb");
if (f) {
SDL_RWclose(f);

View File

@ -29,7 +29,7 @@ namespace spades {
std::string rootPath;
bool canWrite;
std::string physicalPath(const std::string &);
std::string PathToPhysical(const std::string &);
public:
DirectoryFileSystem(const std::string &root, bool canWrite = true);