10 #ifndef WRENCH_FILELOCATION_H
11 #define WRENCH_FILELOCATION_H
35 static std::shared_ptr<FileLocation> SCRATCH;
37 static std::shared_ptr<FileLocation> LOCATION(std::shared_ptr<StorageService> ss);
39 static std::shared_ptr<FileLocation> LOCATION(std::shared_ptr<StorageService> ss,
40 std::shared_ptr<StorageService> server_ss);
42 static std::shared_ptr<FileLocation> LOCATION(std::shared_ptr<StorageService> ss,
43 std::string absolute_path);
46 std::shared_ptr<StorageService> getServerStorageService();
47 std::string getMountPoint();
48 std::string getAbsolutePathAtMountPoint();
49 std::string getFullAbsolutePath();
62 static bool equal(
const std::shared_ptr<FileLocation> &lhs,
63 const std::shared_ptr<FileLocation> &rhs) {
64 return ((lhs->getStorageService() == rhs->getStorageService()) and
65 (lhs->getFullAbsolutePath() == rhs->getFullAbsolutePath()));
69 static std::string sanitizePath(std::string path);
70 static bool properPathPrefix(std::string path1, std::string path2);
74 friend class LogicalFileSystem;
81 FileLocation(std::shared_ptr<StorageService> ss, std::string mp, std::string apamp) :
82 storage_service(ss), mount_point(mp), absolute_path_at_mount_point(apamp) { }
84 std::shared_ptr<StorageService> storage_service;
85 std::shared_ptr<StorageService> server_storage_service;
86 std::string mount_point;
87 std::string absolute_path_at_mount_point;
100 #endif //WRENCH_FILELOCATION_H