extend "can_read" function. returns true, if no explicit filename is given, but just the extension.

closes #2431

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1260 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Matthias Möller
2015-05-06 14:08:32 +00:00
parent 77f9360197
commit beae0ffce3
4 changed files with 18 additions and 10 deletions

View File

@@ -90,12 +90,12 @@ can_u_read(const std::string& _filename) const
std::string::size_type pos(_filename.rfind("."));
if (pos != std::string::npos)
{
extension = _filename.substr(pos+1, _filename.length()-pos-1);
else
extension = _filename; //check, if the whole filename defines the extension
std::transform( extension.begin(), extension.end(),
extension.begin(), tolower );
}
std::transform( extension.begin(), extension.end(),
extension.begin(), tolower );
// locate extension in extension string
return (get_extensions().find(extension) != std::string::npos);