From 54089b4523a81b5e545bb1aaa38a645a1e289710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Fri, 10 Jan 2020 12:50:28 +0100 Subject: [PATCH] modernization --- Zip/include/Poco/Zip/Decompress.h | 8 +++++--- Zip/include/Poco/Zip/ZipArchive.h | 8 ++++---- Zip/include/Poco/Zip/ZipManipulator.h | 2 +- Zip/include/Poco/Zip/ZipOperation.h | 2 +- Zip/include/Poco/Zip/ZipStream.h | 5 +++-- Zip/src/Decompress.cpp | 4 ++-- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Zip/include/Poco/Zip/Decompress.h b/Zip/include/Poco/Zip/Decompress.h index ca4ae296a..591c9718d 100644 --- a/Zip/include/Poco/Zip/Decompress.h +++ b/Zip/include/Poco/Zip/Decompress.h @@ -36,11 +36,13 @@ class Zip_API Decompress: public ParseCallback /// Decompress extracts files from zip files, can be used to extract single files or all files { public: - typedef std::map ZipMapping; + using ZipMapping = std::map; /// Maps key of FileInfo entries to their local decompressed representation - Poco::FIFOEvent > EError; + + Poco::FIFOEvent> EError; /// Thrown whenever an error is detected when handling a ZipLocalFileHeader entry. The string contains an error message - Poco::FIFOEvent > EOk; + + Poco::FIFOEvent> EOk; /// Thrown whenever a file was successfully decompressed Decompress(std::istream& in, const Poco::Path& outputDir, bool flattenDirs = false, bool keepIncompleteFiles = false); diff --git a/Zip/include/Poco/Zip/ZipArchive.h b/Zip/include/Poco/Zip/ZipArchive.h index 8951d59e9..a70f5ec45 100644 --- a/Zip/include/Poco/Zip/ZipArchive.h +++ b/Zip/include/Poco/Zip/ZipArchive.h @@ -38,10 +38,10 @@ class Zip_API ZipArchive /// A ZipArchive contains information on the content of a zip file { public: - typedef std::map FileHeaders; - typedef std::map FileInfos; - typedef std::map DirectoryInfos; - typedef std::map DirectoryInfos64; + using FileHeaders = std::map; + using FileInfos = std::map; + using DirectoryInfos = std::map; + using DirectoryInfos64 = std::map; ZipArchive(std::istream& in); /// Creates the ZipArchive from a file. Note that the in stream will be in state failed after the constructor is finished diff --git a/Zip/include/Poco/Zip/ZipManipulator.h b/Zip/include/Poco/Zip/ZipManipulator.h index 0e7e6e06d..5d9896b20 100644 --- a/Zip/include/Poco/Zip/ZipManipulator.h +++ b/Zip/include/Poco/Zip/ZipManipulator.h @@ -88,7 +88,7 @@ private: /// Compresses the new file to outFile private: - typedef std::map Changes; + using Changes = std::map; const std::string _zipFile; bool _backupOriginalFile; diff --git a/Zip/include/Poco/Zip/ZipOperation.h b/Zip/include/Poco/Zip/ZipOperation.h index 8825ff533..2f0ea32ea 100644 --- a/Zip/include/Poco/Zip/ZipOperation.h +++ b/Zip/include/Poco/Zip/ZipOperation.h @@ -36,7 +36,7 @@ class Zip_API ZipOperation: public Poco::RefCountedObject /// Abstract super class for operations on individual zip entries { public: - typedef Poco::AutoPtr Ptr; + using Ptr = Poco::AutoPtr; ZipOperation(); /// Creates the ZipOperation. diff --git a/Zip/include/Poco/Zip/ZipStream.h b/Zip/include/Poco/Zip/ZipStream.h index bd26daa48..b8a102897 100644 --- a/Zip/include/Poco/Zip/ZipStream.h +++ b/Zip/include/Poco/Zip/ZipStream.h @@ -65,8 +65,9 @@ private: STREAM_BUFFER_SIZE = 1024 }; - typedef Poco::SharedPtr PtrIStream; - typedef Poco::SharedPtr PtrOStream; + using PtrIStream = Poco::SharedPtr; + using PtrOStream = Poco::SharedPtr; + std::istream* _pIstr; std::ostream* _pOstr; PtrIStream _ptrBuf; diff --git a/Zip/src/Decompress.cpp b/Zip/src/Decompress.cpp index 8d3a60985..f2d2893e3 100644 --- a/Zip/src/Decompress.cpp +++ b/Zip/src/Decompress.cpp @@ -46,7 +46,7 @@ Decompress::Decompress(std::istream& in, const Poco::Path& outputDir, bool flatt } if (!tmp.isDirectory()) throw Poco::IOException("Failed to create/open directory: " + _outDir.toString()); - EOk += Poco::Delegate >(this, &Decompress::onOk); + EOk += Poco::Delegate>(this, &Decompress::onOk); } @@ -55,7 +55,7 @@ Decompress::~Decompress() { try { - EOk -= Poco::Delegate >(this, &Decompress::onOk); + EOk -= Poco::Delegate>(this, &Decompress::onOk); } catch (...) {