| 109 | } |
| 110 | |
| 111 | rdcstr get_dirname(const rdcstr &path) |
| 112 | { |
| 113 | rdcstr base = path; |
| 114 | |
| 115 | while(!base.empty() && ispathsep(base.back())) |
| 116 | base.pop_back(); |
| 117 | |
| 118 | if(base.empty()) |
| 119 | return "."; |
| 120 | |
| 121 | int offset = get_lastpathsep(base); |
| 122 | |
| 123 | if(offset == -1) |
| 124 | { |
| 125 | base.resize(1); |
| 126 | base[0] = '.'; |
| 127 | return base; |
| 128 | } |
| 129 | |
| 130 | return base.substr(0, offset); |
| 131 | } |
| 132 | |
| 133 | rdcstr strip_extension(const rdcstr &path) |
| 134 | { |
no test coverage detected