Skip to content

EntropyEngine::Networking::WebDAV::WebDAVReadStream

EntropyEngine::Networking::WebDAV::WebDAVReadStream

Section titled “EntropyEngine::Networking::WebDAV::WebDAVReadStream”

Read-only FileStream for WebDAV GET operations via HttpClient. More…

#include <WebDAVReadStream.h>

Inherits from EntropyEngine::Core::IO::FileStream

Name
~WebDAVReadStream() override
Destructor closes stream and aborts request.
virtual Core::IO::IoResultwrite(std::span< const uint8_t > data) override
Write not supported (read-only stream).
virtual int64_ttell() const override
Tell not supported (forward-only stream).
intstatusCode() const
Returns HTTP status code of the streaming response (0 if unavailable).
virtual boolseek(int64_t offset, std::ios_base::seekdir dir) override
Seek not supported (forward-only stream).
virtual Core::IO::IoResultread(std::span< uint8_t > buffer) override
Reads data from ring buffer.
virtual std::stringpath() const override
Gets stream path/URL.
HTTP::HttpHeadersheaders() const
Returns a copy of response headers (lowercase keys).
virtual boolgood() const override
Checks if stream is in good state.
virtual voidflush() override
Flush is no-op (read-only stream).
virtual boolfail() const override
Checks if stream is in failed state.
std::optional< std::string >etag() const
virtual booleof() const override
Checks if stream reached end-of-file.
std::optional< std::string >contentType() const
std::optional< uint64_t >contentLength() const
virtual voidclose() override
Closes stream and aborts HTTP request.
WebDAVReadStream(HTTP::StreamHandle handle, std::string url)
Constructs stream from HttpClient StreamHandle.

Public Functions inherited from EntropyEngine::Core::IO::FileStream

Name
virtual~FileStream() =default
class EntropyEngine::Networking::WebDAV::WebDAVReadStream;

Read-only FileStream for WebDAV GET operations via HttpClient.

Wraps HttpClient::StreamHandle to provide FileStream interface for incremental reading of large files over HTTP/WebDAV.

Thread Safety: Can be used from any thread. HttpClient::StreamHandle handles synchronization.

auto stream = backend->openStream("/remote/large_file.bin");
std::vector<std::byte> chunk(8192);
while (auto result = stream->read(chunk); result.bytesTransferred > 0) {
processChunk(chunk.data(), result.bytesTransferred);
if (result.complete) break;
}
stream->close();
~WebDAVReadStream() override

Destructor closes stream and aborts request.

virtual Core::IO::IoResult write(
std::span< const uint8_t > data
) override

Write not supported (read-only stream).

Return: IoResult with InvalidPath error

Reimplements: EntropyEngine::Core::IO::FileStream::write

virtual int64_t tell() const override

Tell not supported (forward-only stream).

Return: -1

Reimplements: EntropyEngine::Core::IO::FileStream::tell

inline int statusCode() const

Returns HTTP status code of the streaming response (0 if unavailable).

virtual bool seek(
int64_t offset,
std::ios_base::seekdir dir
) override

Seek not supported (forward-only stream).

Return: false

Reimplements: EntropyEngine::Core::IO::FileStream::seek

virtual Core::IO::IoResult read(
std::span< uint8_t > buffer
) override

Reads data from ring buffer.

Parameters:

  • buffer Destination buffer

Return: IoResult with bytesTransferred, complete flag, or error

Reimplements: EntropyEngine::Core::IO::FileStream::read

Blocks until data is available, stream completes, or error occurs. Copies from ring buffer (handles wrapping).

inline virtual std::string path() const override

Gets stream path/URL.

Return: URL being streamed

Reimplements: EntropyEngine::Core::IO::FileStream::path

inline HTTP::HttpHeaders headers() const

Returns a copy of response headers (lowercase keys).

virtual bool good() const override

Checks if stream is in good state.

Return: true if not failed and not closed

Reimplements: EntropyEngine::Core::IO::FileStream::good

virtual void flush() override

Flush is no-op (read-only stream).

Reimplements: EntropyEngine::Core::IO::FileStream::flush

virtual bool fail() const override

Checks if stream is in failed state.

Return: true if HTTP error or parse error occurred

Reimplements: EntropyEngine::Core::IO::FileStream::fail

std::optional< std::string > etag() const
virtual bool eof() const override

Checks if stream reached end-of-file.

Return: true if response complete and buffer empty

Reimplements: EntropyEngine::Core::IO::FileStream::eof

std::optional< std::string > contentType() const
std::optional< uint64_t > contentLength() const
virtual void close() override

Closes stream and aborts HTTP request.

Reimplements: EntropyEngine::Core::IO::FileStream::close

Safe to call multiple times. Wakes blocking read() calls.

WebDAVReadStream(
HTTP::StreamHandle handle,
std::string url
)

Constructs stream from HttpClient StreamHandle.

Parameters:

  • handle HttpClient StreamHandle for incremental reading
  • url Full URL being streamed (for path() method)

Constructor is non-blocking. HTTP request is already initiated via HttpClient::executeStream(). Stream waits for data on first read() call.


Updated on 2026-01-26 at 17:14:35 -0500