| 91 | } |
| 92 | |
| 93 | rdcstr get_basename(const rdcstr &path) |
| 94 | { |
| 95 | rdcstr base = path; |
| 96 | |
| 97 | while(!base.empty() && ispathsep(base.back())) |
| 98 | base.pop_back(); |
| 99 | |
| 100 | if(base.empty()) |
| 101 | return base; |
| 102 | |
| 103 | int offset = get_lastpathsep(base); |
| 104 | |
| 105 | if(offset == -1) |
| 106 | return base; |
| 107 | |
| 108 | return base.substr(offset + 1); |
| 109 | } |
| 110 | |
| 111 | rdcstr get_dirname(const rdcstr &path) |
| 112 | { |
no test coverage detected