convertPath method
- @Deprecated("Use 'ResourceProviderExtensions.convertPath' directly")
- String filePath
Converts the given posix filePath
to conform to this provider's path
context.
This is a utility method for testing; paths passed in to other methods in this class are never converted automatically.
Implementation
@Deprecated("Use 'ResourceProviderExtensions.convertPath' directly")
String convertPath(String filePath) {
// This implementation is duplicate with that at
// 'package:analyzer_testing/utilities/extensions/resource_provider.dart'.
// But the analyzer package's lib code _cannot_ depend on the
// analyzer_testing package; hence this duplication until this test-only
// method is removed.
if (pathContext.style == pathos.windows.style) {
if (filePath.startsWith(pathos.posix.separator)) {
filePath = r'C:' + filePath;
}
filePath = filePath.replaceAll(
pathos.posix.separator,
pathos.windows.separator,
);
}
return filePath;
}