! replaces the extension */
| 79 | |
| 80 | /*! replaces the extension */ |
| 81 | FileName FileName::setExt(const std::string& ext) const { |
| 82 | size_t start = filename.find_last_of(path_sep); |
| 83 | if (start == std::string::npos) start = 0; else start++; |
| 84 | size_t end = filename.find_last_of('.'); |
| 85 | if (end == std::string::npos || end < start) return FileName(filename+ext); |
| 86 | return FileName(filename.substr(0,end)+ext); |
| 87 | } |
| 88 | |
| 89 | /*! adds the extension */ |
| 90 | FileName FileName::addExt(const std::string& ext) const { |