Lines Matching full:path
33 * @param path path to the file
35 inline void makeFileRemovable(const fs::path& path) in makeFileRemovable() argument
37 // makeFileUnRemovable() creates a directory at the file path. Remove the in makeFileRemovable()
39 fs::remove_all(path); in makeFileRemovable()
41 // Rename the file back to the original path to restore its contents in makeFileRemovable()
42 fs::path savePath{path.native() + ".save"}; in makeFileRemovable()
43 fs::rename(savePath, path); in makeFileRemovable()
51 * @param path path to the file
53 inline void makeFileUnRemovable(const fs::path& path) in makeFileUnRemovable() argument
56 fs::path savePath{path.native() + ".save"}; in makeFileUnRemovable()
57 fs::rename(path, savePath); in makeFileUnRemovable()
59 // Create a directory at the original file path in makeFileUnRemovable()
60 fs::create_directory(path); in makeFileUnRemovable()
63 // if the path is a non-empty directory. in makeFileUnRemovable()
64 std::ofstream childFile{path / "childFile"}; in makeFileUnRemovable()
100 fs::path path = tmpFile->getPath(); in TEST_F() local
101 EXPECT_FALSE(path.empty()); in TEST_F()
102 EXPECT_TRUE(fs::exists(path)); in TEST_F()
103 EXPECT_TRUE(fs::is_regular_file(path)); in TEST_F()
105 fs::path parentDir = path.parent_path(); in TEST_F()
108 std::string fileName = path.filename(); in TEST_F()
115 fs::path path = tmpFileNoData->getPath(); in TEST_F() local
116 EXPECT_FALSE(path.empty()); in TEST_F()
117 EXPECT_TRUE(fs::exists(path)); in TEST_F()
118 EXPECT_TRUE(fs::is_regular_file(path)); in TEST_F()
120 fs::path parentDir = path.parent_path(); in TEST_F()
123 std::string fileName = path.filename(); in TEST_F()
134 // Save path to temporary file in TEST_F()
135 fs::path path = tmpFile->getPath(); in TEST_F() local
140 // Verify first object now has an empty path in TEST_F()
144 EXPECT_EQ(file.getPath(), path); in TEST_F()
158 // Save path to first temporary file in TEST_F()
159 fs::path path1 = tmpFile->getPath(); in TEST_F()
165 // Save path to second temporary file in TEST_F()
166 fs::path path2 = tmpFileNoData->getPath(); in TEST_F()
174 // Verify first object now has an empty path in TEST_F()
192 // Save path to temporary file in TEST_F()
193 fs::path path = tmpFile->getPath(); in TEST_F() local
199 EXPECT_EQ(tmpFile->getPath(), path); in TEST_F()
200 EXPECT_TRUE(fs::exists(path)); in TEST_F()
210 // Save path to first temporary file in TEST_F()
211 fs::path path1 = tmpFile->getPath(); in TEST_F()
217 // Save path to second temporary file in TEST_F()
218 fs::path path2 = tmpFileNoData->getPath(); in TEST_F()
253 fs::path path{}; in TEST_F() local
256 path = file.getPath(); in TEST_F()
257 EXPECT_TRUE(fs::exists(path)); in TEST_F()
259 EXPECT_TRUE(fs::exists(path)); in TEST_F()
260 fs::remove(path); in TEST_F()
265 fs::path path{}; in TEST_F() local
268 path = file.getPath(); in TEST_F()
269 EXPECT_TRUE(fs::exists(path)); in TEST_F()
271 EXPECT_FALSE(fs::exists(path)); in TEST_F()
273 EXPECT_FALSE(fs::exists(path)); in TEST_F()
278 fs::path path{}; in TEST_F() local
282 path = file.getPath(); in TEST_F()
283 EXPECT_TRUE(fs::exists(path)); in TEST_F()
284 makeFileUnRemovable(path); in TEST_F()
292 EXPECT_TRUE(fs::exists(path)); in TEST_F()
295 makeFileRemovable(path); in TEST_F()
296 fs::remove(path); in TEST_F()
307 // Save path to temporary file in TEST_F()
308 fs::path path = tmpFile->getPath(); in TEST_F() local
313 // Verify path is cleared and file does not exist in TEST_F()
315 EXPECT_FALSE(fs::exists(path)); in TEST_F()
320 EXPECT_FALSE(fs::exists(path)); in TEST_F()