All object files are based on their internal object header name but there is a chance of a name collision this function works out if the name is possible and if not permutes the name until it is valid.
| 708 | // there is a chance of a name collision this function works out if the name |
| 709 | // is possible and if not permutes the name until it is valid. |
| 710 | static fs::path findCustomObjectPath(std::string& filename) |
| 711 | { |
| 712 | auto objPath = Environment::getPath(Environment::PathId::customObjects) / (filename + ".DAT"); |
| 713 | while (fs::exists(objPath)) |
| 714 | { |
| 715 | permutateObjectFilename(filename); |
| 716 | objPath.replace_filename(filename + ".DAT"); |
| 717 | } |
| 718 | return objPath; |
| 719 | } |
| 720 | |
| 721 | static void sanatiseObjectFilename(std::string& filename) |
| 722 | { |
no test coverage detected