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
165 EXPECT_EQ(file.getPath(), path); in TEST()
166 EXPECT_TRUE(fs::exists(path)); in TEST()
176 // Save path to first temporary file in TEST()
177 fs::path path1 = file1.getPath(); in TEST()
184 // Save path to second temporary file in TEST()
185 fs::path path2 = file2.getPath(); in TEST()
221 fs::path path{}; in TEST() local
224 path = file.getPath(); in TEST()
225 EXPECT_TRUE(fs::exists(path)); in TEST()
227 EXPECT_FALSE(fs::exists(path)); in TEST()
232 fs::path path{}; in TEST() local
235 path = file.getPath(); in TEST()
236 EXPECT_TRUE(fs::exists(path)); in TEST()
238 EXPECT_FALSE(fs::exists(path)); in TEST()
240 EXPECT_FALSE(fs::exists(path)); in TEST()
245 fs::path path{}; in TEST() local
249 path = file.getPath(); in TEST()
250 EXPECT_TRUE(fs::exists(path)); in TEST()
251 makeFileUnRemovable(path); in TEST()
259 EXPECT_TRUE(fs::exists(path)); in TEST()
262 makeFileRemovable(path); in TEST()
263 fs::remove(path); in TEST()
276 // Save path to temporary file in TEST()
277 fs::path path = file.getPath(); in TEST() local
282 // Verify path is cleared and file does not exist in TEST()
284 EXPECT_FALSE(fs::exists(path)); in TEST()
289 EXPECT_FALSE(fs::exists(path)); in TEST()