| 131 | } |
| 132 | |
| 133 | static Result pathJoin(StringPath& output, StringSpan base, StringSpan leaf) |
| 134 | { |
| 135 | SC_TRY(output.assign(base)); |
| 136 | trimTrailingSeparators(output); |
| 137 | const size_t length = nativeLength(output.view()); |
| 138 | if (length > 0) |
| 139 | { |
| 140 | native_char_t separatorBuffer[2] = {NativeSeparator, 0}; |
| 141 | const bool needsSeparator = !isSeparator(output.writableSpan().data()[length - 1]); |
| 142 | if (needsSeparator) |
| 143 | { |
| 144 | SC_TRY(output.append(nativeSpan(separatorBuffer, 1, true))); |
| 145 | } |
| 146 | } |
| 147 | SC_TRY(output.append(leaf)); |
| 148 | return Result(true); |
| 149 | } |
| 150 | |
| 151 | static bool pathExistsFile(StringSpan path) |
| 152 | { |
no test coverage detected