OSDN Git Service

syndication: replace boost::shared_ptr<T> with std::shared_ptr<T> where possible
authorIvailo Monev <xakepa10@gmail.com>
Tue, 24 Aug 2021 15:42:08 +0000 (18:42 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Tue, 24 Aug 2021 15:56:27 +0000 (18:56 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
18 files changed:
syndication/atom/content.h
syndication/atom/document.h
syndication/documentsource.h
syndication/elementwrapper.h
syndication/feed.h
syndication/item.h
syndication/mapper/mapperatomimpl.h
syndication/mapper/mapperrdfimpl.h
syndication/mapper/mapperrss2impl.h
syndication/rdf/literal.h
syndication/rdf/model.h
syndication/rdf/resource.h
syndication/rdf/resourcewrapper.h
syndication/rdf/sequence.h
syndication/rdf/statement.h
syndication/rss2/document.h
syndication/rss2/item.cpp
syndication/rss2/item.h

index 67e040a..420d91e 100644 (file)
 #ifndef SYNDICATION_ATOM_CONTENT_H
 #define SYNDICATION_ATOM_CONTENT_H
 
-#include <syndication/elementwrapper.h>
-
 #include <QtCore/QString>
-
-#include <boost/shared_ptr.hpp>
-
 #include <QByteArray>
 #include <QDomElement>
+#include <memory>
+
+#include <syndication/elementwrapper.h>
 
 namespace Syndication {
 namespace Atom {
@@ -193,7 +191,7 @@ class SYNDICATION_EXPORT Content : public ElementWrapper
 
     private:
         class ContentPrivate;
-        boost::shared_ptr<ContentPrivate> d;
+        std::shared_ptr<ContentPrivate> d;
 };
 
 } // namespace Atom
index 6685b71..f885d7b 100644 (file)
 #ifndef SYNDICATION_ATOM_DOCUMENT_H
 #define SYNDICATION_ATOM_DOCUMENT_H
 
-#include <syndication/specificdocument.h>
-#include <syndication/elementwrapper.h>
-
+#include <QList>
 #include <ctime>
 
-#include <QList>
+#include <syndication/specificdocument.h>
+#include <syndication/elementwrapper.h>
 
 namespace Syndication {
 
index ff4581b..eee35ae 100644 (file)
 #define SYNDICATION_DOCUMENTSOURCE_H
 
 #include <QtCore/QString>
-#include <boost/shared_ptr.hpp>
-
-#include "ksyndication_export.h"
-
 #include <QByteArray>
 #include <QDomDocument>
+#include <memory>
+
+#include "ksyndication_export.h"
 
 namespace Syndication {
 
@@ -134,7 +133,7 @@ class SYNDICATION_EXPORT DocumentSource
     private:
 
         class DocumentSourcePrivate;
-        boost::shared_ptr<DocumentSourcePrivate> d;
+        std::shared_ptr<DocumentSourcePrivate> d;
 };
 
 } // namespace Syndication
index 913c596..3191657 100644 (file)
 #define SYNDICATION_ELEMENTWRAPPER_H
 
 #include <QtCore/QString>
-
-#include <boost/shared_ptr.hpp>
-
-#include "ksyndication_export.h"
-
 #include <QDomElement>
 #include <QList>
+#include <memory>
+
+#include "ksyndication_export.h"
 
 namespace Syndication {
 
@@ -293,7 +291,7 @@ class SYNDICATION_EXPORT ElementWrapper
     private:
 
         class ElementWrapperPrivate;
-        boost::shared_ptr<ElementWrapperPrivate> d;
+        std::shared_ptr<ElementWrapperPrivate> d;
 };
 
 } // namespace Syndication
index ff8209f..1d47a29 100644 (file)
 #ifndef SYNDICATION_FEED_H
 #define SYNDICATION_FEED_H
 
-#include <boost/shared_ptr.hpp>
-
-#include "ksyndication_export.h"
-
 #include <QDomElement>
-
 #include <QList>
 #include <QMultiMap>
 #include <QString>
+#include <boost/shared_ptr.hpp>
+
+#include "ksyndication_export.h"
 
 namespace Syndication {
 
index b77ffd6..5fbacf2 100644 (file)
 #define SYNDICATION_ITEM_H
 
 #include <QtCore/QString>
-#include <boost/shared_ptr.hpp>
-
-#include "ksyndication_export.h"
-
-#include <ctime>
-
 #include <QDomElement>
 #include <QList>
 #include <QMultiMap>
+#include <boost/shared_ptr.hpp>
+#include <ctime>
+
+#include "ksyndication_export.h"
 
 namespace Syndication {
 
index b5b1e5a..2cf2042 100644 (file)
 #include <mapper.h>
 
 
-
 namespace Syndication {
 
 /** @internal */
 class AtomMapper : public Mapper<Feed>
 {
-    boost::shared_ptr<Feed> map(SpecificDocumentPtr doc) const
+    FeedPtr map(SpecificDocumentPtr doc) const
     {
-        return boost::shared_ptr<Feed>(new FeedAtomImpl(boost::static_pointer_cast<Atom::FeedDocument>(doc)));
+        return FeedPtr(new FeedAtomImpl(boost::static_pointer_cast<Atom::FeedDocument>(doc)));
     }
 };
 
index f737cdf..3e6ca0b 100644 (file)
 #include <feed.h>
 #include <mapper.h>
 
-
-
 namespace Syndication {
 
 /** @internal */
 class RDFMapper : public Mapper<Feed>
 {
-    boost::shared_ptr<Feed> map(SpecificDocumentPtr doc) const
+    FeedPtr map(SpecificDocumentPtr doc) const
     {
-        return boost::shared_ptr<Feed>(new FeedRDFImpl(boost::static_pointer_cast<RDF::Document>(doc)));
+        return FeedPtr(new FeedRDFImpl(boost::static_pointer_cast<RDF::Document>(doc)));
     }
 };
 
index 1d8790b..594be60 100644 (file)
 #include <feed.h>
 #include <mapper.h>
 
-
-
 namespace Syndication {
 
 /** @internal */
 class RSS2Mapper : public Mapper<Feed>
 {
-    boost::shared_ptr<Feed> map(SpecificDocumentPtr doc) const
+    FeedPtr map(SpecificDocumentPtr doc) const
     {
-        return boost::shared_ptr<Feed>(new FeedRSS2Impl(boost::static_pointer_cast<RSS2::Document>(doc)));
+        return FeedPtr(new FeedRSS2Impl(boost::static_pointer_cast<RSS2::Document>(doc)));
     }
 };
 
index d853f9b..6661f93 100644 (file)
 #define SYNDICATION_RDF_LITERAL_H
 
 #include <QtCore/QString>
-#include <syndication/rdf/node.h>
-
+#include <memory>
 #include <boost/shared_ptr.hpp>
 
+#include <syndication/rdf/node.h>
+
 namespace Syndication {
 namespace RDF {
 
@@ -154,8 +155,7 @@ class SYNDICATION_EXPORT Literal : public Node
 
     private:
         class LiteralPrivate;
-        typedef boost::shared_ptr<LiteralPrivate> LiteralPrivatePtr;
-        LiteralPrivatePtr d;
+        std::shared_ptr<LiteralPrivate> d;
 };
 
 
index 9b0172c..5366b5d 100644 (file)
 #ifndef SYNDICATION_RDF_MODEL_H
 #define SYNDICATION_RDF_MODEL_H
 
+#include <QtCore/QString>
+#include <QList>
+#include <boost/shared_ptr.hpp>
+
 #include <syndication/rdf/document.h>
 #include <syndication/rdf/resource.h>
 #include <syndication/rdf/statement.h>
-
 #include <syndication/rdf/literal.h>
 #include <syndication/rdf/node.h>
 #include <syndication/rdf/property.h>
 #include <syndication/rdf/sequence.h>
-#include <boost/shared_ptr.hpp>
 #include <syndication/ksyndication_export.h>
 
-#include <QtCore/QString>
-
-#include <QList>
-
 namespace Syndication {
 namespace RDF {
 
index ae02711..69b3a35 100644 (file)
 #ifndef SYNDICATION_RDF_RESOURCE_H
 #define SYNDICATION_RDF_RESOURCE_H
 
-#include <syndication/rdf/node.h>
-
-#include <boost/shared_ptr.hpp>
-
 #include <QString>
-
 #include <QList>
+#include <memory>
+#include <boost/shared_ptr.hpp>
+
+#include <syndication/rdf/node.h>
 
 namespace Syndication {
 namespace RDF {
@@ -205,8 +204,7 @@ class SYNDICATION_EXPORT Resource : public Node
     private:
 
         class ResourcePrivate;
-        typedef boost::shared_ptr<ResourcePrivate> ResourcePrivatePtr;
-        ResourcePrivatePtr d;
+        std::shared_ptr<ResourcePrivate> d;
 };
 
 } // namespace RDF
index 9072826..6525480 100644 (file)
 #ifndef SYNDICATION_RDF_RESOURCEWRAPPER_H
 #define SYNDICATION_RDF_RESOURCEWRAPPER_H
 
-#include <syndication/ksyndication_export.h>
+#include <memory>
 #include <boost/shared_ptr.hpp>
 
+#include <syndication/ksyndication_export.h>
+
 namespace Syndication {
 namespace RDF {
 
@@ -102,7 +104,7 @@ class SYNDICATION_EXPORT ResourceWrapper
     private:
 
         class ResourceWrapperPrivate;
-        boost::shared_ptr<ResourceWrapperPrivate> d;
+        std::shared_ptr<ResourceWrapperPrivate> d;
 };
 
 } // namespace RDF
index 06b73d9..104d03b 100644 (file)
 #ifndef SYNDICATION_RDF_SEQUENCE_H
 #define SYNDICATION_RDF_SEQUENCE_H
 
-#include <syndication/ksyndication_export.h>
-#include <syndication/rdf/resource.h>
-
+#include <QList>
+#include <memory>
 #include <boost/shared_ptr.hpp>
 
-#include <QList>
+#include <syndication/ksyndication_export.h>
+#include <syndication/rdf/resource.h>
 
 namespace Syndication {
 namespace RDF {
@@ -110,7 +110,7 @@ class SYNDICATION_EXPORT Sequence : public Resource
     private:
 
         class SequencePrivate;
-        boost::shared_ptr<SequencePrivate> d;
+        std::shared_ptr<SequencePrivate> d;
 };
 
 } // namespace RDF
index 8c19a61..5ad39b7 100644 (file)
 #ifndef SYNDICATION_RDF_STATEMENT_H
 #define SYNDICATION_RDF_STATEMENT_H
 
-#include <syndication/rdf/property.h>
-
+#include <QString>
+#include <memory>
 #include <boost/shared_ptr.hpp>
 
-#include <QString>
+#include <syndication/rdf/property.h>
 
 namespace Syndication {
 namespace RDF {
@@ -128,7 +128,7 @@ class SYNDICATION_EXPORT Statement
 
     private:
         class StatementPrivate;
-        boost::shared_ptr<StatementPrivate> d;
+        std::shared_ptr<StatementPrivate> d;
 };
 
 
index ef5acfe..3d97809 100644 (file)
 #ifndef SYNDICATION_RSS2_DOCUMENT_H
 #define SYNDICATION_RSS2_DOCUMENT_H
 
-#include <syndication/specificdocument.h>
-#include <syndication/elementwrapper.h>
-
-#include <ctime>
-
 #include <QDomDocument>
 #include <QDomElement>
 #include <QString>
-
 #include <QList>
 #include <QSet>
+#include <memory>
+#include <ctime>
+
+#include <syndication/specificdocument.h>
+#include <syndication/elementwrapper.h>
 
 namespace Syndication {
 namespace RSS2 {
@@ -311,7 +310,7 @@ class SYNDICATION_EXPORT Document : public Syndication::SpecificDocument,
         explicit Document(const QDomElement& element);
 
         class DocumentPrivate;
-        boost::shared_ptr<DocumentPrivate> d;
+        std::shared_ptr<DocumentPrivate> d;
 
 };
 
index 05f1ab0..a01189d 100644 (file)
  *
  */
 
+#include <QtXml/qdom.h>
+#include <QtCore/QString>
+#include <QtCore/QList>
+
 #include <rss2/item.h>
 #include <rss2/category.h>
 #include <rss2/enclosure.h>
 #include <specificitemvisitor.h>
 #include <tools.h>
 
-#include <QtXml/qdom.h>
-#include <QtCore/QString>
-#include <QtCore/QList>
-
 namespace Syndication {
 namespace RSS2 {
 
@@ -41,15 +41,15 @@ class Item::ItemPrivate
 {
     public:
         
-        boost::shared_ptr<Document> doc;
+        DocumentPtr doc;
 };
 
-Item::Item(boost::shared_ptr<Document> doc) : ElementWrapper(), d(new ItemPrivate)
+Item::Item(DocumentPtr doc) : ElementWrapper(), d(new ItemPrivate)
 {
     d->doc = doc;
 }
 
-Item::Item(const QDomElement& element, boost::shared_ptr<Document> doc) : ElementWrapper(element), d(new ItemPrivate)
+Item::Item(const QDomElement& element, DocumentPtr doc) : ElementWrapper(element), d(new ItemPrivate)
 {
     d->doc = doc;
 }
index c892534..06dd3c4 100644 (file)
 #ifndef SYNDICATION_RSS2_ITEM_H
 #define SYNDICATION_RSS2_ITEM_H
 
-#include <syndication/rss2/document.h>
-#include <syndication/elementwrapper.h>
-#include <boost/shared_ptr.hpp>
-#include <syndication/specificitem.h>
-
-#include <ctime>
-
 #include <QDomElement>
 #include <QString>
 #include <QList>
+#include <memory>
+#include <ctime>
+
+#include <syndication/rss2/document.h>
+#include <syndication/elementwrapper.h>
+#include <syndication/specificitem.h>
 
 namespace Syndication {
 
@@ -57,7 +56,7 @@ class SYNDICATION_EXPORT Item : public ElementWrapper, public Syndication::Speci
          * Default constructor, creates a null object, for which isNull() is
          * @c true.
          */
-        explicit Item(boost::shared_ptr<Document> doc=boost::shared_ptr<Document>());
+        explicit Item(DocumentPtr doc=DocumentPtr());
 
         /**
          * Creates an Item object wrapping an @c &lt;item> XML element.
@@ -65,7 +64,7 @@ class SYNDICATION_EXPORT Item : public ElementWrapper, public Syndication::Speci
          * @param element The @c &lt;item> element to wrap
          * @param doc the document this item is part of
          */
-        explicit Item(const QDomElement& element, boost::shared_ptr<Document> doc=boost::shared_ptr<Document>());
+        explicit Item(const QDomElement& element, DocumentPtr doc=DocumentPtr());
 
         /**
          * creates a copy of an item. As the d pointer is shared,
@@ -272,7 +271,7 @@ class SYNDICATION_EXPORT Item : public ElementWrapper, public Syndication::Speci
     private:
 
         class ItemPrivate;
-        boost::shared_ptr<ItemPrivate> d;
+        std::shared_ptr<ItemPrivate> d;
 };
 
 } // namespace RSS2