From d5240a4bda2da10b5877b1228a092120ffcd7f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Tue, 20 Apr 2021 19:58:27 +0200 Subject: [PATCH] eps: Fix code after usage of unique_ptr. Remove deprecation tags --- include/exiv2/epsimage.hpp | 8 ++++---- src/epsimage.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/exiv2/epsimage.hpp b/include/exiv2/epsimage.hpp index 54d26e7d..dd71546e 100644 --- a/include/exiv2/epsimage.hpp +++ b/include/exiv2/epsimage.hpp @@ -56,7 +56,7 @@ namespace Exiv2 /*! @brief Class to access EPS images. */ - class EXIV2LIB_DEPRECATED_EXPORT EpsImage : public Image { + class EXIV2API EpsImage : public Image { public: //! @name Creators //@{ @@ -74,7 +74,7 @@ namespace Exiv2 @param create Specifies if an existing image should be read (false) or if a new file should be created (true). */ - EpsImage(BasicIo::AutoPtr io, bool create); + EpsImage(BasicIo::UniquePtr io, bool create); //@} //! @name Manipulators @@ -114,10 +114,10 @@ namespace Exiv2 Caller owns the returned object and the auto-pointer ensures that it will be deleted. */ - EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newEpsInstance(BasicIo::AutoPtr io, bool create); + EXIV2API Image::UniquePtr newEpsInstance(BasicIo::UniquePtr io, bool create); //! Check if the file iIo is a EPS image. - EXIV2LIB_DEPRECATED_EXPORT bool isEpsType(BasicIo& iIo, bool advance); + EXIV2API bool isEpsType(BasicIo& iIo, bool advance); } // namespace Exiv2 diff --git a/src/epsimage.cpp b/src/epsimage.cpp index 79402e62..8282bead 100644 --- a/src/epsimage.cpp +++ b/src/epsimage.cpp @@ -805,7 +805,7 @@ namespace { } // create temporary output file - BasicIo::AutoPtr tempIo(new MemIo); + BasicIo::UniquePtr tempIo(new MemIo); assert (tempIo.get() != 0); if (!tempIo->isopen()) { #ifndef SUPPRESS_WARNINGS @@ -1075,8 +1075,8 @@ namespace { namespace Exiv2 { - EpsImage::EpsImage(BasicIo::AutoPtr io, bool create) - : Image(ImageType::eps, mdXmp, io) + EpsImage::EpsImage(BasicIo::UniquePtr io, bool create) + : Image(ImageType::eps, mdXmp, std::move(io)) { //LogMsg::setLevel(LogMsg::debug); if (create) { @@ -1151,9 +1151,9 @@ namespace Exiv2 // ************************************************************************* // free functions - Image::AutoPtr newEpsInstance(BasicIo::AutoPtr io, bool create) + Image::UniquePtr newEpsInstance(BasicIo::UniquePtr io, bool create) { - Image::AutoPtr image(new EpsImage(io, create)); + Image::UniquePtr image(new EpsImage(std::move(io), create)); if (!image->good()) { image.reset(); }