From 8617a34cee6bbdb8aa60c675dcc7d8814a0c18be Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Fri, 5 Feb 2021 16:07:44 -0800 Subject: [PATCH] Qualifying "string" as std::string PiperOrigin-RevId: 355948874 Change-Id: I02284fb8753bde69d12c54bd2b85be8040ea378b --- tensorflow/core/platform/path.h | 17 +++++++++-------- tensorflow/core/util/env_var.h | 2 +- tensorflow/stream_executor/blas.cc | 2 +- tensorflow/stream_executor/blas.h | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tensorflow/core/platform/path.h b/tensorflow/core/platform/path.h index 47c0dc07614..408f5abe011 100644 --- a/tensorflow/core/platform/path.h +++ b/tensorflow/core/platform/path.h @@ -22,7 +22,7 @@ limitations under the License. namespace tensorflow { namespace io { namespace internal { -string JoinPathImpl(std::initializer_list paths); +std::string JoinPathImpl(std::initializer_list paths); } // Utility routines for processing filenames @@ -43,7 +43,7 @@ string JoinPathImpl(std::initializer_list paths); // string path = io::JoinPath(FLAGS_test_srcdir, filename); // string path = io::JoinPath("/full", "path", "to", "filename"); template -string JoinPath(const T&... args) { +std::string JoinPath(const T&... args) { return internal::JoinPathImpl({args...}); } #endif /* SWIG */ @@ -71,7 +71,7 @@ tensorflow::StringPiece Extension(tensorflow::StringPiece path); // "/alpha/beta/". // // Does not perform any path normalization. -string CommonPathPrefix(absl::Span paths); +std::string CommonPathPrefix(absl::Span paths); // Collapse duplicate "/"s, resolve ".." and "." path elements, remove // trailing "/". @@ -80,7 +80,7 @@ string CommonPathPrefix(absl::Span paths); // invoke any system calls (getcwd(2)) in order to resolve relative // paths with respect to the actual working directory. That is, this is purely // string manipulation, completely independent of process state. -string CleanPath(tensorflow::StringPiece path); +std::string CleanPath(tensorflow::StringPiece path); // Populates the scheme, host, and path from a URI. scheme, host, and path are // guaranteed by this function to point into the contents of uri, even if @@ -95,11 +95,12 @@ void ParseURI(tensorflow::StringPiece uri, tensorflow::StringPiece* scheme, // Creates a URI from a scheme, host, and path. If the scheme is empty, we just // return the path. -string CreateURI(tensorflow::StringPiece scheme, tensorflow::StringPiece host, - tensorflow::StringPiece path); +std::string CreateURI(tensorflow::StringPiece scheme, + tensorflow::StringPiece host, + tensorflow::StringPiece path); // Creates a temporary file name with an extension. -string GetTempFilename(const string& extension); +std::string GetTempFilename(const std::string& extension); // Reads the TEST_UNDECLARED_OUTPUTS_DIR environment variable, and if set // assigns `dir` to the value. `dir` is not modified if the environment variable @@ -108,7 +109,7 @@ string GetTempFilename(const string& extension); // // Note: This function obviates the need to deal with Bazel's odd path decisions // on Windows, and should be preferred over a simple `getenv`. -bool GetTestUndeclaredOutputsDir(string* dir); +bool GetTestUndeclaredOutputsDir(std::string* dir); } // namespace io } // namespace tensorflow diff --git a/tensorflow/core/util/env_var.h b/tensorflow/core/util/env_var.h index 7d10f229102..1125e21abfd 100644 --- a/tensorflow/core/util/env_var.h +++ b/tensorflow/core/util/env_var.h @@ -44,7 +44,7 @@ Status ReadFloatFromEnvVar(StringPiece env_var_name, float default_val, // Returns a string into "value" from the environmental variable "env_var_name". // If it is unset, the default value is used. Status ReadStringFromEnvVar(StringPiece env_var_name, StringPiece default_val, - string* value); + std::string* value); } // namespace tensorflow diff --git a/tensorflow/stream_executor/blas.cc b/tensorflow/stream_executor/blas.cc index ca597595969..5c7783d99c1 100644 --- a/tensorflow/stream_executor/blas.cc +++ b/tensorflow/stream_executor/blas.cc @@ -95,7 +95,7 @@ std::ostream& operator<<(std::ostream& os, ComputationType ty) { return os << ComputationTypeString(ty); } -string DataTypeString(DataType ty) { +std::string DataTypeString(DataType ty) { switch (ty) { case DataType::kHalf: return "f16"; diff --git a/tensorflow/stream_executor/blas.h b/tensorflow/stream_executor/blas.h index 20776b8416d..0f3e77352af 100644 --- a/tensorflow/stream_executor/blas.h +++ b/tensorflow/stream_executor/blas.h @@ -134,7 +134,7 @@ enum class PointerMode { }; // Converts a ComputationType to a string. -string DataTypeString(DataType ty); +std::string DataTypeString(DataType ty); std::ostream &operator<<(std::ostream &os, DataType ty);