tensorflow/stream_executor/lib/path.cc
// For an array of paths of length count, append them all together,
// ensuring that the proper path separators are inserted between them.
For an array of paths of length count, append them all together,
ensuring that the proper path separators are inserted between them.
For an array of paths of length count append them all together ensuring that the proper path separators are inserted between them .
std::string JoinPathImpl(std::initializer_list<absl::string_view> paths) {
  std::string result;
  for (absl::string_view path : paths) {
    if (path.empty()) continue;
    if (result.empty()) {
      result = std::string(path);
      continue;
    }
    if (result[result.size() - 1] == '/') {
      if (IsAbsolutePath(path)) {
        absl::StrAppend(&result, path.substr(1));
      } else {
        absl::StrAppend(&result, path);
      }
    } else {
      if (IsAbsolutePath(path)) {
        absl::StrAppend(&result, path);
      } else {
        absl::StrAppend(&result, "/", path);
      }
    }
  }
  return result;
}
std :: string JoinPathImpl ( std :: initializer_list < absl :: string_view > paths ) { std :: string result ; for ( absl :: string_view path : paths ) { if ( path . empty ( ) ) continue ; if ( result . empty ( ) ) { result = std :: string ( path ) ; continue ; } if ( result [ result . size ( ) - 1 ] == ' ' ) { if ( IsAbsolutePath ( path ) ) { absl :: StrAppend ( & result , path . substr ( 1 ) ) ; } else { absl :: StrAppend ( & result , path ) ; } } else { if ( IsAbsolutePath ( path ) ) { absl :: StrAppend ( & result , path ) ; } else { absl :: StrAppend ( & result , " " , path ) ; } } } return result ; }
For an array of paths of length count, append them all together,
ensuring that the proper path separators are inserted between them.
For an array of paths of length count append them all together ensuring that the proper path separators are inserted between them .