|
|
|
@ -334,8 +334,8 @@ void CFileContainer::remapExtension (const string &ext1, const string &ext2, boo
|
|
|
|
|
{
|
|
|
|
|
nlassert(!_MemoryCompressed);
|
|
|
|
|
|
|
|
|
|
string ext1lwr = toLower(ext1);
|
|
|
|
|
string ext2lwr = toLower(ext2);
|
|
|
|
|
string ext1lwr = toLowerAscii(ext1);
|
|
|
|
|
string ext2lwr = toLowerAscii(ext2);
|
|
|
|
|
|
|
|
|
|
if (ext1lwr.empty() || ext2lwr.empty())
|
|
|
|
|
{
|
|
|
|
@ -417,7 +417,7 @@ void CFileContainer::remapFile (const std::string &file1, const std::string &fil
|
|
|
|
|
{
|
|
|
|
|
if (file1.empty()) return;
|
|
|
|
|
if (file2.empty()) return;
|
|
|
|
|
_RemappedFiles[toLower(file1)] = toLower(file2);
|
|
|
|
|
_RemappedFiles[toLowerAscii(file1)] = toLowerAscii(file2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
@ -497,7 +497,7 @@ string CFileContainer::lookup (const string &filename, bool throwException, bool
|
|
|
|
|
// Try to find in the map directories
|
|
|
|
|
|
|
|
|
|
// If filename contains a path, we get only the filename to look inside paths
|
|
|
|
|
string str = CFile::getFilename(toLower(filename));
|
|
|
|
|
string str = CFile::getFilename(toLowerAscii(filename));
|
|
|
|
|
|
|
|
|
|
// Remove end spaces
|
|
|
|
|
while ((!str.empty()) && (str[str.size()-1] == ' '))
|
|
|
|
@ -557,7 +557,7 @@ string CFileContainer::lookup (const string &filename, bool throwException, bool
|
|
|
|
|
// try with the remapping
|
|
|
|
|
for (uint j = 0; j < _Extensions.size(); j++)
|
|
|
|
|
{
|
|
|
|
|
if (toLower(CFile::getExtension (str)) == _Extensions[j].second)
|
|
|
|
|
if (toLowerAscii(CFile::getExtension (str)) == _Extensions[j].second)
|
|
|
|
|
{
|
|
|
|
|
string rs = _AlternativePaths[i] + CFile::getFilenameWithoutExtension (filename) + "." + _Extensions[j].first;
|
|
|
|
|
if ( CFile::fileExists(rs) )
|
|
|
|
@ -599,7 +599,7 @@ bool CPath::exists (const std::string &filename)
|
|
|
|
|
bool CFileContainer::exists (const std::string &filename)
|
|
|
|
|
{
|
|
|
|
|
// Try to find in the map directories
|
|
|
|
|
string str = toLower(filename);
|
|
|
|
|
string str = toLowerAscii(filename);
|
|
|
|
|
|
|
|
|
|
// Remove end spaces
|
|
|
|
|
while ((!str.empty()) && (str[str.size()-1] == ' '))
|
|
|
|
@ -1215,7 +1215,7 @@ void CFileContainer::addSearchFile (const string &file, bool remap, const string
|
|
|
|
|
// now, we have to see extension and insert in the map the remapped files
|
|
|
|
|
for (uint i = 0; i < _Extensions.size (); i++)
|
|
|
|
|
{
|
|
|
|
|
if (_Extensions[i].first == toLower(ext))
|
|
|
|
|
if (_Extensions[i].first == toLowerAscii(ext))
|
|
|
|
|
{
|
|
|
|
|
// need to remap
|
|
|
|
|
addSearchFile (newFile, true, _Extensions[i].second, progressCallBack);
|
|
|
|
@ -1372,7 +1372,7 @@ void CFileContainer::addSearchBigFile (const string &sBigFilename, bool recurse,
|
|
|
|
|
NLMISC_BSWAP32(nFilePos);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
string sTmp = toLower(string(FileName));
|
|
|
|
|
string sTmp = toLowerAscii(string(FileName));
|
|
|
|
|
if (sTmp.empty())
|
|
|
|
|
{
|
|
|
|
|
nlwarning ("PATH: CPath::addSearchBigFile(%s, %d, %d): can't add empty file, skip it", sBigFilename.c_str(), recurse, alternative);
|
|
|
|
@ -1380,7 +1380,7 @@ void CFileContainer::addSearchBigFile (const string &sBigFilename, bool recurse,
|
|
|
|
|
}
|
|
|
|
|
string bigfilenamealone = CFile::getFilename (sBigFilename);
|
|
|
|
|
string filenamewoext = CFile::getFilenameWithoutExtension (sTmp);
|
|
|
|
|
string ext = toLower(CFile::getExtension(sTmp));
|
|
|
|
|
string ext = toLowerAscii(CFile::getExtension(sTmp));
|
|
|
|
|
|
|
|
|
|
insertFileInMap (sTmp, bigfilenamealone + "@" + sTmp, false, ext);
|
|
|
|
|
|
|
|
|
@ -1438,7 +1438,7 @@ void CFileContainer::addSearchStreamedPackage (const string &filename, bool recu
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Add the file itself
|
|
|
|
|
std::string packname = NLMISC::toLower(CFile::getFilename(filename));
|
|
|
|
|
std::string packname = NLMISC::toLowerAscii(CFile::getFilename(filename));
|
|
|
|
|
insertFileInMap(packname, filename, false, CFile::getExtension(filename));
|
|
|
|
|
|
|
|
|
|
// Add the package to the package manager
|
|
|
|
@ -1525,7 +1525,7 @@ void CFileContainer::addSearchXmlpackFile (const string &sXmlpackFilename, bool
|
|
|
|
|
|
|
|
|
|
string packfilenamealone = sXmlpackFilename;
|
|
|
|
|
string filenamewoext = CFile::getFilenameWithoutExtension (filenames[i]);
|
|
|
|
|
string ext = toLower(CFile::getExtension(filenames[i]));
|
|
|
|
|
string ext = toLowerAscii(CFile::getExtension(filenames[i]));
|
|
|
|
|
|
|
|
|
|
insertFileInMap (filenames[i], packfilenamealone + "@@" + filenames[i], false, ext);
|
|
|
|
|
|
|
|
|
@ -1570,7 +1570,7 @@ void CFileContainer::insertFileInMap (const string &filename, const string &file
|
|
|
|
|
{
|
|
|
|
|
nlassert(!_MemoryCompressed);
|
|
|
|
|
// find if the file already exist
|
|
|
|
|
TFiles::iterator it = _Files.find (toLower(filename));
|
|
|
|
|
TFiles::iterator it = _Files.find (toLowerAscii(filename));
|
|
|
|
|
if (it != _Files.end ())
|
|
|
|
|
{
|
|
|
|
|
string path = SSMpath.get((*it).second.idPath);
|
|
|
|
@ -1629,8 +1629,8 @@ void CFileContainer::insertFileInMap (const string &filename, const string &file
|
|
|
|
|
fe.idPath = SSMpath.add(sTmp);
|
|
|
|
|
fe.Name = filename;
|
|
|
|
|
|
|
|
|
|
_Files.insert (make_pair(toLower(filename), fe));
|
|
|
|
|
NL_DISPLAY_PATH("PATH: CPath::insertFileInMap(%s, %s, %d, %s): added", toLower(filename).c_str(), filepath.c_str(), remap, toLower(extension).c_str());
|
|
|
|
|
_Files.insert (make_pair(toLowerAscii(filename), fe));
|
|
|
|
|
NL_DISPLAY_PATH("PATH: CPath::insertFileInMap(%s, %s, %d, %s): added", toLowerAscii(filename).c_str(), filepath.c_str(), remap, toLowerAscii(extension).c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1690,13 +1690,13 @@ void CFileContainer::removeBigFiles(const std::vector<std::string> &bnpFilenames
|
|
|
|
|
TFiles::iterator fileIt, fileCurrIt;
|
|
|
|
|
for (uint k = 0; k < bnpFilenames.size(); ++k)
|
|
|
|
|
{
|
|
|
|
|
std::string completeBNPName = toLower(bnpFilenames[k]) + "@";
|
|
|
|
|
std::string completeBNPName = toLowerAscii(bnpFilenames[k]) + "@";
|
|
|
|
|
if (SSMpath.isAdded(completeBNPName))
|
|
|
|
|
{
|
|
|
|
|
bnpStrIds.insert(SSMpath.add(completeBNPName));
|
|
|
|
|
}
|
|
|
|
|
CBigFile::getInstance().remove(bnpFilenames[k]);
|
|
|
|
|
fileIt = _Files.find(toLower(bnpFilenames[k]));
|
|
|
|
|
fileIt = _Files.find(toLowerAscii(bnpFilenames[k]));
|
|
|
|
|
if (fileIt != _Files.end())
|
|
|
|
|
{
|
|
|
|
|
_Files.erase(fileIt);
|
|
|
|
@ -1825,7 +1825,7 @@ void CFileContainer::memoryUncompress()
|
|
|
|
|
fe.idPath = it->idPath;
|
|
|
|
|
fe.Remapped = it->Remapped;
|
|
|
|
|
|
|
|
|
|
_Files[toLower(CFile::getFilename(fe.Name))] = fe;
|
|
|
|
|
_Files[toLowerAscii(CFile::getFilename(fe.Name))] = fe;
|
|
|
|
|
}
|
|
|
|
|
contReset(_MCFiles);
|
|
|
|
|
_MemoryCompressed = false;
|
|
|
|
|