diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2018-12-16 10:10:13 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2018-12-16 10:10:13 +0000 |
| commit | 44a3c91e7eafa402acfd551ee4bf41ed36dfa8f8 (patch) | |
| tree | 6e6b39ba25ea264787772458b6c1e2c7b7f84675 /src/object/uri.h | |
| parent | add some Inkscape::URI tests (diff) | |
| download | inkscape-44a3c91e7eafa402acfd551ee4bf41ed36dfa8f8.tar.gz inkscape-44a3c91e7eafa402acfd551ee4bf41ed36dfa8f8.zip | |
Inkscape::URI::Impl -> shared_ptr
Diffstat (limited to 'src/object/uri.h')
| -rw-r--r-- | src/object/uri.h | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/src/object/uri.h b/src/object/uri.h index 4650be137..2e627cb59 100644 --- a/src/object/uri.h +++ b/src/object/uri.h @@ -12,8 +12,8 @@ #ifndef INKSCAPE_URI_H #define INKSCAPE_URI_H -#include <exception> #include <libxml/uri.h> +#include <memory> #include <string> namespace Inkscape { @@ -39,11 +39,6 @@ public: URI(); /** - * Copy constructor. - */ - URI(URI const &uri); - - /** * Constructor from a C-style ASCII string. * * @param preformed Properly quoted C-style string to be represented. @@ -55,11 +50,6 @@ public: explicit URI(char const *preformed, URI const &baseuri); /** - * Destructor. - */ - ~URI(); - - /** * Determines if the URI represented is an 'opaque' URI. * * @return \c true if the URI is opaque, \c false if hierarchial. @@ -191,28 +181,12 @@ public: */ bool hasScheme(const char *scheme) const; - /** - * Assignment operator. - */ - URI &operator=(URI const &uri); - private: - class Impl { - public: - static Impl *create(xmlURIPtr uri); - void reference(); - void unreference(); - - private: - Impl(xmlURIPtr uri); - ~Impl(); - int _refcount; - public: - xmlURIPtr _uri; - }; - Impl *_impl; - - xmlURIPtr _xmlURIPtr() const { return _impl->_uri; } + std::shared_ptr<xmlURI> m_shared; + + void init(xmlURI *ptr) { m_shared.reset(ptr, xmlFreeURI); } + + xmlURI *_xmlURIPtr() const { return m_shared.get(); } }; } /* namespace Inkscape */ |
