X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e2680c4776709548e15f400af83ffe4a2cf5eb49..8936dac836a8288d60c7a8bbccfbda7c2b6233d2:/src/surf/FileImpl.hpp diff --git a/src/surf/FileImpl.hpp b/src/surf/FileImpl.hpp index eea45fccd2..0478ea1097 100644 --- a/src/surf/FileImpl.hpp +++ b/src/surf/FileImpl.hpp @@ -15,7 +15,7 @@ namespace surf { class FileImpl { public: - FileImpl(const char* path, const char* mount, sg_size_t size) : path_(path), mount_point_(mount), size_(size) {} + FileImpl(sg_storage_t st, std::string path, std::string mount); ~FileImpl() = default; std::string name() { return path_; } @@ -26,24 +26,14 @@ public: void setPosition(sg_size_t size) { current_position_ = size; } void incrPosition(sg_size_t incr) { current_position_ += incr; } sg_size_t tell() { return current_position_; } - int seek(sg_offset_t offset, int origin) - { - switch (origin) { - case SEEK_SET: - current_position_ = offset; - return 0; - case SEEK_CUR: - current_position_ += offset; - return 0; - case SEEK_END: - current_position_ = size_ + offset; - return 0; - default: - return -1; - } - } + int seek(sg_offset_t offset, int origin); + int unlink(); + void move(const char* fullpath); + Action* read(sg_size_t size); + Action* write(sg_size_t size); private: + StorageImpl* location_; std::string path_; std::string mount_point_; sg_size_t size_;