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
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| ~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). |
| virtual int64_t | tell() const override Tell not supported (forward-only stream). |
| 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). |
| virtual Core::IO::IoResult | read(std::span< uint8_t > buffer) override Reads data from ring buffer. |
| virtual std::string | path() const override Gets stream path/URL. |
| HTTP::HttpHeaders | headers() const Returns a copy of response headers (lowercase keys). |
| virtual bool | good() const override Checks if stream is in good state. |
| virtual void | flush() override Flush is no-op (read-only stream). |
| virtual bool | fail() const override Checks if stream is in failed state. |
| std::optional< std::string > | etag() const |
| virtual bool | eof() const override Checks if stream reached end-of-file. |
| std::optional< std::string > | contentType() const |
| std::optional< uint64_t > | contentLength() const |
| virtual void | close() override Closes stream and aborts HTTP request. |
| WebDAVReadStream(HTTP::StreamHandle handle, std::string url) Constructs stream from HttpClient StreamHandle. |
Additional inherited members
Section titled “Additional inherited members”Public Functions inherited from EntropyEngine::Core::IO::FileStream
| Name | |
|---|---|
| virtual | ~FileStream() =default |
Detailed Description
Section titled “Detailed Description”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();Public Functions Documentation
Section titled “Public Functions Documentation”function ~WebDAVReadStream
Section titled “function ~WebDAVReadStream”~WebDAVReadStream() overrideDestructor closes stream and aborts request.
function write
Section titled “function write”virtual Core::IO::IoResult write( std::span< const uint8_t > data) overrideWrite not supported (read-only stream).
Return: IoResult with InvalidPath error
Reimplements: EntropyEngine::Core::IO::FileStream::write
function tell
Section titled “function tell”virtual int64_t tell() const overrideTell not supported (forward-only stream).
Return: -1
Reimplements: EntropyEngine::Core::IO::FileStream::tell
function statusCode
Section titled “function statusCode”inline int statusCode() constReturns HTTP status code of the streaming response (0 if unavailable).
function seek
Section titled “function seek”virtual bool seek( int64_t offset, std::ios_base::seekdir dir) overrideSeek not supported (forward-only stream).
Return: false
Reimplements: EntropyEngine::Core::IO::FileStream::seek
function read
Section titled “function read”virtual Core::IO::IoResult read( std::span< uint8_t > buffer) overrideReads 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).
function path
Section titled “function path”inline virtual std::string path() const overrideGets stream path/URL.
Return: URL being streamed
Reimplements: EntropyEngine::Core::IO::FileStream::path
function headers
Section titled “function headers”inline HTTP::HttpHeaders headers() constReturns a copy of response headers (lowercase keys).
function good
Section titled “function good”virtual bool good() const overrideChecks if stream is in good state.
Return: true if not failed and not closed
Reimplements: EntropyEngine::Core::IO::FileStream::good
function flush
Section titled “function flush”virtual void flush() overrideFlush is no-op (read-only stream).
Reimplements: EntropyEngine::Core::IO::FileStream::flush
function fail
Section titled “function fail”virtual bool fail() const overrideChecks if stream is in failed state.
Return: true if HTTP error or parse error occurred
Reimplements: EntropyEngine::Core::IO::FileStream::fail
function etag
Section titled “function etag”std::optional< std::string > etag() constfunction eof
Section titled “function eof”virtual bool eof() const overrideChecks if stream reached end-of-file.
Return: true if response complete and buffer empty
Reimplements: EntropyEngine::Core::IO::FileStream::eof
function contentType
Section titled “function contentType”std::optional< std::string > contentType() constfunction contentLength
Section titled “function contentLength”std::optional< uint64_t > contentLength() constfunction close
Section titled “function close”virtual void close() overrideCloses stream and aborts HTTP request.
Reimplements: EntropyEngine::Core::IO::FileStream::close
Safe to call multiple times. Wakes blocking read() calls.
function WebDAVReadStream
Section titled “function WebDAVReadStream”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