Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::svg::ResourceLoaderInterface Class Referenceabstract

Interface for loading external resources, such as images. More...

#include "donner/svg/resources/ResourceLoaderInterface.h"

Inheritance diagram for donner::svg::ResourceLoaderInterface:
[legend]

Public Member Functions

 ResourceLoaderInterface ()=default
 Default constructor.
 
 ResourceLoaderInterface (const ResourceLoaderInterface &)=delete
 
ResourceLoaderInterfaceoperator= (const ResourceLoaderInterface &)=delete
 
 ResourceLoaderInterface (ResourceLoaderInterface &&)=delete
 
ResourceLoaderInterfaceoperator= (ResourceLoaderInterface &&)=delete
 
virtual ~ResourceLoaderInterface ()=default
 Destructor.
 
virtual std::variant< std::vector< uint8_t >, ResourceLoaderErrorfetchExternalResource (std::string_view url)=0
 Fetch external resource from a given URL.
 

Detailed Description

Interface for loading external resources, such as images.

To load files from the local filesystem, use SandboxedFileResourceLoader.

Member Function Documentation

◆ fetchExternalResource()

virtual std::variant< std::vector< uint8_t >, ResourceLoaderError > donner::svg::ResourceLoaderInterface::fetchExternalResource ( std::string_view url)
pure virtual

Fetch external resource from a given URL.

Parameters
urlURL of the external resource.
Returns
A vector containing the fetched data, or std::nullopt if the resource could not be loaded.

Implemented in donner::svg::SandboxedFileResourceLoader.


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