Lines Matching full:path

33  * @param path path to the file
35 inline void makeFileUnRemovable(const fs::path& path) in makeFileUnRemovable() argument
38 fs::path savePath{path.native() + ".save"}; in makeFileUnRemovable()
39 fs::rename(path, savePath); in makeFileUnRemovable()
41 // Create a directory at the original file path in makeFileUnRemovable()
42 fs::create_directory(path); in makeFileUnRemovable()
45 // if the path is a non-empty directory. in makeFileUnRemovable()
46 std::ofstream childFile{path / "childFile"}; in makeFileUnRemovable()
54 * @param path path to the file
56 inline void makeFileRemovable(const fs::path& path) in makeFileRemovable() argument
58 // makeFileUnRemovable() creates a directory at the file path. Remove the in makeFileRemovable()
60 fs::remove_all(path); in makeFileRemovable()
62 // Rename the file back to the original path to restore its contents in makeFileRemovable()
63 fs::path savePath{path.native() + ".save"}; in makeFileRemovable()
64 fs::rename(savePath, path); in makeFileRemovable()
71 fs::path path = file.getPath(); in TEST() local
72 EXPECT_FALSE(path.empty()); in TEST()
73 EXPECT_TRUE(fs::exists(path)); in TEST()
74 EXPECT_TRUE(fs::is_regular_file(path)); in TEST()
76 fs::path parentDir = path.parent_path(); in TEST()
79 std::string fileName = path.filename(); in TEST()
91 // Save path to temporary file in TEST()
92 fs::path path = file1.getPath(); in TEST() local
97 // Verify first object now has an empty path in TEST()
101 EXPECT_EQ(file2.getPath(), path); in TEST()
114 // Save path to first temporary file in TEST()
115 fs::path path1 = file1.getPath(); in TEST()
122 // Save path to second temporary file in TEST()
123 fs::path path2 = file2.getPath(); in TEST()
131 // Verify first object now has an empty path in TEST()
149 // Save path to temporary file in TEST()
150 fs::path path = file.getPath(); in TEST() local
156 EXPECT_EQ(file.getPath(), path); in TEST()
157 EXPECT_TRUE(fs::exists(path)); in TEST()
167 // Save path to first temporary file in TEST()
168 fs::path path1 = file1.getPath(); in TEST()
175 // Save path to second temporary file in TEST()
176 fs::path path2 = file2.getPath(); in TEST()
212 fs::path path{}; in TEST() local
215 path = file.getPath(); in TEST()
216 EXPECT_TRUE(fs::exists(path)); in TEST()
218 EXPECT_FALSE(fs::exists(path)); in TEST()
223 fs::path path{}; in TEST() local
226 path = file.getPath(); in TEST()
227 EXPECT_TRUE(fs::exists(path)); in TEST()
229 EXPECT_FALSE(fs::exists(path)); in TEST()
231 EXPECT_FALSE(fs::exists(path)); in TEST()
236 fs::path path{}; in TEST() local
240 path = file.getPath(); in TEST()
241 EXPECT_TRUE(fs::exists(path)); in TEST()
242 makeFileUnRemovable(path); in TEST()
250 EXPECT_TRUE(fs::exists(path)); in TEST()
253 makeFileRemovable(path); in TEST()
254 fs::remove(path); in TEST()
267 // Save path to temporary file in TEST()
268 fs::path path = file.getPath(); in TEST() local
273 // Verify path is cleared and file does not exist in TEST()
275 EXPECT_FALSE(fs::exists(path)); in TEST()
280 EXPECT_FALSE(fs::exists(path)); in TEST()