syndication: replace boost::shared_ptr<T> with std::shared_ptr<T> where possible

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-08-24 18:42:08 +03:00
parent ba472bb7f1
commit 7a8dcdeb39
18 changed files with 76 additions and 95 deletions

View file

@ -23,14 +23,12 @@
#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

View file

@ -23,12 +23,11 @@
#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 {

View file

@ -24,12 +24,11 @@
#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

View file

@ -23,13 +23,11 @@
#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

View file

@ -23,15 +23,13 @@
#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 {

View file

@ -24,15 +24,13 @@
#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 {

View file

@ -31,15 +31,14 @@
#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)));
}
};

View file

@ -31,16 +31,14 @@
#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)));
}
};

View file

@ -31,16 +31,14 @@
#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)));
}
};

View file

@ -24,10 +24,11 @@
#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;
};

View file

@ -22,21 +22,19 @@
#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 {

View file

@ -23,13 +23,12 @@
#ifndef SYNDICATION_RDF_RESOURCE_H
#define SYNDICATION_RDF_RESOURCE_H
#include <syndication/rdf/node.h>
#include <QString>
#include <QList>
#include <memory>
#include <boost/shared_ptr.hpp>
#include <QString>
#include <QList>
#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

View file

@ -22,9 +22,11 @@
#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

View file

@ -22,12 +22,12 @@
#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

View file

@ -22,11 +22,11 @@
#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;
};

View file

@ -23,17 +23,16 @@
#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;
};

View file

@ -20,6 +20,10 @@
*
*/
#include <QtXml/qdom.h>
#include <QtCore/QString>
#include <QtCore/QList>
#include <rss2/item.h>
#include <rss2/category.h>
#include <rss2/enclosure.h>
@ -30,10 +34,6 @@
#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;
}

View file

@ -23,16 +23,15 @@
#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