10 #ifndef WRENCH_FILELOCATION_H
11 #define WRENCH_FILELOCATION_H
38 static std::shared_ptr<FileLocation> SCRATCH;
40 static std::shared_ptr<FileLocation> LOCATION(std::shared_ptr<StorageService> ss);
42 static std::shared_ptr<FileLocation> LOCATION(std::shared_ptr<StorageService> ss,
43 std::shared_ptr<StorageService> server_ss);
45 static std::shared_ptr<FileLocation> LOCATION(std::shared_ptr<StorageService> ss,
46 std::string absolute_path);
49 std::shared_ptr<StorageService> getServerStorageService();
50 std::string getMountPoint();
51 std::string getAbsolutePathAtMountPoint();
52 std::string getFullAbsolutePath();
65 static bool equal(
const std::shared_ptr<FileLocation> &lhs,
66 const std::shared_ptr<FileLocation> &rhs) {
67 return ((lhs->getStorageService() == rhs->getStorageService()) and
68 (lhs->getFullAbsolutePath() == rhs->getFullAbsolutePath()));
72 static std::string sanitizePath(std::string path);
73 static bool properPathPrefix(std::string path1, std::string path2);
77 friend class LogicalFileSystem;
84 FileLocation(std::shared_ptr<StorageService> ss, std::string mp, std::string apamp) :
85 storage_service(ss), mount_point(mp), absolute_path_at_mount_point(apamp) { }
87 std::shared_ptr<StorageService> storage_service;
88 std::shared_ptr<StorageService> server_storage_service;
89 std::string mount_point;
90 std::string absolute_path_at_mount_point;
103 #endif //WRENCH_FILELOCATION_H