|
CeresEngine 0.2.0
A game development framework
|
The implementation of a URL requester. More...
#include <CeresEngine/Foundation/IO/URLSession.hpp>
Classes | |
| class | Task |
| An object that manages the task for a URL request. More... | |
Public Member Functions | |
| URLProtocol (URLSession &session) noexcept | |
Creates a new URLProtocol instance. | |
| virtual | ~URLProtocol () noexcept=default |
Destroys the URLProtocol instance. | |
| virtual bool | isRequestSupported (const URLRequest &request)=0 |
Checks if the given request is supported by the protocol. | |
| virtual URLRequest | prepareRequest (URLRequest &&request) |
| If the request is supported by the protocol, this method is called to perform and transformation that the protocol may be require on the user request object. | |
| virtual Async< URLResponse > | execute (Task &connection)=0 |
| Executes a request. | |
| virtual StringView | getName () const noexcept=0 |
| Returns a string that identifies the protocol by a name. | |
Protected Attributes | |
| URLSession & | mSession |
| The session that owns this protocol instance. | |
Friends | |
| class | URLSession |
The implementation of a URL requester.
|
inlineexplicitnoexcept |
Creates a new URLProtocol instance.
|
virtualdefaultnoexcept |
Destroys the URLProtocol instance.
|
pure virtual |
Executes a request.
The connection object is passed and is guaranteed to be alive for as long as the the `execute()ยด coroutine remains alive.
| connection | The URL connection object that contains context for the execution. |
Implemented in CeresEngine::FileURLProtocol.
|
pure virtualnoexcept |
Returns a string that identifies the protocol by a name.
Implemented in CeresEngine::TURLProtocol< T, N >, and CeresEngine::TURLProtocol< FileURLProtocol, "File">.
|
pure virtual |
Checks if the given request is supported by the protocol.
This method will be called very often, so it must be efficiently implemented.
| request | The request to check for support. |
Implemented in CeresEngine::FileURLProtocol.
|
inlinevirtual |
If the request is supported by the protocol, this method is called to perform and transformation that the protocol may be require on the user request object.
All transformations will be performed on a copy of the request object and will be passed to execute().
| request | The request to be transformed. |
request. Reimplemented in CeresEngine::TURLProtocol< T, N >, and CeresEngine::TURLProtocol< FileURLProtocol, "File">.
|
friend |
|
protected |
The session that owns this protocol instance.