CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::IURLRequest Class Reference

A URL load request that is independent of protocol or URL scheme. More...

#include <CeresEngine/Foundation/IO/URLSession.hpp>

Inheritance diagram for CeresEngine::IURLRequest:
CeresEngine::FileURLProtocol::Request

Classes

struct  CachePolicy
 An enumeration that describes how the URLProtocol implementation should handle caching of this request. More...
 

Public Types

using Mode = URLRequestMode
 Determines the mode the request should be performed.
 

Public Member Functions

 IURLRequest (const URL &url, const CachePolicy cachePolicy=CachePolicy::Default)
 Creates a new URLRequest instance.
 
 IURLRequest (const IURLRequest &request, const URL &url)
 Creates a new IURLRequest object by copying from another but with a rewritten URL.
 
virtual ~IURLRequest () noexcept=default
 Destroys the URLRequest.
 

Public Attributes

const URL url
 The URL of the request.
 
URLRequestModeFlags mode = URLRequestMode::Read
 Determines the mode the request should be performed.
 
CachePolicy cachePolicy = CachePolicy::Default
 The request's cache policy.
 

Detailed Description

A URL load request that is independent of protocol or URL scheme.

URLRequest encapsulates two essential properties of a load request: the URL to load and the policies used to load it. In addition, for HTTP and HTTPS requests, URLRequest includes the HTTP method (GET, POST, and so on) and the HTTP headers.

URLRequest only represents information about the request. Use other classes, such as URLSession, to send the request to a server.

Member Typedef Documentation

◆ Mode

Determines the mode the request should be performed.

Constructor & Destructor Documentation

◆ IURLRequest() [1/2]

CeresEngine::IURLRequest::IURLRequest ( const URL url,
const CachePolicy  cachePolicy = CachePolicy::Default 
)
inlineexplicit

Creates a new URLRequest instance.

Parameters
urlThe URL of the request.
cachePolicyA policy that determines how the protocol must handle caching.

◆ IURLRequest() [2/2]

CeresEngine::IURLRequest::IURLRequest ( const IURLRequest request,
const URL url 
)
inlineexplicit

Creates a new IURLRequest object by copying from another but with a rewritten URL.

◆ ~IURLRequest()

virtual CeresEngine::IURLRequest::~IURLRequest ( )
virtualdefaultnoexcept

Destroys the URLRequest.

Member Data Documentation

◆ cachePolicy

CachePolicy CeresEngine::IURLRequest::cachePolicy = CachePolicy::Default

The request's cache policy.

◆ mode

URLRequestModeFlags CeresEngine::IURLRequest::mode = URLRequestMode::Read

Determines the mode the request should be performed.

By defualt, all requests are in read-only mode, but some protocols may support writing. To request writing support, the Write flag must be set.

◆ url

const URL CeresEngine::IURLRequest::url

The URL of the request.


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