1 /* Copyright (c) 2017. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef SRC_SURF_FILEIMPL_HPP_
8 #define SRC_SURF_FILEIMPL_HPP_
10 #include "surf/surf.h"
18 FileImpl(sg_storage_t st, std::string path, std::string mount);
19 ~FileImpl() = default;
21 std::string name() { return path_; }
22 const char* cname() { return path_.c_str(); }
23 const char* mount() { return mount_point_.c_str(); }
24 sg_size_t size() { return size_; }
25 void setSize(sg_size_t size) { size_ = size; }
26 void setPosition(sg_size_t size) { current_position_ = size; }
27 void incrPosition(sg_size_t incr) { current_position_ += incr; }
28 sg_size_t tell() { return current_position_; }
29 int seek(sg_offset_t offset, int origin);
31 void move(const char* fullpath);
32 Action* read(sg_size_t size);
33 Action* write(sg_size_t size);
36 StorageImpl* location_;
38 std::string mount_point_;
40 sg_size_t current_position_ = SEEK_SET;
44 #endif /* SRC_SURF_FILEIMPL_HPP_ */