LLVM 24.0.0git
llvm::StreamedHTTPResponseHandler Class Reference

A handler which streams the returned data to a CachedFileStream. More...

#include "llvm/HTTP/StreamedHTTPResponseHandler.h"

Inheritance diagram for llvm::StreamedHTTPResponseHandler:
[legend]

Public Member Functions

 StreamedHTTPResponseHandler (CreateStreamFn CreateStream, HTTPClient &Client)
Error commit ()
 Must be called exactly once after the writes have been completed but before the StreamedHTTPResponseHandler object is destroyed.
Error abort ()
 Must be called if the result won't be committed.
virtual ~StreamedHTTPResponseHandler ()=default
Error handleBodyChunk (StringRef BodyChunk) override
 Processes an additional chunk of bytes of the HTTP response body.

Additional Inherited Members

Protected Member Functions inherited from llvm::HTTPResponseHandler
 ~HTTPResponseHandler ()

Detailed Description

A handler which streams the returned data to a CachedFileStream.

The cache file is only created if a 200 OK status is observed.

Definition at line 27 of file StreamedHTTPResponseHandler.h.

Constructor & Destructor Documentation

◆ StreamedHTTPResponseHandler()

llvm::StreamedHTTPResponseHandler::StreamedHTTPResponseHandler ( CreateStreamFn CreateStream,
HTTPClient & Client )
inline

Definition at line 35 of file StreamedHTTPResponseHandler.h.

References llvm::move().

◆ ~StreamedHTTPResponseHandler()

virtual llvm::StreamedHTTPResponseHandler::~StreamedHTTPResponseHandler ( )
virtualdefault

Member Function Documentation

◆ abort()

Error llvm::StreamedHTTPResponseHandler::abort ( )

Must be called if the result won't be committed.

Definition at line 34 of file StreamedHTTPResponseHandler.cpp.

References llvm::Error::success().

◆ commit()

Error llvm::StreamedHTTPResponseHandler::commit ( )

Must be called exactly once after the writes have been completed but before the StreamedHTTPResponseHandler object is destroyed.

Definition at line 28 of file StreamedHTTPResponseHandler.cpp.

References llvm::Error::success().

◆ handleBodyChunk()

Error llvm::StreamedHTTPResponseHandler::handleBodyChunk ( StringRef BodyChunk)
overridevirtual

Processes an additional chunk of bytes of the HTTP response body.

Implements llvm::HTTPResponseHandler.

Definition at line 13 of file StreamedHTTPResponseHandler.cpp.

References llvm::Error::success(), and llvm::Expected< T >::takeError().


The documentation for this class was generated from the following files: