00001 #ifndef CUTILS_H_INCLUDED 00002 #define CUTILS_H_INCLUDED 00003 #include <string> 00004 00005 std::string getExt(const std::string& filename){ 00006 if(filename.find_last_of(".") == std::string::npos) return filename; 00007 return filename.substr(filename.find_last_of(".") + 1, filename.length()-filename.find_last_of(".")-1); 00008 } 00009 00010 #endif // CUTILS_H_INCLUDED