Public Member Functions | Static Public Member Functions | List of all members
kvikio::HttpEndpoint Class Reference

A remote endpoint using http. More...

#include <remote_handle.hpp>

Inheritance diagram for kvikio::HttpEndpoint:
kvikio::RemoteEndpoint

Public Member Functions

 HttpEndpoint (std::string url)
 Create an http endpoint from a url. More...
 
void setopt (CurlHandle &curl) override
 Set needed connection options on a curl handle. More...
 
std::string str () const override
 Get a description of this remote point instance. More...
 
std::size_t get_file_size () override
 Get the size of the remote file. More...
 
void setup_range_request (CurlHandle &curl, std::size_t file_offset, std::size_t size) override
 Set up the range request in order to read part of a file given the file offset and read size.
 
- Public Member Functions inherited from kvikio::RemoteEndpoint
RemoteEndpointType remote_endpoint_type () const noexcept
 Get the type of the remote file. More...
 

Static Public Member Functions

static bool is_url_valid (std::string const &url) noexcept
 Whether the given URL is valid for HTTP/HTTPS endpoints. More...
 

Additional Inherited Members

- Protected Member Functions inherited from kvikio::RemoteEndpoint
 RemoteEndpoint (RemoteEndpointType remote_endpoint_type)
 
- Protected Attributes inherited from kvikio::RemoteEndpoint
RemoteEndpointType _remote_endpoint_type {RemoteEndpointType::AUTO}
 

Detailed Description

A remote endpoint using http.

Definition at line 113 of file remote_handle.hpp.

Constructor & Destructor Documentation

◆ HttpEndpoint()

kvikio::HttpEndpoint::HttpEndpoint ( std::string  url)

Create an http endpoint from a url.

Parameters
urlThe full http url to the remote file.

Member Function Documentation

◆ get_file_size()

std::size_t kvikio::HttpEndpoint::get_file_size ( )
overridevirtual

Get the size of the remote file.

Returns
The file size

Implements kvikio::RemoteEndpoint.

◆ is_url_valid()

static bool kvikio::HttpEndpoint::is_url_valid ( std::string const &  url)
staticnoexcept

Whether the given URL is valid for HTTP/HTTPS endpoints.

Parameters
urlA URL.
Returns
Boolean answer.

◆ setopt()

void kvikio::HttpEndpoint::setopt ( CurlHandle curl)
overridevirtual

Set needed connection options on a curl handle.

Subsequently, a call to curl.perform() should connect to the endpoint.

Parameters
curlThe curl handle.

Implements kvikio::RemoteEndpoint.

◆ str()

std::string kvikio::HttpEndpoint::str ( ) const
overridevirtual

Get a description of this remote point instance.

Returns
A string description.

Implements kvikio::RemoteEndpoint.


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