Qualify uses of std::string
PiperOrigin-RevId: 324247205 Change-Id: Ie5e2164261078620060ebccb74eab2297b639a23
This commit is contained in:
parent
1267e76078
commit
a452e69984
tensorflow/core/platform
@ -22,7 +22,7 @@ limitations under the License.
|
||||
namespace tensorflow {
|
||||
namespace port {
|
||||
|
||||
string MaybeAbiDemangle(const char* name);
|
||||
std::string MaybeAbiDemangle(const char* name);
|
||||
|
||||
} // namespace port
|
||||
} // namespace tensorflow
|
||||
|
@ -108,7 +108,7 @@ class Env {
|
||||
/// The ownership of the returned RandomAccessFile is passed to the caller
|
||||
/// and the object should be deleted when is not used. The file object
|
||||
/// shouldn't live longer than the Env object.
|
||||
Status NewRandomAccessFile(const string& fname,
|
||||
Status NewRandomAccessFile(const std::string& fname,
|
||||
std::unique_ptr<RandomAccessFile>* result);
|
||||
|
||||
/// \brief Creates an object that writes to a new file with the specified
|
||||
@ -124,7 +124,7 @@ class Env {
|
||||
/// The ownership of the returned WritableFile is passed to the caller
|
||||
/// and the object should be deleted when is not used. The file object
|
||||
/// shouldn't live longer than the Env object.
|
||||
Status NewWritableFile(const string& fname,
|
||||
Status NewWritableFile(const std::string& fname,
|
||||
std::unique_ptr<WritableFile>* result);
|
||||
|
||||
/// \brief Creates an object that either appends to an existing file, or
|
||||
@ -139,7 +139,7 @@ class Env {
|
||||
/// The ownership of the returned WritableFile is passed to the caller
|
||||
/// and the object should be deleted when is not used. The file object
|
||||
/// shouldn't live longer than the Env object.
|
||||
Status NewAppendableFile(const string& fname,
|
||||
Status NewAppendableFile(const std::string& fname,
|
||||
std::unique_ptr<WritableFile>* result);
|
||||
|
||||
/// \brief Creates a readonly region of memory with the file context.
|
||||
@ -154,10 +154,10 @@ class Env {
|
||||
/// and the object should be deleted when is not used. The memory region
|
||||
/// object shouldn't live longer than the Env object.
|
||||
Status NewReadOnlyMemoryRegionFromFile(
|
||||
const string& fname, std::unique_ptr<ReadOnlyMemoryRegion>* result);
|
||||
const std::string& fname, std::unique_ptr<ReadOnlyMemoryRegion>* result);
|
||||
|
||||
/// Returns OK if the named path exists and NOT_FOUND otherwise.
|
||||
Status FileExists(const string& fname);
|
||||
Status FileExists(const std::string& fname);
|
||||
|
||||
/// Returns true if all the listed files exist, false otherwise.
|
||||
/// if status is not null, populate the vector with a detailed status
|
||||
@ -169,7 +169,7 @@ class Env {
|
||||
/// directory. The names are relative to "dir".
|
||||
///
|
||||
/// Original contents of *results are dropped.
|
||||
Status GetChildren(const string& dir, std::vector<string>* result);
|
||||
Status GetChildren(const std::string& dir, std::vector<string>* result);
|
||||
|
||||
/// \brief Returns true if the path matches the given pattern. The wildcards
|
||||
/// allowed in pattern are described in FileSystem::GetMatchingPaths.
|
||||
@ -180,11 +180,11 @@ class Env {
|
||||
/// that pattern. *results is cleared.
|
||||
///
|
||||
/// More details about `pattern` in FileSystem::GetMatchingPaths.
|
||||
virtual Status GetMatchingPaths(const string& pattern,
|
||||
virtual Status GetMatchingPaths(const std::string& pattern,
|
||||
std::vector<string>* results);
|
||||
|
||||
/// Deletes the named file.
|
||||
Status DeleteFile(const string& fname);
|
||||
Status DeleteFile(const std::string& fname);
|
||||
|
||||
/// \brief Deletes the specified directory and all subdirectories and files
|
||||
/// underneath it. This is accomplished by traversing the directory tree
|
||||
@ -210,7 +210,7 @@ class Env {
|
||||
/// * PERMISSION_DENIED - dirname or some descendant is not writable
|
||||
/// * UNIMPLEMENTED - Some underlying functions (like Delete) are not
|
||||
/// implemented
|
||||
Status DeleteRecursively(const string& dirname, int64* undeleted_files,
|
||||
Status DeleteRecursively(const std::string& dirname, int64* undeleted_files,
|
||||
int64* undeleted_dirs);
|
||||
|
||||
/// \brief Creates the specified directory and all the necessary
|
||||
@ -218,19 +218,19 @@ class Env {
|
||||
/// * OK - successfully created the directory and sub directories, even if
|
||||
/// they were already created.
|
||||
/// * PERMISSION_DENIED - dirname or some subdirectory is not writable.
|
||||
Status RecursivelyCreateDir(const string& dirname);
|
||||
Status RecursivelyCreateDir(const std::string& dirname);
|
||||
|
||||
/// \brief Creates the specified directory. Typical return codes
|
||||
/// * OK - successfully created the directory.
|
||||
/// * ALREADY_EXISTS - directory already exists.
|
||||
/// * PERMISSION_DENIED - dirname is not writable.
|
||||
Status CreateDir(const string& dirname);
|
||||
Status CreateDir(const std::string& dirname);
|
||||
|
||||
/// Deletes the specified directory.
|
||||
Status DeleteDir(const string& dirname);
|
||||
Status DeleteDir(const std::string& dirname);
|
||||
|
||||
/// Obtains statistics for the given path.
|
||||
Status Stat(const string& fname, FileStatistics* stat);
|
||||
Status Stat(const std::string& fname, FileStatistics* stat);
|
||||
|
||||
/// \brief Returns whether the given path is a directory or not.
|
||||
/// Typical return codes (not guaranteed exhaustive):
|
||||
@ -239,7 +239,7 @@ class Env {
|
||||
/// * NOT_FOUND - The path entry does not exist.
|
||||
/// * PERMISSION_DENIED - Insufficient permissions.
|
||||
/// * UNIMPLEMENTED - The file factory doesn't support directories.
|
||||
Status IsDirectory(const string& fname);
|
||||
Status IsDirectory(const std::string& fname);
|
||||
|
||||
/// \brief Returns whether the given path is on a file system
|
||||
/// that has atomic move capabilities. This can be used
|
||||
@ -251,17 +251,17 @@ class Env {
|
||||
/// so has_atomic_move holds the above information.
|
||||
/// * UNIMPLEMENTED - The file system of the path hasn't been implemented in
|
||||
/// TF
|
||||
Status HasAtomicMove(const string& path, bool* has_atomic_move);
|
||||
Status HasAtomicMove(const std::string& path, bool* has_atomic_move);
|
||||
|
||||
/// Stores the size of `fname` in `*file_size`.
|
||||
Status GetFileSize(const string& fname, uint64* file_size);
|
||||
Status GetFileSize(const std::string& fname, uint64* file_size);
|
||||
|
||||
/// \brief Renames file src to target. If target already exists, it will be
|
||||
/// replaced.
|
||||
Status RenameFile(const string& src, const string& target);
|
||||
Status RenameFile(const std::string& src, const std::string& target);
|
||||
|
||||
/// \brief Copy the src to target.
|
||||
Status CopyFile(const string& src, const string& target);
|
||||
Status CopyFile(const std::string& src, const std::string& target);
|
||||
|
||||
/// \brief Returns the absolute path of the current executable. It resolves
|
||||
/// symlinks if there is any.
|
||||
@ -374,7 +374,7 @@ class EnvWrapper : public Env {
|
||||
/// Returns the target to which this Env forwards all calls
|
||||
Env* target() const { return target_; }
|
||||
|
||||
Status GetFileSystemForFile(const string& fname,
|
||||
Status GetFileSystemForFile(const std::string& fname,
|
||||
FileSystem** result) override {
|
||||
return target_->GetFileSystemForFile(fname, result);
|
||||
}
|
||||
@ -383,7 +383,7 @@ class EnvWrapper : public Env {
|
||||
return target_->GetRegisteredFileSystemSchemes(schemes);
|
||||
}
|
||||
|
||||
Status RegisterFileSystem(const string& scheme,
|
||||
Status RegisterFileSystem(const std::string& scheme,
|
||||
FileSystemRegistry::Factory factory) override {
|
||||
return target_->RegisterFileSystem(scheme, factory);
|
||||
}
|
||||
@ -468,43 +468,44 @@ struct ThreadOptions {
|
||||
|
||||
/// A utility routine: copy contents of `src` in file system `src_fs`
|
||||
/// to `target` in file system `target_fs`.
|
||||
Status FileSystemCopyFile(FileSystem* src_fs, const string& src,
|
||||
FileSystem* target_fs, const string& target);
|
||||
Status FileSystemCopyFile(FileSystem* src_fs, const std::string& src,
|
||||
FileSystem* target_fs, const std::string& target);
|
||||
|
||||
/// A utility routine: reads contents of named file into `*data`
|
||||
Status ReadFileToString(Env* env, const string& fname, string* data);
|
||||
Status ReadFileToString(Env* env, const std::string& fname, std::string* data);
|
||||
|
||||
/// A utility routine: write contents of `data` to file named `fname`
|
||||
/// (overwriting existing contents, if any).
|
||||
Status WriteStringToFile(Env* env, const string& fname,
|
||||
Status WriteStringToFile(Env* env, const std::string& fname,
|
||||
const StringPiece& data);
|
||||
|
||||
/// Write binary representation of "proto" to the named file.
|
||||
Status WriteBinaryProto(Env* env, const string& fname,
|
||||
Status WriteBinaryProto(Env* env, const std::string& fname,
|
||||
const protobuf::MessageLite& proto);
|
||||
|
||||
/// Reads contents of named file and parse as binary encoded proto data
|
||||
/// and store into `*proto`.
|
||||
Status ReadBinaryProto(Env* env, const string& fname,
|
||||
Status ReadBinaryProto(Env* env, const std::string& fname,
|
||||
protobuf::MessageLite* proto);
|
||||
|
||||
/// Write the text representation of "proto" to the named file.
|
||||
Status WriteTextProto(Env* env, const string& fname,
|
||||
Status WriteTextProto(Env* env, const std::string& fname,
|
||||
const protobuf::Message& proto);
|
||||
|
||||
/// Read contents of named file and parse as text encoded proto data
|
||||
/// and store into `*proto`.
|
||||
inline Status ReadTextProto(Env* /* env */, const string& /* fname */,
|
||||
inline Status ReadTextProto(Env* /* env */, const std::string& /* fname */,
|
||||
protobuf::MessageLite* /* proto */) {
|
||||
return errors::Unimplemented("Can't parse text protos with protolite.");
|
||||
}
|
||||
Status ReadTextProto(Env* env, const string& fname, protobuf::Message* proto);
|
||||
Status ReadTextProto(Env* env, const std::string& fname,
|
||||
protobuf::Message* proto);
|
||||
|
||||
/// Read contents of named file and parse as either text or binary encoded proto
|
||||
/// data and store into `*proto`.
|
||||
Status ReadTextOrBinaryProto(Env* env, const string& fname,
|
||||
Status ReadTextOrBinaryProto(Env* env, const std::string& fname,
|
||||
protobuf::Message* proto);
|
||||
Status ReadTextOrBinaryProto(Env* env, const string& fname,
|
||||
Status ReadTextOrBinaryProto(Env* env, const std::string& fname,
|
||||
protobuf::MessageLite* proto);
|
||||
|
||||
// START_SKIP_DOXYGEN
|
||||
|
@ -73,7 +73,7 @@ class FileSystem {
|
||||
};
|
||||
|
||||
virtual tensorflow::Status NewRandomAccessFile(
|
||||
const string& fname, TransactionToken* token,
|
||||
const std::string& fname, TransactionToken* token,
|
||||
std::unique_ptr<RandomAccessFile>* result) {
|
||||
// We duplicate these methods due to Google internal coding style prevents
|
||||
// virtual functions with default arguments. See PR #41615.
|
||||
@ -98,7 +98,7 @@ class FileSystem {
|
||||
};
|
||||
|
||||
virtual tensorflow::Status NewWritableFile(
|
||||
const string& fname, TransactionToken* token,
|
||||
const std::string& fname, TransactionToken* token,
|
||||
std::unique_ptr<WritableFile>* result) {
|
||||
return Status::OK();
|
||||
}
|
||||
@ -120,7 +120,7 @@ class FileSystem {
|
||||
};
|
||||
|
||||
virtual tensorflow::Status NewAppendableFile(
|
||||
const string& fname, TransactionToken* token,
|
||||
const std::string& fname, TransactionToken* token,
|
||||
std::unique_ptr<WritableFile>* result) {
|
||||
return Status::OK();
|
||||
}
|
||||
@ -141,7 +141,7 @@ class FileSystem {
|
||||
}
|
||||
|
||||
virtual tensorflow::Status NewReadOnlyMemoryRegionFromFile(
|
||||
const string& fname, TransactionToken* token,
|
||||
const std::string& fname, TransactionToken* token,
|
||||
std::unique_ptr<ReadOnlyMemoryRegion>* result) {
|
||||
return Status::OK();
|
||||
}
|
||||
@ -151,7 +151,7 @@ class FileSystem {
|
||||
return FileExists(fname, nullptr);
|
||||
};
|
||||
|
||||
virtual tensorflow::Status FileExists(const string& fname,
|
||||
virtual tensorflow::Status FileExists(const std::string& fname,
|
||||
TransactionToken* token) {
|
||||
return Status::OK();
|
||||
}
|
||||
@ -170,12 +170,12 @@ class FileSystem {
|
||||
/// \brief Returns the immediate children in the given directory.
|
||||
///
|
||||
/// The returned paths are relative to 'dir'.
|
||||
virtual tensorflow::Status GetChildren(const string& dir,
|
||||
virtual tensorflow::Status GetChildren(const std::string& dir,
|
||||
std::vector<string>* result) {
|
||||
return GetChildren(dir, nullptr, result);
|
||||
}
|
||||
|
||||
virtual tensorflow::Status GetChildren(const string& dir,
|
||||
virtual tensorflow::Status GetChildren(const std::string& dir,
|
||||
TransactionToken* token,
|
||||
std::vector<string>* result) {
|
||||
return Status::OK();
|
||||
@ -203,12 +203,12 @@ class FileSystem {
|
||||
/// * OK - no errors
|
||||
/// * UNIMPLEMENTED - Some underlying functions (like GetChildren) are not
|
||||
/// implemented
|
||||
virtual tensorflow::Status GetMatchingPaths(const string& pattern,
|
||||
virtual tensorflow::Status GetMatchingPaths(const std::string& pattern,
|
||||
std::vector<string>* results) {
|
||||
return GetMatchingPaths(pattern, nullptr, results);
|
||||
}
|
||||
|
||||
virtual tensorflow::Status GetMatchingPaths(const string& pattern,
|
||||
virtual tensorflow::Status GetMatchingPaths(const std::string& pattern,
|
||||
TransactionToken* token,
|
||||
std::vector<string>* results) {
|
||||
return Status::OK();
|
||||
@ -226,7 +226,8 @@ class FileSystem {
|
||||
return Stat(fname, nullptr, stat);
|
||||
}
|
||||
|
||||
virtual tensorflow::Status Stat(const string& fname, TransactionToken* token,
|
||||
virtual tensorflow::Status Stat(const std::string& fname,
|
||||
TransactionToken* token,
|
||||
FileStatistics* stat) {
|
||||
return Status::OK();
|
||||
}
|
||||
@ -236,7 +237,7 @@ class FileSystem {
|
||||
return DeleteFile(fname, nullptr);
|
||||
}
|
||||
|
||||
virtual tensorflow::Status DeleteFile(const string& fname,
|
||||
virtual tensorflow::Status DeleteFile(const std::string& fname,
|
||||
TransactionToken* token) {
|
||||
return Status::OK();
|
||||
}
|
||||
@ -250,7 +251,7 @@ class FileSystem {
|
||||
return CreateDir(dirname, nullptr);
|
||||
}
|
||||
|
||||
virtual tensorflow::Status CreateDir(const string& dirname,
|
||||
virtual tensorflow::Status CreateDir(const std::string& dirname,
|
||||
TransactionToken* token) {
|
||||
return Status::OK();
|
||||
}
|
||||
@ -265,7 +266,7 @@ class FileSystem {
|
||||
return RecursivelyCreateDir(dirname, nullptr);
|
||||
}
|
||||
|
||||
virtual tensorflow::Status RecursivelyCreateDir(const string& dirname,
|
||||
virtual tensorflow::Status RecursivelyCreateDir(const std::string& dirname,
|
||||
TransactionToken* token);
|
||||
|
||||
/// \brief Deletes the specified directory.
|
||||
@ -273,7 +274,7 @@ class FileSystem {
|
||||
return DeleteDir(dirname, nullptr);
|
||||
};
|
||||
|
||||
virtual tensorflow::Status DeleteDir(const string& dirname,
|
||||
virtual tensorflow::Status DeleteDir(const std::string& dirname,
|
||||
TransactionToken* token) {
|
||||
return Status::OK();
|
||||
}
|
||||
@ -302,7 +303,7 @@ class FileSystem {
|
||||
/// * PERMISSION_DENIED - dirname or some descendant is not writable
|
||||
/// * UNIMPLEMENTED - Some underlying functions (like Delete) are not
|
||||
/// implemented
|
||||
virtual tensorflow::Status DeleteRecursively(const string& dirname,
|
||||
virtual tensorflow::Status DeleteRecursively(const std::string& dirname,
|
||||
int64* undeleted_files,
|
||||
int64* undeleted_dirs) {
|
||||
return DeleteRecursively(dirname, nullptr, undeleted_files, undeleted_dirs);
|
||||
@ -314,12 +315,12 @@ class FileSystem {
|
||||
int64* undeleted_dirs);
|
||||
|
||||
/// \brief Stores the size of `fname` in `*file_size`.
|
||||
virtual tensorflow::Status GetFileSize(const string& fname,
|
||||
virtual tensorflow::Status GetFileSize(const std::string& fname,
|
||||
uint64* file_size) {
|
||||
return GetFileSize(fname, nullptr, file_size);
|
||||
}
|
||||
|
||||
virtual tensorflow::Status GetFileSize(const string& fname,
|
||||
virtual tensorflow::Status GetFileSize(const std::string& fname,
|
||||
TransactionToken* token,
|
||||
uint64* file_size) {
|
||||
return Status::OK();
|
||||
@ -331,7 +332,8 @@ class FileSystem {
|
||||
return RenameFile(src, target, nullptr);
|
||||
}
|
||||
|
||||
virtual tensorflow::Status RenameFile(const string& src, const string& target,
|
||||
virtual tensorflow::Status RenameFile(const std::string& src,
|
||||
const std::string& target,
|
||||
TransactionToken* token) {
|
||||
return Status::OK();
|
||||
}
|
||||
@ -341,7 +343,8 @@ class FileSystem {
|
||||
return CopyFile(src, target, nullptr);
|
||||
}
|
||||
|
||||
virtual tensorflow::Status CopyFile(const string& src, const string& target,
|
||||
virtual tensorflow::Status CopyFile(const std::string& src,
|
||||
const std::string& target,
|
||||
TransactionToken* token);
|
||||
|
||||
/// \brief Translate an URI to a filename for the FileSystem implementation.
|
||||
@ -366,7 +369,7 @@ class FileSystem {
|
||||
return IsDirectory(fname, nullptr);
|
||||
}
|
||||
|
||||
virtual tensorflow::Status IsDirectory(const string& fname,
|
||||
virtual tensorflow::Status IsDirectory(const std::string& fname,
|
||||
TransactionToken* token);
|
||||
|
||||
/// \brief Returns whether the given path is on a file system
|
||||
@ -379,7 +382,7 @@ class FileSystem {
|
||||
/// so has_atomic_move holds the above information.
|
||||
/// * UNIMPLEMENTED - The file system of the path hasn't been implemented in
|
||||
/// TF
|
||||
virtual Status HasAtomicMove(const string& path, bool* has_atomic_move);
|
||||
virtual Status HasAtomicMove(const std::string& path, bool* has_atomic_move);
|
||||
|
||||
/// \brief Flushes any cached filesystem objects from memory.
|
||||
virtual void FlushCaches() { FlushCaches(nullptr); }
|
||||
@ -483,7 +486,7 @@ class FileSystem {
|
||||
}
|
||||
|
||||
/// \brief Adds `path` to transaction in `token`
|
||||
virtual tensorflow::Status AddToTransaction(const string& path,
|
||||
virtual tensorflow::Status AddToTransaction(const std::string& path,
|
||||
TransactionToken* token) {
|
||||
return Status::OK();
|
||||
}
|
||||
@ -496,13 +499,13 @@ class FileSystem {
|
||||
/// \brief Get token for `path` or start a new transaction and add `path` to
|
||||
/// it.
|
||||
virtual tensorflow::Status GetTokenOrStartTransaction(
|
||||
const string& path, TransactionToken** token) {
|
||||
const std::string& path, TransactionToken** token) {
|
||||
token = nullptr;
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
/// \brief Return transaction for `path` or nullptr in `token`
|
||||
virtual tensorflow::Status GetTransactionForPath(const string& path,
|
||||
virtual tensorflow::Status GetTransactionForPath(const std::string& path,
|
||||
TransactionToken** token) {
|
||||
token = nullptr;
|
||||
return Status::OK();
|
||||
@ -527,31 +530,31 @@ class FileSystem {
|
||||
class WrappedFileSystem : public FileSystem {
|
||||
public:
|
||||
tensorflow::Status NewRandomAccessFile(
|
||||
const string& fname, TransactionToken* token,
|
||||
const std::string& fname, TransactionToken* token,
|
||||
std::unique_ptr<RandomAccessFile>* result) override {
|
||||
return fs_->NewRandomAccessFile(fname, (token ? token : token_), result);
|
||||
}
|
||||
|
||||
tensorflow::Status NewWritableFile(
|
||||
const string& fname, TransactionToken* token,
|
||||
const std::string& fname, TransactionToken* token,
|
||||
std::unique_ptr<WritableFile>* result) override {
|
||||
return fs_->NewWritableFile(fname, (token ? token : token_), result);
|
||||
}
|
||||
|
||||
tensorflow::Status NewAppendableFile(
|
||||
const string& fname, TransactionToken* token,
|
||||
const std::string& fname, TransactionToken* token,
|
||||
std::unique_ptr<WritableFile>* result) override {
|
||||
return fs_->NewAppendableFile(fname, (token ? token : token_), result);
|
||||
}
|
||||
|
||||
tensorflow::Status NewReadOnlyMemoryRegionFromFile(
|
||||
const string& fname, TransactionToken* token,
|
||||
const std::string& fname, TransactionToken* token,
|
||||
std::unique_ptr<ReadOnlyMemoryRegion>* result) override {
|
||||
return fs_->NewReadOnlyMemoryRegionFromFile(fname, (token ? token : token_),
|
||||
result);
|
||||
}
|
||||
|
||||
tensorflow::Status FileExists(const string& fname,
|
||||
tensorflow::Status FileExists(const std::string& fname,
|
||||
TransactionToken* token) override {
|
||||
return fs_->FileExists(fname, (token ? token : token_));
|
||||
}
|
||||
@ -561,12 +564,13 @@ class WrappedFileSystem : public FileSystem {
|
||||
return fs_->FilesExist(files, (token ? token : token_), status);
|
||||
}
|
||||
|
||||
tensorflow::Status GetChildren(const string& dir, TransactionToken* token,
|
||||
tensorflow::Status GetChildren(const std::string& dir,
|
||||
TransactionToken* token,
|
||||
std::vector<string>* result) override {
|
||||
return fs_->GetChildren(dir, (token ? token : token_), result);
|
||||
}
|
||||
|
||||
tensorflow::Status GetMatchingPaths(const string& pattern,
|
||||
tensorflow::Status GetMatchingPaths(const std::string& pattern,
|
||||
TransactionToken* token,
|
||||
std::vector<string>* results) override {
|
||||
return fs_->GetMatchingPaths(pattern, (token ? token : token_), results);
|
||||
@ -576,27 +580,27 @@ class WrappedFileSystem : public FileSystem {
|
||||
return fs_->Match(filename, pattern);
|
||||
}
|
||||
|
||||
tensorflow::Status Stat(const string& fname, TransactionToken* token,
|
||||
tensorflow::Status Stat(const std::string& fname, TransactionToken* token,
|
||||
FileStatistics* stat) override {
|
||||
return fs_->Stat(fname, (token ? token : token_), stat);
|
||||
}
|
||||
|
||||
tensorflow::Status DeleteFile(const string& fname,
|
||||
tensorflow::Status DeleteFile(const std::string& fname,
|
||||
TransactionToken* token) override {
|
||||
return fs_->DeleteFile(fname, (token ? token : token_));
|
||||
}
|
||||
|
||||
tensorflow::Status CreateDir(const string& dirname,
|
||||
tensorflow::Status CreateDir(const std::string& dirname,
|
||||
TransactionToken* token) override {
|
||||
return fs_->CreateDir(dirname, (token ? token : token_));
|
||||
}
|
||||
|
||||
tensorflow::Status RecursivelyCreateDir(const string& dirname,
|
||||
tensorflow::Status RecursivelyCreateDir(const std::string& dirname,
|
||||
TransactionToken* token) override {
|
||||
return fs_->RecursivelyCreateDir(dirname, (token ? token : token_));
|
||||
}
|
||||
|
||||
tensorflow::Status DeleteDir(const string& dirname,
|
||||
tensorflow::Status DeleteDir(const std::string& dirname,
|
||||
TransactionToken* token) override {
|
||||
return fs_->DeleteDir(dirname, (token ? token : token_));
|
||||
}
|
||||
@ -609,17 +613,19 @@ class WrappedFileSystem : public FileSystem {
|
||||
undeleted_files, undeleted_dirs);
|
||||
}
|
||||
|
||||
tensorflow::Status GetFileSize(const string& fname, TransactionToken* token,
|
||||
tensorflow::Status GetFileSize(const std::string& fname,
|
||||
TransactionToken* token,
|
||||
uint64* file_size) override {
|
||||
return fs_->GetFileSize(fname, (token ? token : token_), file_size);
|
||||
}
|
||||
|
||||
tensorflow::Status RenameFile(const string& src, const string& target,
|
||||
tensorflow::Status RenameFile(const std::string& src,
|
||||
const std::string& target,
|
||||
TransactionToken* token) override {
|
||||
return fs_->RenameFile(src, target, (token ? token : token_));
|
||||
}
|
||||
|
||||
tensorflow::Status CopyFile(const string& src, const string& target,
|
||||
tensorflow::Status CopyFile(const std::string& src, const std::string& target,
|
||||
TransactionToken* token) override {
|
||||
return fs_->CopyFile(src, target, (token ? token : token_));
|
||||
}
|
||||
@ -628,12 +634,13 @@ class WrappedFileSystem : public FileSystem {
|
||||
return fs_->TranslateName(name);
|
||||
}
|
||||
|
||||
tensorflow::Status IsDirectory(const string& fname,
|
||||
tensorflow::Status IsDirectory(const std::string& fname,
|
||||
TransactionToken* token) override {
|
||||
return fs_->IsDirectory(fname, (token ? token : token_));
|
||||
}
|
||||
|
||||
Status HasAtomicMove(const string& path, bool* has_atomic_move) override {
|
||||
Status HasAtomicMove(const std::string& path,
|
||||
bool* has_atomic_move) override {
|
||||
return fs_->HasAtomicMove(path, has_atomic_move);
|
||||
}
|
||||
|
||||
@ -651,7 +658,7 @@ class WrappedFileSystem : public FileSystem {
|
||||
return fs_->StartTransaction(token);
|
||||
}
|
||||
|
||||
tensorflow::Status AddToTransaction(const string& path,
|
||||
tensorflow::Status AddToTransaction(const std::string& path,
|
||||
TransactionToken* token) override {
|
||||
return fs_->AddToTransaction(path, (token ? token : token_));
|
||||
}
|
||||
@ -660,13 +667,13 @@ class WrappedFileSystem : public FileSystem {
|
||||
return fs_->EndTransaction(token);
|
||||
}
|
||||
|
||||
tensorflow::Status GetTransactionForPath(const string& path,
|
||||
tensorflow::Status GetTransactionForPath(const std::string& path,
|
||||
TransactionToken** token) override {
|
||||
return fs_->GetTransactionForPath(path, token);
|
||||
}
|
||||
|
||||
tensorflow::Status GetTokenOrStartTransaction(
|
||||
const string& path, TransactionToken** token) override {
|
||||
const std::string& path, TransactionToken** token) override {
|
||||
return fs_->GetTokenOrStartTransaction(path, token);
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ inline uint64 Hash64(const char* data, size_t n) {
|
||||
|
||||
inline uint64 Hash64(const char* data) { return Hash64(data, ::strlen(data)); }
|
||||
|
||||
inline uint64 Hash64(const string& str) {
|
||||
inline uint64 Hash64(const std::string& str) {
|
||||
return Hash64(str.data(), str.size());
|
||||
}
|
||||
|
||||
|
@ -33,18 +33,18 @@ namespace tensorflow {
|
||||
namespace strings {
|
||||
|
||||
// Return a C++ string
|
||||
extern string Printf(const char* format, ...)
|
||||
extern std::string Printf(const char* format, ...)
|
||||
// Tell the compiler to do printf format string checking.
|
||||
TF_PRINTF_ATTRIBUTE(1, 2);
|
||||
|
||||
// Append result to a supplied string
|
||||
extern void Appendf(string* dst, const char* format, ...)
|
||||
extern void Appendf(std::string* dst, const char* format, ...)
|
||||
// Tell the compiler to do printf format string checking.
|
||||
TF_PRINTF_ATTRIBUTE(2, 3);
|
||||
|
||||
// Lower-level routine that takes a va_list and appends to a specified
|
||||
// string. All other routines are just convenience wrappers around it.
|
||||
extern void Appendv(string* dst, const char* format, va_list ap);
|
||||
extern void Appendv(std::string* dst, const char* format, va_list ap);
|
||||
|
||||
} // namespace strings
|
||||
} // namespace tensorflow
|
||||
|
@ -53,7 +53,7 @@ namespace testing {
|
||||
// Return a temporary directory suitable for temporary testing files.
|
||||
//
|
||||
// Where possible, consider using Env::LocalTempFilename over this function.
|
||||
string TmpDir();
|
||||
std::string TmpDir();
|
||||
|
||||
// Returns the path to TensorFlow in the directory containing data
|
||||
// dependencies.
|
||||
@ -62,7 +62,7 @@ string TmpDir();
|
||||
// tensorflow/core/platform/resource_loader.h:GetDataDependencyFilepath. That
|
||||
// function should do the right thing both within and outside of tests allowing
|
||||
// avoiding test specific APIs.
|
||||
string TensorFlowSrcRoot();
|
||||
std::string TensorFlowSrcRoot();
|
||||
|
||||
// Return a random number generator seed to use in randomized tests.
|
||||
// Returns the same value for the lifetime of the process.
|
||||
|
@ -108,22 +108,22 @@ class ThreadPool {
|
||||
// operations like I/O the hint should be set to false.
|
||||
//
|
||||
// REQUIRES: num_threads > 0
|
||||
ThreadPool(Env* env, const ThreadOptions& thread_options, const string& name,
|
||||
int num_threads, bool low_latency_hint,
|
||||
ThreadPool(Env* env, const ThreadOptions& thread_options,
|
||||
const std::string& name, int num_threads, bool low_latency_hint,
|
||||
Eigen::Allocator* allocator = nullptr);
|
||||
|
||||
// Constructs a pool for low-latency ops that contains "num_threads" threads
|
||||
// with specified "name". env->StartThread() is used to create individual
|
||||
// threads.
|
||||
// REQUIRES: num_threads > 0
|
||||
ThreadPool(Env* env, const string& name, int num_threads);
|
||||
ThreadPool(Env* env, const std::string& name, int num_threads);
|
||||
|
||||
// Constructs a pool for low-latency ops that contains "num_threads" threads
|
||||
// with specified "name". env->StartThread() is used to create individual
|
||||
// threads with the given ThreadOptions.
|
||||
// REQUIRES: num_threads > 0
|
||||
ThreadPool(Env* env, const ThreadOptions& thread_options, const string& name,
|
||||
int num_threads);
|
||||
ThreadPool(Env* env, const ThreadOptions& thread_options,
|
||||
const std::string& name, int num_threads);
|
||||
|
||||
// Constructs a pool that wraps around the thread::ThreadPoolInterface
|
||||
// instance provided by the caller. Caller retains ownership of
|
||||
|
Loading…
Reference in New Issue
Block a user