20 #ifndef MPD_FILE_READER_HXX
21 #define MPD_FILE_READER_HXX
53 :path(std::move(other.path)),
54 handle(other.handle) {
55 other.handle = INVALID_HANDLE_VALUE;
59 :path(std::move(other.path)),
61 other.
fd.SetUndefined();
74 return handle != INVALID_HANDLE_VALUE;
95 return GetFileSizeEx(handle, &size)
108 LARGE_INTEGER position;
109 return SetFilePointerEx(handle, zero, &position, FILE_CURRENT)
121 void Seek(off_t offset);
122 void Skip(off_t offset);
125 size_t Read(
void *data,
size_t size)
override;
An interface that can read bytes from a stream until the stream ends.
gcc_pure off_t Tell() const noexcept
gcc_pure off_t GetSize() const noexcept
Returns the size of the file in bytes, or -1 on error.
constexpr bool IsDefined() const
FileInfo GetFileInfo() const
A path name in the native file system character set.
gcc_pure uint64_t GetSize() const noexcept
A path name in the native file system character set.
size_t Read(void *data, size_t size) override
Read data from the stream.
gcc_pure uint64_t GetPosition() const noexcept
FileDescriptor GetFD() const
FileReader(FileReader &&other)
An OO wrapper for a UNIX file descriptor.