Inkscape
Vector Graphics Editor
|
URI functions as per 4.3.4 of CSS 2.1 http://www.w3.org/TR/CSS21/syndata.html#uri. More...
Go to the source code of this file.
Enumerations | |
enum class | Base64Data { NONE , RASTER , SVG } |
Functions | |
std::string | extract_uri (char const *s, char const **endptr=nullptr) |
Parse functional URI notation, as per 4.3.4 of CSS 2.1. | |
std::optional< std::string > | try_extract_uri (const char *url) |
Try extracting URI from "url(xyz)" string using extract_uri. | |
std::optional< std::string > | try_extract_uri_id (const char *url) |
Try extracting the object id from "url(#obj_id)" string using extract_uri. | |
std::tuple< char const *, Base64Data > | extract_uri_data (char const *uri_data) |
Attempt to extract the data in a data uri, but does not decode the base64. | |
URI functions as per 4.3.4 of CSS 2.1 http://www.w3.org/TR/CSS21/syndata.html#uri.
Definition in file uri.h.
|
strong |
std::string extract_uri | ( | char const * | s, |
char const ** | endptr = nullptr |
||
) |
Parse functional URI notation, as per 4.3.4 of CSS 2.1.
http://www.w3.org/TR/CSS21/syndata.html#uri
The format of a URI value is 'url(' followed by optional white space followed by an optional single quote (') or double quote (") character followed by the URI itself, followed by an optional single quote (') or double quote (") character followed by optional white space followed by ')'. The two quote characters must be the same.
Example:
url = extract_uri("url('foo')bar", &out); -> url == "foo" -> out == "bar"
s | String which starts with "url(" | |
[out] | endptr | points to s + N, where N is the number of characters parsed or to a nullptr when an invalid URL is found |
Definition at line 19 of file uri.cpp.
References result.
Referenced by Inkscape::LivePathEffect::LPEPowerMask::doBeforeEffect(), find_references(), SPIShapes::read(), SPIPaint::read(), SPIFilter::read(), SPItem::set(), sp_css_uri_reference_resolve(), and try_extract_uri().
std::tuple< char const *, Base64Data > extract_uri_data | ( | char const * | uri_data | ) |
Attempt to extract the data in a data uri, but does not decode the base64.
uri_data | pointer to the uri data encoded in base64 |
base64_type | the detected base64 type based on the mime-type. |
Definition at line 117 of file uri.cpp.
References data, NONE, RASTER, and SVG.
Referenced by Inkscape::Pixbuf::create_from_data_uri(), and Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_raster().
std::optional< std::string > try_extract_uri | ( | const char * | url | ) |
Try extracting URI from "url(xyz)" string using extract_uri.
url | string input that may or may not be a link |
Definition at line 102 of file uri.cpp.
References extract_uri().
Referenced by copy_style_links(), and try_extract_uri_id().
std::optional< std::string > try_extract_uri_id | ( | const char * | url | ) |
Try extracting the object id from "url(#obj_id)" string using extract_uri.
url | string input that may or may not be a link |
Definition at line 107 of file uri.cpp.
References try_extract_uri().
Referenced by Inkscape::Extension::Internal::SvgBuilder::_getGradientNode(), and Inkscape::Extension::Internal::SvgBuilder::popGroup().