#include <utils.hh>
Static Public Member Functions | |
std::string | extension (const std::string &name) |
Return the extension of a filename.
|
Definition at line 44 of file utils.hh.
|
Return the extension of a filename.
Definition at line 53 of file utils.hh.
00054 { 00055 std::string ext; 00056 int pos = name.rfind('.'); 00057 if (pos > 0) 00058 { 00059 ext.assign(name, pos + 1, name.size() - pos); 00060 for (std::string::iterator i = ext.begin(); i != ext.end(); ++i) 00061 *i = tolower(*i); 00062 } 00063 return ext; 00064 } |