20 #ifndef MPD_NFS_FILE_READER_HXX 21 #define MPD_NFS_FILE_READER_HXX 59 std::string server, export_name;
90 void Read(uint64_t offset,
size_t size);
101 return state == State::IDLE;
119 virtual void OnNfsFileRead(
const void *data,
size_t size) = 0;
133 void CancelOrClose();
135 void OpenCallback(nfsfh *_fh);
136 void StatCallback(
const struct stat *st);
139 void OnNfsConnectionReady() final;
140 void OnNfsConnectionFailed(std::exception_ptr
e) final;
141 void OnNfsConnectionDisconnected(std::exception_ptr
e) final;
144 void OnNfsCallback(
unsigned status,
void *data) final;
145 void OnNfsError(std::exception_ptr &&
e) final;
148 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