nativePath static method

String nativePath(
  1. String path, {
  2. String? appendix,
  3. List<String>? appendixes,
  4. String? nativeSep,
})

Joins path components and converts the '/' to the native path separator. path the base path appendix will be appended to the path appendixes a list of nodes to append to the path nativeSep the native separator. If null the global native path separator is used

Implementation

static String nativePath(String path,
    {String? appendix, List<String>? appendixes, String? nativeSep}) {
  var rc = path;
  nativeSep ??= sep;
  if (appendix != null) {
    rc += sep + appendix;
  }
  if (appendixes != null) {
    for (var item in appendixes) {
      rc += sep + item;
    }
  }
  rc = rc.replaceAll('/', nativeSep);
  rc = rc.replaceAll(nativeSep + nativeSep, nativeSep);
  return rc;
}