|
|
|
@ -73,14 +73,16 @@ class DirArchive: public Ogre::FileSystemArchive
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
String passed = filename;
|
|
|
|
|
if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<'
|
|
|
|
|
if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
|
|
|
|
|
passed = filename.substr(0, filename.length() - 6);
|
|
|
|
|
else if(filename.at(filename.length() - 2) == '"')
|
|
|
|
|
passed = filename.substr(0, filename.length() - 9);
|
|
|
|
|
else if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<'
|
|
|
|
|
|| filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' || filename.at(filename.length() - 1) == ':'
|
|
|
|
|
|| filename.at(filename.length() - 1) == '|')
|
|
|
|
|
{
|
|
|
|
|
passed = filename.substr(0, filename.length() - 2);
|
|
|
|
|
}
|
|
|
|
|
if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
|
|
|
|
|
passed = filename.substr(0, filename.length() - 6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
copy = passed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -226,14 +228,16 @@ public:
|
|
|
|
|
BSAFile *narc = (BSAFile*)&arc;
|
|
|
|
|
|
|
|
|
|
String passed = filename;
|
|
|
|
|
if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<'
|
|
|
|
|
if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
|
|
|
|
|
passed = filename.substr(0, filename.length() - 6);
|
|
|
|
|
else if(filename.at(filename.length() - 2) == '"')
|
|
|
|
|
passed = filename.substr(0, filename.length() - 9);
|
|
|
|
|
else if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<'
|
|
|
|
|
|| filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' || filename.at(filename.length() - 1) == ':'
|
|
|
|
|
|| filename.at(filename.length() - 1) == '|')
|
|
|
|
|
{
|
|
|
|
|
passed = filename.substr(0, filename.length() - 2);
|
|
|
|
|
}
|
|
|
|
|
if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
|
|
|
|
|
passed = filename.substr(0, filename.length() - 6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Open the file
|
|
|
|
|
StreamPtr strm = narc->getFile(passed.c_str());
|
|
|
|
|
|
|
|
|
@ -248,14 +252,16 @@ bool exists(const String& filename) {
|
|
|
|
|
// Check if the file exists.
|
|
|
|
|
bool cexists(const String& filename) const {
|
|
|
|
|
String passed = filename;
|
|
|
|
|
if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<'
|
|
|
|
|
if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
|
|
|
|
|
passed = filename.substr(0, filename.length() - 6);
|
|
|
|
|
else if(filename.at(filename.length() - 2) == '"')
|
|
|
|
|
passed = filename.substr(0, filename.length() - 9);
|
|
|
|
|
else if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' || filename.at(filename.length() - 1) == '<'
|
|
|
|
|
|| filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' || filename.at(filename.length() - 1) == ':'
|
|
|
|
|
|| filename.at(filename.length() - 1) == '|')
|
|
|
|
|
{
|
|
|
|
|
passed = filename.substr(0, filename.length() - 2);
|
|
|
|
|
}
|
|
|
|
|
if(filename.at(filename.length() - 2) == '>' || filename.at(filename.length() - 2) == ':')
|
|
|
|
|
passed = filename.substr(0, filename.length() - 6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return arc.exists(passed.c_str());
|
|
|
|
|
}
|
|
|
|
|