diff options
| author | Martin Owens <doctormo@gmail.com> | 2018-09-26 19:37:55 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2018-09-26 19:37:55 +0000 |
| commit | 04f8745132fd9b82dc7333cb240ffbd0b7aa18fb (patch) | |
| tree | a75b36ac9002cc85c9eb0236d75a6cf79120a49e /src/object | |
| parent | Revert 9688e3858010724f4cd16664025e5c54b4e9872f (diff) | |
| parent | Fix if style with brace (diff) | |
| download | inkscape-04f8745132fd9b82dc7333cb240ffbd0b7aa18fb.tar.gz inkscape-04f8745132fd9b82dc7333cb240ffbd0b7aa18fb.zip | |
Merge branch 'style-internal-refactor'
Diffstat (limited to 'src/object')
| -rw-r--r-- | src/object/uri.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/object/uri.h b/src/object/uri.h index f0b59780e..b2cdcf778 100644 --- a/src/object/uri.h +++ b/src/object/uri.h @@ -117,6 +117,26 @@ public: char *toString() const { return _impl->toString(); } /** + * Return a more useful std::string with optional url(...) + * useful for css printing. + */ + std::string toStdString(bool with_braces=false) const { + char *uri = this->toString(); + auto ret = std::string(""); + if(uri) { + if(with_braces) { + ret += "url("; + ret += uri; + ret += ")"; + } else { + ret += uri; + } + free((void *) uri); + } + return ret; + } + + /** * Assignment operator. */ URI &operator=(URI const &uri); |
