| 34 | } |
| 35 | |
| 36 | std::string normalize_path(const char* path) { |
| 37 | if (!path || !*path) return "/"; |
| 38 | std::string out(path); |
| 39 | std::replace(out.begin(), out.end(), '\\', '/'); |
| 40 | while (out.size() > 1 && out.back() == '/') out.pop_back(); |
| 41 | return out.empty() ? "/" : out; |
| 42 | } |
| 43 | |
| 44 | NodePtr resolve_node(const char* path) { |
| 45 | auto* st = state(); |