convertPath method

String convertPath(
  1. String path
)

Convert the given posix path 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

String convertPath(String path) {
  if (pathContext.style == pathos.windows.style) {
    if (path.startsWith(pathos.posix.separator)) {
      path = r'C:' + path;
    }
    path = path.replaceAll(pathos.posix.separator, pathos.windows.separator);
  }
  return path;
}