Return file extention name.
| 88 | |
| 89 | /// Return file extention name. |
| 90 | std::string get_ext_name(const std::string file_name) |
| 91 | { |
| 92 | std::string dir; |
| 93 | std::string basename; |
| 94 | parse_path(file_name, dir, basename); |
| 95 | |
| 96 | size_t pos = basename.find_last_of('.'); |
| 97 | if (pos >= basename.size()) { |
| 98 | return ""; // hidden file |
| 99 | } |
| 100 | return basename.substr(pos + 1, basename.size()); |
| 101 | } |
| 102 | |
| 103 | /// Return basename without extention. |
| 104 | std::string get_basename_without_ext(const std::string file_name) |
no test coverage detected