| 197 | } |
| 198 | |
| 199 | static das::string path_basename(const das::string &path) { |
| 200 | // Trim trailing separators so "/mods/foo/" yields "foo" (otherwise |
| 201 | // `substr(slash+1)` would be empty and shadow-skip would key on ""). |
| 202 | size_t end = path.size(); |
| 203 | while (end > 0 && (path[end - 1] == '/' || path[end - 1] == '\\')) { |
| 204 | --end; |
| 205 | } |
| 206 | if (end == 0) { |
| 207 | return das::string(); |
| 208 | } |
| 209 | auto slash = path.find_last_of("\\/", end - 1); |
| 210 | if (slash == das::string::npos) { |
| 211 | return path.substr(0, end); |
| 212 | } |
| 213 | return path.substr(slash + 1, end - slash - 1); |
| 214 | } |
| 215 | |
| 216 | bool require_dynamic_modules(FileAccessPtr file_access, |
| 217 | const das::string &das_root, |
no test coverage detected