Path类调整
This commit is contained in:
parent
0cf402e6e0
commit
1d9f543eb8
|
|
@ -161,7 +161,7 @@ bool e2d::Image::preload(const String& filePath)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
String actualFilePath = Path::searchForFile(filePath);
|
String actualFilePath = Path::findFile(filePath);
|
||||||
if (actualFilePath.isEmpty())
|
if (actualFilePath.isEmpty())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ bool e2d::Music::open(const e2d::String& filePath)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
String actualFilePath = Path::searchForFile(filePath);
|
String actualFilePath = Path::findFile(filePath);
|
||||||
if (actualFilePath.isEmpty())
|
if (actualFilePath.isEmpty())
|
||||||
{
|
{
|
||||||
WARN("MusicInfo::open File not found.");
|
WARN("MusicInfo::open File not found.");
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ void e2d::Path::setGameFolderName(const String & name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void e2d::Path::add(String path)
|
void e2d::Path::addSearchPath(String path)
|
||||||
{
|
{
|
||||||
path.replace(L"/", L"\\");
|
path.replace(L"/", L"\\");
|
||||||
if (path[path.getLength() - 1] != L'\\')
|
if (path[path.getLength() - 1] != L'\\')
|
||||||
|
|
@ -98,7 +98,7 @@ e2d::String e2d::Path::getExecutableFilePath()
|
||||||
return std::move(String());
|
return std::move(String());
|
||||||
}
|
}
|
||||||
|
|
||||||
e2d::String e2d::Path::searchForFile(const String& path)
|
e2d::String e2d::Path::findFile(const String& path)
|
||||||
{
|
{
|
||||||
if (Path::exists(path))
|
if (Path::exists(path))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -447,13 +447,13 @@ public:
|
||||||
const String& name
|
const String& name
|
||||||
);
|
);
|
||||||
|
|
||||||
// Ìí¼ÓËÑË÷·¾¶
|
// Ìí¼Ó×ÊÔ´ËÑË÷·¾¶
|
||||||
static void add(
|
static void addSearchPath(
|
||||||
String path
|
String path
|
||||||
);
|
);
|
||||||
|
|
||||||
// 检索文件路径
|
// 检索文件路径
|
||||||
static String searchForFile(
|
static String findFile(
|
||||||
const String& path
|
const String& path
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue