From c2f23c8f5ee8a7aec9d08e87f61d0ab0f719fc59 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 17 Feb 2013 20:44:01 -0500 Subject: [PATCH] text-match m16.xxx and e16.xxx --- toolbox/os.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/toolbox/os.cpp b/toolbox/os.cpp index 925bf9f..4fe38f1 100644 --- a/toolbox/os.cpp +++ b/toolbox/os.cpp @@ -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; }