#pragma once #include #include // Single authority for the image-provider URL grammar: // image:///[?src=] // The optional src query names the container file (archive, document) the // entry lives in; when absent, providers fall back to their current file. namespace ImageUrl { QString build(const QString &scheme, const QString &entry); QString build(const QString &scheme, const QString &entry, const QString &sourcePath); // "?src=" — for appending to an existing URL. QString querySuffix(const QString &sourcePath); struct Parsed { QString entry; QString sourcePath; // empty = use the provider's current file }; // Parse the id handed to QQuickAsyncImageProvider (scheme already stripped, // entry arrives percent-encoded). Parsed parseProviderId(const QString &id); // Parse a full image:// URL (IImageLoader::load path). Parsed parseImageUrl(const QUrl &url); } // namespace ImageUrl