Definition at line 35 of file FileInfo.h. References Impala::Util::FileInfo::mName. Referenced by File2TypeName(). 00036 { 00037 std::string::size_type pos = file->mName.rfind('.'); 00038 if (pos == std::string::npos) 00039 return Persistency::TypeUnknown; 00040 00041 std::string ext = file->mName.substr(pos); 00042 if (ext == ".png" || ext == ".jpg" || ext == ".gif" || ext == ".bmp") 00043 return Persistency::TypeImage; 00044 if (ext == ".mpg" || ext == ".avi" || ext == ".mp2" || ext == ".wmv") 00045 return Persistency::TypeVideo; 00046 if (ext == ".mp3" || ext == ".wav" || ext == ".au") 00047 return Persistency::TypeAudio; 00048 if (ext == ".txt" || ext == ".text" || ext == ".h" || ext == ".c" || ext == ".cpp") 00049 return Persistency::TypeText; 00050 return Persistency::TypeUnknown; 00051 }
|