text-match m16.xxx and e16.xxx

This commit is contained in:
Kelvin Sherlock 2013-02-17 20:44:01 -05:00
parent 9564f13d85
commit c2f23c8f5e

View File

@ -74,7 +74,14 @@ namespace {
);
return tmp;
}
std::string basename(const std::string &s)
{
int pos = s.find_last_of("/:");
if (pos == s.npos) return s;
return s.substr(pos + 1);
}
}
@ -131,6 +138,22 @@ namespace OS
}
// check for e16.xxxx or m16.xxxx
ext = basename(s);
if (ext.length() > 4)
{
switch (ext[0])
{
case 'm':
case 'M':
case 'e':
case 'E':
if (!strncmp("16.", ext.c_str() + 1, 3))
return true;
break;
}
}
return false;
}