From 7251a96da6a268f8820ea6e384484c3626db1b26 Mon Sep 17 00:00:00 2001 From: Christoph Hasse Date: Sun, 25 Jul 2021 18:52:27 +0200 Subject: [PATCH] remove exv_grep_keys_t type alias --- contrib/Qt/main.cpp | 3 ++- include/exiv2/version.hpp | 4 +--- samples/exifprint.cpp | 3 ++- src/exiv2app.hpp | 6 ++---- src/version.cpp | 8 ++++---- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/contrib/Qt/main.cpp b/contrib/Qt/main.cpp index 552f06f6..56217ca8 100644 --- a/contrib/Qt/main.cpp +++ b/contrib/Qt/main.cpp @@ -21,12 +21,13 @@ #include #include #include +#include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); - exv_grep_keys_t keys; + std::vector keys; Exiv2::dumpLibraryInfo(std::cout,keys); return 0; diff --git a/include/exiv2/version.hpp b/include/exiv2/version.hpp index 24514067..4daeca92 100644 --- a/include/exiv2/version.hpp +++ b/include/exiv2/version.hpp @@ -28,8 +28,6 @@ // + standard includes #include #include -using exv_grep_keys_t = std::vector; - /*! @brief Make an integer version number for comparison from a major, minor and @@ -123,7 +121,7 @@ namespace Exiv2 { @brief dumpLibraryInfo implements the exiv2 option --version --verbose used by exiv2 test suite to inspect libraries loaded at run-time */ - EXIV2API void dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys); + EXIV2API void dumpLibraryInfo(std::ostream& os,const std::vector& keys); } // namespace Exiv2 diff --git a/samples/exifprint.cpp b/samples/exifprint.cpp index 02015672..0b8daf89 100644 --- a/samples/exifprint.cpp +++ b/samples/exifprint.cpp @@ -23,6 +23,7 @@ #include #include #include +#include // https://github.com/Exiv2/exiv2/issues/468 #if defined(EXV_UNICODE_PATH) && defined(__MINGW__) @@ -72,7 +73,7 @@ try { if ( _tstrcmp(file,_t("--version")) == 0 ) { - exv_grep_keys_t keys; + std::vector keys; Exiv2::dumpLibraryInfo(std::cout,keys); return rc; } else if ( _tstrcmp(file,_t("--version-test")) == 0 ) { diff --git a/src/exiv2app.hpp b/src/exiv2app.hpp index bc1f8566..4168fa4c 100644 --- a/src/exiv2app.hpp +++ b/src/exiv2app.hpp @@ -149,8 +149,6 @@ public: using Files = std::vector; //! Container for preview image numbers using PreviewNumbers = std::set; - //! Container for greps - using Greps = exv_grep_keys_t; //! Container for keys using Keys = std::vector; @@ -252,8 +250,8 @@ public: std::string suffix_; //!< File extension of the file to insert Files files_; //!< List of non-option arguments. PreviewNumbers previewNumbers_; //!< List of preview numbers - Greps greps_; //!< List of keys to 'grep' from the metadata - Keys keys_; //!< List of keys to match from the metadata + std::vector greps_; //!< List of keys to 'grep' from the metadata + Keys keys_; //!< List of keys to match from the metadata std::string charset_; //!< Charset to use for UNICODE Exif user comment Exiv2::DataBuf stdinBuf; //!< DataBuf with the binary bytes from stdin diff --git a/src/version.cpp b/src/version.cpp index 16bdf359..a583bd19 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -113,7 +113,7 @@ namespace Exiv2 { } } // namespace Exiv2 -static bool shouldOutput(const exv_grep_keys_t& greps,const char* key,const std::string& value) +static bool shouldOutput(const std::vector& greps,const char* key,const std::string& value) { bool bPrint = greps.empty(); for (auto const& g : greps) { @@ -125,12 +125,12 @@ static bool shouldOutput(const exv_grep_keys_t& greps,const char* key,const std: return bPrint; } -static void output(std::ostream& os,const exv_grep_keys_t& greps,const char* name,const std::string& value) +static void output(std::ostream& os,const std::vector& greps,const char* name,const std::string& value) { if ( shouldOutput(greps,name,value) ) os << name << "=" << value << std::endl; } -static void output(std::ostream& os,const exv_grep_keys_t& greps,const char* name,int value) +static void output(std::ostream& os,const std::vector& greps,const char* name,int value) { std::ostringstream stringStream; stringStream << value; @@ -221,7 +221,7 @@ static std::vector getLoadedLibraries() return libs; } -void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys) +void Exiv2::dumpLibraryInfo(std::ostream& os,const std::vector& keys) { int bits = 8*sizeof(void*); #ifdef NDEBUG