26 std::unordered_map<int, Host::File> _openFiles;
29 template <
typename... Args>
31 : T(std::forward<Args>(args)...) {}
34 ErrorCode onFileOpen(
Session &session, std::string
const &path,
35 OpenFlags flags, uint32_t mode,
int &fd)
override;
36 ErrorCode onFileClose(
Session &session,
int fd)
override;
37 ErrorCode onFileRead(
Session &session,
int fd, uint64_t &count,
38 uint64_t offset, ByteVector &buffer)
override;
39 ErrorCode onFileWrite(
Session &session,
int fd, uint64_t offset,
40 const ByteVector &buffer, uint64_t &nwritten)
override;
43 ErrorCode onFileCreateDirectory(
Session &session, std::string
const &path,
44 uint32_t mode)
override;
47 ErrorCode onFileExists(
Session &session, std::string
const &path)
override;
48 ErrorCode onFileGetSize(
Session &session, std::string
const &path,
49 uint64_t &size)
override;
50 ErrorCode onFileGetMode(
Session &session, std::string
const &path,
51 uint32_t &mode)
const override;
52 ErrorCode onFileFstat(
Session &session,
int fd, ByteVector &buffer)
const override;
53 ErrorCode onFileRemove(
Session &session, std::string
const &path)
override;
56 ErrorCode onFileSetPermissions(
Session &session, std::string
const &path,
57 uint32_t mode)
override;
58 ErrorCode onQueryModuleInfo(
Session &session, std::string &path,
65 virtual ErrorCode onGetCurrentTime(
Session &session, TimeValue &tv);
67 virtual ErrorCode onFileIsATTY(
Session &session,
int fd);
68 virtual ErrorCode onFileRename(
Session &session,
69 std::string
const &oldPath, std::string
const &newPath);
71 virtual ErrorCode onFileGetStat(
Session &session, std::string
const &path,
73 virtual ErrorCode onFileGetStat(
Session &session,
int fd,
76 virtual ErrorCode onFileSeek(
Session &session,
int fd,
77 int64_t offset,
int whence, int64_t &newOffset);