Utility class for loading a URI or decoding a data URL.
More...
#include "donner/svg/resources/UrlLoader.h"
|
|
static std::optional< UrlLoaderError > | validateExternalUriRepresentation (std::string_view uri) |
| | Validate an external URI before any copy, hash, cache lookup, or callback.
|
|
|
static constexpr size_t | kDefaultMaximumResourceSize = 16 * 1024 * 1024 |
| | Default maximum decoded or fetched resource size.
|
|
static constexpr size_t | kMaximumExternalUriSize = 4096 |
| | Maximum external URI bytes accepted before copying, hashing, or invoking a callback.
|
Utility class for loading a URI or decoding a data URL.
◆ donner::svg::UrlLoader::Result
| struct donner::svg::UrlLoader::Result |
Result of loading a URI or decoding a data URL.
| Class Members |
|
vector< uint8_t > |
data |
Loaded data, either from a data URL or from a fetched URI. |
|
string |
mimeType |
MIME type of the data, if known. Otherwise, an empty string. |
◆ UrlLoader()
Create a new URL loader that uses the given resource loader to fetch external resources.
- Parameters
-
| resourceLoader | Resource loader to use for fetching external resources. |
◆ fromUri()
Read an image from a URI, which can be a file path, a URL, or a data URL (e.g.
"data:image/png;base64,...").
- Parameters
-
| uri | URI of the image, or data URL containing a base64 embedded image. |
- Returns
- Loaded image data or an error code.
The documentation for this class was generated from the following file: