X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8fea398a5a9ca83c4e6009daf964d59869388e6c..def26f4b4bce4809f6708780a57a675ee382d6e4:/src/surf/FileImpl.hpp diff --git a/src/surf/FileImpl.hpp b/src/surf/FileImpl.hpp index 938a1b5945..b7acf366a4 100644 --- a/src/surf/FileImpl.hpp +++ b/src/surf/FileImpl.hpp @@ -7,27 +7,35 @@ #ifndef SRC_SURF_FILEIMPL_HPP_ #define SRC_SURF_FILEIMPL_HPP_ +#include "surf/surf.hpp" +#include + namespace simgrid { 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_; } - const char* cname() { return path_.c_str(); } + const std::string& getName() const { return path_; } + const char* getCname() const { return path_.c_str(); } const char* mount() { return mount_point_.c_str(); } sg_size_t size() { return size_; } void setSize(sg_size_t size) { size_ = size; } 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); + int unlink(); + void move(std::string fullpath); + private: + StorageImpl* location_; std::string path_; std::string mount_point_; sg_size_t size_; - sg_size_t current_position_ = 0; + sg_size_t current_position_ = SEEK_SET; }; } }