Mercurial > fife-parpg
changeset 389:a3a044c586ab
Removed the filename lower case transformations. OSX 10.6 is not case sensitive so I was unable to test fully.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 23 Jan 2010 21:53:51 +0000 |
parents | 605d13efc6f9 |
children | cc6289c519ed |
files | engine/core/vfs/vfs.cpp engine/core/vfs/vfs.h engine/core/vfs/vfsdirectory.cpp |
diffstat | 3 files changed, 11 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/engine/core/vfs/vfs.cpp Sat Jan 23 00:18:54 2010 +0000 +++ b/engine/core/vfs/vfs.cpp Sat Jan 23 21:53:51 2010 +0000 @@ -117,11 +117,10 @@ } VFSSource* VFS::getSourceForFile(const std::string& file) const { - std::string lowerpath = lower(file); type_sources::const_iterator i = std::find_if(m_sources.begin(), m_sources.end(), - boost::bind2nd(boost::mem_fun(&VFSSource::fileExists), lowerpath)); + boost::bind2nd(boost::mem_fun(&VFSSource::fileExists), file)); if (i == m_sources.end()) { - FL_WARN(_log, LMsg("no source for ") << lowerpath << " found"); + FL_WARN(_log, LMsg("no source for ") << file << " found"); return 0; } @@ -129,7 +128,7 @@ } bool VFS::exists(const std::string& file) const { - return getSourceForFile(lower(file)); + return getSourceForFile(file); } bool VFS::isDirectory(const std::string& path) const { @@ -155,40 +154,20 @@ } RawData* VFS::open(const std::string& path) { - std::string lowerpath = lower(path); - FL_DBG(_log, LMsg("Opening: ") << lowerpath); + FL_DBG(_log, LMsg("Opening: ") << path); - VFSSource* source = getSourceForFile(lowerpath); + VFSSource* source = getSourceForFile(path); if (!source) throw NotFound(path); - return source->open(lowerpath); - } - - std::string VFS::lower(const std::string& str) const { - std::string result; - result.resize(str.size()); - bool found_uppercase = false; - for(unsigned i=0; i != str.size(); ++i) - { - result[i] = tolower(str[i]); - found_uppercase |= result[i] != str[i]; - } - if( found_uppercase ) - { - FL_WARN(_log, LMsg("Case mismatch: given '") << str - << "', FIFE will use '" << result - << "' - Please only use lower case filenames to avoid problems with different file systems."); - } - return result; + return source->open(path); } std::set<std::string> VFS::listFiles(const std::string& pathstr) const { - std::string lowerpath = lower(pathstr); std::set<std::string> list; type_sources::const_iterator end = m_sources.end(); for (type_sources::const_iterator i = m_sources.begin(); i != end; ++i) { - std::set<std::string> sourcelist = (*i)->listFiles(lowerpath); + std::set<std::string> sourcelist = (*i)->listFiles(pathstr); list.insert(sourcelist.begin(), sourcelist.end()); } @@ -196,17 +175,15 @@ } std::set<std::string> VFS::listFiles(const std::string& path, const std::string& filterregex) const { - std::string lowerpath = lower(path); - std::set<std::string> list = listFiles(lowerpath); + std::set<std::string> list = listFiles(path); return filterList(list, filterregex); } std::set<std::string> VFS::listDirectories(const std::string& pathstr) const { - std::string lowerpath = lower(pathstr); std::set<std::string> list; type_sources::const_iterator end = m_sources.end(); for (type_sources::const_iterator i = m_sources.begin(); i != end; ++i) { - std::set<std::string> sourcelist = (*i)->listDirectories(lowerpath); + std::set<std::string> sourcelist = (*i)->listDirectories(pathstr); list.insert(sourcelist.begin(), sourcelist.end()); } @@ -214,7 +191,7 @@ } std::set<std::string> VFS::listDirectories(const std::string& path, const std::string& filterregex) const { - std::set<std::string> list = listDirectories(lower(path)); + std::set<std::string> list = listDirectories(path); return filterList(list, filterregex); }
--- a/engine/core/vfs/vfs.h Sat Jan 23 00:18:54 2010 +0000 +++ b/engine/core/vfs/vfs.h Sat Jan 23 21:53:51 2010 +0000 @@ -160,7 +160,6 @@ mutable type_usedfiles m_usedfiles; std::set<std::string> filterList(const std::set<std::string>& list, const std::string& fregex) const; - std::string lower(const std::string&) const; VFSSource* getSourceForFile(const std::string& file) const; };
--- a/engine/core/vfs/vfsdirectory.cpp Sat Jan 23 00:18:54 2010 +0000 +++ b/engine/core/vfs/vfsdirectory.cpp Sat Jan 23 21:53:51 2010 +0000 @@ -41,7 +41,7 @@ static Logger _log(LM_VFS); VFSDirectory::VFSDirectory(VFS* vfs, const std::string& root) : VFSSource(vfs), m_root(root) { - std::transform(m_root.begin(), m_root.end(), m_root.begin(), tolower); + //std::transform(m_root.begin(), m_root.end(), m_root.begin(), tolower); FL_DBG(_log, LMsg("VFSDirectory created with root path ") << m_root); if(!m_root.empty() && *(m_root.end() - 1) != '/') m_root.append(1,'/');