Inkscape
Vector Graphics Editor
|
TODO: insert short description here. More...
Go to the source code of this file.
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. | |
TODO: insert short description here.
Definition in file extract-uri.h.
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 20 of file extract-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::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 103 of file extract-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 108 of file extract-uri.cpp.
References try_extract_uri().
Referenced by Inkscape::Extension::Internal::SvgBuilder::_getGradientNode(), and Inkscape::Extension::Internal::SvgBuilder::popGroup().