| 151 | } |
| 152 | |
| 153 | std::filesystem::path uniquePath(const std::filesystem::path Model) noexcept { |
| 154 | using size_type = std::filesystem::path::string_type::size_type; |
| 155 | using value_type = std::filesystem::path::value_type; |
| 156 | static const auto Hex = "0123456789abcdef"sv; |
| 157 | std::uniform_int_distribution<size_type> Distribution(0, Hex.size() - 1); |
| 158 | auto String = Model.native(); |
| 159 | for (size_type N = String.size(), I = 0; I < N; ++I) { |
| 160 | if (String[I] == static_cast<value_type>('%')) { |
| 161 | String[I] = static_cast<value_type>(Hex[Distribution(Hash::RandEngine)]); |
| 162 | } |
| 163 | } |
| 164 | return String; |
| 165 | } |
| 166 | |
| 167 | std::filesystem::path createTemp(const std::filesystem::path Model) noexcept { |
| 168 | while (true) { |