Lines Matching refs:FilePath
815 GTEST_API_ FilePath
1066 original_working_dir_.Set(FilePath::GetCurrentDir());
1227 internal::FilePath original_working_dir_;
1861 FilePath GetCurrentExecutableName() {
1862 FilePath result;
1865 result.Set(FilePath(g_executable_path).RemoveExtension("exe"));
1867 result.Set(FilePath(g_executable_path));
1895 return internal::FilePath::ConcatPaths(
1896 internal::FilePath(
1898 internal::FilePath(kDefaultOutputFile)).string();
1900 internal::FilePath output_name(colon + 1);
1906 output_name = internal::FilePath::ConcatPaths(
1907 internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
1908 internal::FilePath(colon + 1));
1913 internal::FilePath result(internal::FilePath::GenerateUniqueFileName(
4582 FilePath output_file(output_file_);
4583 FilePath output_dir(output_file.RemoveFileName());
7935 FilePath FilePath::GetCurrentDir() {
7939 return FilePath(kCurrentDirectoryString);
7942 return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
7945 return FilePath(getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
7949 // Returns a copy of the FilePath with the case-insensitive extension removed.
7950 // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
7951 // FilePath("dir/file"). If a case-insensitive extension is not
7952 // found, returns a copy of the original FilePath.
7953 FilePath FilePath::RemoveExtension(const char* extension) const {
7956 return FilePath(pathname_.substr(
7963 // the FilePath. On Windows, for example, both '/' and '\' are valid path
7965 const char* FilePath::FindLastPathSeparator() const {
7978 // Returns a copy of the FilePath with the directory part removed.
7979 // Example: FilePath("path/to/file").RemoveDirectoryName() returns
7980 // FilePath("file"). If there is no directory part ("just_a_file"), it returns
7981 // the FilePath unmodified. If there is no file part ("just_a_dir/") it
7982 // returns an empty FilePath ("").
7984 FilePath FilePath::RemoveDirectoryName() const {
7986 return last_sep ? FilePath(last_sep + 1) : *this;
7990 // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
7991 // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
7992 // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
7993 // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
7995 FilePath FilePath::RemoveFileName() const {
8003 return FilePath(dir);
8012 FilePath FilePath::MakeFileName(const FilePath& directory,
8013 const FilePath& base_name,
8023 return ConcatPaths(directory, FilePath(file));
8028 FilePath FilePath::ConcatPaths(const FilePath& directory,
8029 const FilePath& relative_path) {
8032 const FilePath dir(directory.RemoveTrailingPathSeparator());
8033 return FilePath(dir.string() + kPathSeparator + relative_path.string());
8038 bool FilePath::FileOrDirectoryExists() const {
8052 bool FilePath::DirectoryExists() const {
8057 const FilePath& path(IsRootDirectory() ? *this :
8060 const FilePath& path(*this);
8082 bool FilePath::IsRootDirectory() const {
8094 bool FilePath::IsAbsolutePath() const {
8115 FilePath FilePath::GenerateUniqueFileName(const FilePath& directory,
8116 const FilePath& base_name,
8118 FilePath full_pathname;
8126 // Returns true if FilePath ends with a path separator, which indicates that
8129 bool FilePath::IsDirectory() const {
8137 bool FilePath::CreateDirectoriesRecursively() const {
8146 const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName());
8154 bool FilePath::CreateFolder() const {
8156 FilePath removed_sep(this->RemoveTrailingPathSeparator());
8175 FilePath FilePath::RemoveTrailingPathSeparator() const {
8177 ? FilePath(pathname_.substr(0, pathname_.length() - 1))
8185 void FilePath::Normalize() {