PathString get_user_application_directory(const char* application_data_path) { PathString result = get_environment_variable("LOCALAPPDATA"); result.append(PATH_SEPARATOR_STRING); result.append(application_data_path); result.normalize(PATH_SEPARATOR); return result; }
static bool locateFile(llvm::StringRef relativePath, PathString &path) { // relativePath has no suffix for (unsigned i = 0; i < searchPath.size(); ++i) { PathString pathWOSuffix(searchPath[i]); llvm::sys::path::append(pathWOSuffix, relativePath); for (unsigned j = 0; j < moduleSuffixes.size(); ++j) { path = pathWOSuffix; path.append(moduleSuffixes[j].begin(), moduleSuffixes[j].end()); if (llvm::sys::fs::exists(path.str())) return true; } } return false; }