00001 #ifndef STORAGE_FACTORY_LOCAL_FILE_SYSTEM_H 00002 # define STORAGE_FACTORY_LOCAL_FILE_SYSTEM_H 00003 # include <vector> 00004 # include <string> 00005 00006 struct stat; 00007 struct statfs; 00008 struct mntent; 00009 00010 class LocalFileSystem 00011 { 00012 struct FSInfo; 00013 public: 00014 LocalFileSystem(void); 00015 ~LocalFileSystem(void); 00016 00017 bool isLocalPath(const std::string &path); 00018 std::string findCachePath(const std::vector<std::string> &paths, double minFreeSpace); 00019 00020 private: 00021 int readFSTypes(void); 00022 FSInfo * initFSInfo(void *p); 00023 int initFSList(void); 00024 int statFSInfo(FSInfo *i); 00025 FSInfo * findMount(const char *path, struct statfs *sfs, struct stat *s); 00026 00027 std::vector<FSInfo *> fs_; 00028 std::vector<std::string> fstypes_; 00029 00030 // undefined, no semantics 00031 LocalFileSystem(LocalFileSystem &); 00032 void operator=(LocalFileSystem &); 00033 }; 00034 00035 #endif // STORAGE_FACTORY_LOCAL_FILE_SYSTEM_H