| 86 | } |
| 87 | |
| 88 | void Uri::setPathFile(const string & filename) |
| 89 | { |
| 90 | auto pf = pathFile(); |
| 91 | if (!pf.empty()) |
| 92 | { |
| 93 | auto pos = mPath.rfind(pf); |
| 94 | mPath.replace(pos, pf.length(), filename); |
| 95 | rebuild_fast(); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | // https://techtavern.wordpress.com/2009/04/06/regex-that-matches-path-filename-and-extension/ |
| 100 | static const regex parse_path_regex("^(.*/)?(?:$|(.+?)(?:(\\.[^.]*$)|$))"); |