20 #ifndef MPD_NFS_FILE_READER_HXX 21 #define MPD_NFS_FILE_READER_HXX 60 std::string server, export_name;
91 void Read(uint64_t offset,
size_t size);
102 return state == State::IDLE;
120 virtual void OnNfsFileRead(
const void *data,
size_t size) = 0;
134 void CancelOrClose();
136 void OpenCallback(nfsfh *_fh);
137 void StatCallback(
const struct stat *st);
140 void OnNfsConnectionReady() final;
141 void OnNfsConnectionFailed(std::exception_ptr
e) final;
142 void OnNfsConnectionDisconnected(std::exception_ptr
e) final;
145 void OnNfsCallback(
unsigned status,
void *data) final;
146 void OnNfsError(std::exception_ptr &&
e) final;
149 void RunDeferred() final;
A helper class which helps with reading from a file.
Defer execution of an event into an EventLoop.
virtual void OnNfsFileRead(const void *data, size_t size)=0
A Read() has completed successfully.
void Read(uint64_t offset, size_t size)
Attempt to read from the file.
virtual void OnNfsFileOpen(uint64_t size)=0
The file has been opened successfully.
virtual void OnNfsFileError(std::exception_ptr &&e)=0
An error has occurred, which can be either while waiting for OnNfsFileOpen(), or while waiting for On...
The connection is now in "idle" mode, and no response shall be generated.
void Open(const char *uri)
Open the file.
An asynchronous connection to a NFS server.
void CancelRead()
Cancel the most recent Read() call.
Callbacks for an asynchronous libnfs operation.
const Storage const char * uri