42 #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
43 #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
54 #if GTEST_HAS_FILE_SYSTEM
72 FilePath() : pathname_(
"") {}
73 FilePath(
const FilePath& rhs) : pathname_(rhs.pathname_) {}
74 FilePath(FilePath&& rhs) noexcept : pathname_(std::move(rhs.pathname_)) {}
76 explicit FilePath(std::string pathname) : pathname_(std::move(pathname)) {
80 FilePath& operator=(
const FilePath& rhs) {
84 FilePath& operator=(FilePath&& rhs) noexcept {
85 pathname_ = std::move(rhs.pathname_);
89 void Set(
const FilePath& rhs) { pathname_ = rhs.pathname_; }
91 const std::string& string()
const {
return pathname_; }
92 const char* c_str()
const {
return pathname_.c_str(); }
95 static FilePath GetCurrentDir();
101 static FilePath MakeFileName(
const FilePath& directory,
102 const FilePath& base_name,
int number,
103 const char* extension);
108 static FilePath ConcatPaths(
const FilePath& directory,
109 const FilePath& relative_path);
119 static FilePath GenerateUniqueFileName(
const FilePath& directory,
120 const FilePath& base_name,
121 const char* extension);
124 bool IsEmpty()
const {
return pathname_.empty(); }
129 FilePath RemoveTrailingPathSeparator()
const;
137 FilePath RemoveDirectoryName()
const;
145 FilePath RemoveFileName()
const;
151 FilePath RemoveExtension(
const char* extension)
const;
157 bool CreateDirectoriesRecursively()
const;
163 bool CreateFolder()
const;
167 bool FileOrDirectoryExists()
const;
171 bool DirectoryExists()
const;
176 bool IsDirectory()
const;
180 bool IsRootDirectory()
const;
183 bool IsAbsolutePath()
const;
211 const char* FindLastPathSeparator()
const;
221 size_t CalculateRootLength()
const;
223 std::string pathname_;
231 #endif // GTEST_HAS_FILE_SYSTEM
233 #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
GTEST_DISABLE_MSC_WARNINGS_POP_() TEST(LinkTest
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
PolymorphicMatcher< internal::IsEmptyMatcher > IsEmpty()