diff --git a/include/exiv2/basicio.hpp b/include/exiv2/basicio.hpp index 1ab84238..3df4625c 100644 --- a/include/exiv2/basicio.hpp +++ b/include/exiv2/basicio.hpp @@ -693,12 +693,12 @@ class EXIV2API XPathIo : public FileIo { @brief The extension of the temporary file which is created when getting input data to read metadata. This file will be deleted in destructor. */ - static constexpr std::string_view TEMP_FILE_EXT = ".exiv2_temp"; + static constexpr auto TEMP_FILE_EXT = ".exiv2_temp"; /*! @brief The extension of the generated file which is created when getting input data to add or modify the metadata. */ - static constexpr std::string_view GEN_FILE_EXT = ".exiv2"; + static constexpr auto GEN_FILE_EXT = ".exiv2"; //! @name Creators //@{ diff --git a/include/exiv2/bmffimage.hpp b/include/exiv2/bmffimage.hpp index 7fc29479..ac395606 100644 --- a/include/exiv2/bmffimage.hpp +++ b/include/exiv2/bmffimage.hpp @@ -97,15 +97,15 @@ class EXIV2API BmffImage : public Image { //! @name Manipulators //@{ - void readMetadata() override /* override */; - void writeMetadata() override /* override */; - void setComment(std::string_view comment) override /* override */; + void readMetadata() override; + void writeMetadata() override; + void setComment(const std::string& comment) override; void printStructure(std::ostream& out, Exiv2::PrintStructureOption option, int depth) override; //@} //! @name Accessors //@{ - [[nodiscard]] std::string mimeType() const override /* override */; + [[nodiscard]] std::string mimeType() const override; [[nodiscard]] uint32_t pixelWidth() const override; [[nodiscard]] uint32_t pixelHeight() const override; //@} diff --git a/include/exiv2/bmpimage.hpp b/include/exiv2/bmpimage.hpp index b37d41b2..616ca0f2 100644 --- a/include/exiv2/bmpimage.hpp +++ b/include/exiv2/bmpimage.hpp @@ -66,7 +66,7 @@ class EXIV2API BmpImage : public Image { void setIptcData(const IptcData& iptcData) override; /// @throws Error(ErrorCode::kerInvalidSettingForImage) - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/cr2image.hpp b/include/exiv2/cr2image.hpp index a7fc663d..9b67db42 100644 --- a/include/exiv2/cr2image.hpp +++ b/include/exiv2/cr2image.hpp @@ -61,7 +61,7 @@ class EXIV2API Cr2Image : public Image { @brief Not supported. CR2 format does not contain a comment. Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/epsimage.hpp b/include/exiv2/epsimage.hpp index a4b56b86..52135a88 100644 --- a/include/exiv2/epsimage.hpp +++ b/include/exiv2/epsimage.hpp @@ -65,7 +65,7 @@ class EXIV2API EpsImage : public Image { @brief Not supported. Calling this function will throw an instance of Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/futils.hpp b/include/exiv2/futils.hpp index d454846e..312391d9 100644 --- a/include/exiv2/futils.hpp +++ b/include/exiv2/futils.hpp @@ -31,7 +31,7 @@ EXIV2API std::string getEnv(int env_var); @note Source: http://www.geekhideout.com/urlcode.shtml @todo This function can probably be hidden into the implementation details */ -EXIV2API std::string urlencode(std::string_view str); +EXIV2API std::string urlencode(const std::string& str); /*! @brief Like urlencode(char* str) but accept the input url in the std::string and modify it. diff --git a/include/exiv2/gifimage.hpp b/include/exiv2/gifimage.hpp index 93bd422f..b518219e 100644 --- a/include/exiv2/gifimage.hpp +++ b/include/exiv2/gifimage.hpp @@ -69,7 +69,7 @@ class EXIV2API GifImage : public Image { @brief Not supported. Calling this function will throw an instance of Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/image.hpp b/include/exiv2/image.hpp index 8e0166b1..1fd6bf1e 100644 --- a/include/exiv2/image.hpp +++ b/include/exiv2/image.hpp @@ -177,7 +177,7 @@ class EXIV2API Image { virtual void clearXmpData(); /// @brief Set the image comment. The comment is written to the image when writeMetadata() is called. - virtual void setComment(std::string_view comment); + virtual void setComment(const std::string& comment); /*! @brief Erase any buffered comment. Comment is not removed diff --git a/include/exiv2/jp2image.hpp b/include/exiv2/jp2image.hpp index ae1a03e6..ea43dc92 100644 --- a/include/exiv2/jp2image.hpp +++ b/include/exiv2/jp2image.hpp @@ -56,7 +56,7 @@ class EXIV2API Jp2Image : public Image { @brief Todo: Not supported yet(?). Calling this function will throw an instance of Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/mrwimage.hpp b/include/exiv2/mrwimage.hpp index 8abd8df8..68dd5e91 100644 --- a/include/exiv2/mrwimage.hpp +++ b/include/exiv2/mrwimage.hpp @@ -72,7 +72,7 @@ class EXIV2API MrwImage : public Image { @brief Not supported. MRW format does not contain a comment. Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/orfimage.hpp b/include/exiv2/orfimage.hpp index 89df53bf..6fe8fed1 100644 --- a/include/exiv2/orfimage.hpp +++ b/include/exiv2/orfimage.hpp @@ -59,7 +59,7 @@ class EXIV2API OrfImage : public TiffImage { @brief Not supported. ORF format does not contain a comment. Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/psdimage.hpp b/include/exiv2/psdimage.hpp index f0585343..19ac37aa 100644 --- a/include/exiv2/psdimage.hpp +++ b/include/exiv2/psdimage.hpp @@ -53,7 +53,7 @@ class EXIV2API PsdImage : public Image { /*! @brief Not supported. Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/rafimage.hpp b/include/exiv2/rafimage.hpp index 5edd9460..799911c6 100644 --- a/include/exiv2/rafimage.hpp +++ b/include/exiv2/rafimage.hpp @@ -64,7 +64,7 @@ class EXIV2API RafImage : public Image { @brief Not supported. RAF format does not contain a comment. Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/rw2image.hpp b/include/exiv2/rw2image.hpp index 63a94066..f26745ac 100644 --- a/include/exiv2/rw2image.hpp +++ b/include/exiv2/rw2image.hpp @@ -62,7 +62,7 @@ class EXIV2API Rw2Image : public Image { @brief Not supported. RW2 format does not contain a comment. Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/tgaimage.hpp b/include/exiv2/tgaimage.hpp index 232addf3..7615280d 100644 --- a/include/exiv2/tgaimage.hpp +++ b/include/exiv2/tgaimage.hpp @@ -68,7 +68,7 @@ class EXIV2API TgaImage : public Image { @brief Not supported. Calling this function will throw an instance of Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/tiffimage.hpp b/include/exiv2/tiffimage.hpp index 75fe93eb..cdad720e 100644 --- a/include/exiv2/tiffimage.hpp +++ b/include/exiv2/tiffimage.hpp @@ -58,7 +58,7 @@ class EXIV2API TiffImage : public Image { @brief Not supported. TIFF format does not contain a comment. Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/include/exiv2/webpimage.hpp b/include/exiv2/webpimage.hpp index dd59142f..1a7da741 100644 --- a/include/exiv2/webpimage.hpp +++ b/include/exiv2/webpimage.hpp @@ -46,7 +46,7 @@ class EXIV2API WebPImage : public Image { /*! @brief Not supported. Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; void setIptcData(const IptcData& /*iptcData*/) override; //! @name Accessors diff --git a/include/exiv2/xmpsidecar.hpp b/include/exiv2/xmpsidecar.hpp index 4a319398..399b1abd 100644 --- a/include/exiv2/xmpsidecar.hpp +++ b/include/exiv2/xmpsidecar.hpp @@ -46,7 +46,7 @@ class EXIV2API XmpSidecar : public Image { @brief Not supported. XMP sidecar files do not contain a comment. Calling this function will throw an instance of Error(ErrorCode::kerInvalidSettingForImage). */ - void setComment(std::string_view comment) override; + void setComment(const std::string&) override; //@} //! @name Accessors diff --git a/src/bmffimage.cpp b/src/bmffimage.cpp index 70906a09..c8460ede 100644 --- a/src/bmffimage.cpp +++ b/src/bmffimage.cpp @@ -570,7 +570,7 @@ void BmffImage::parseCr3Preview(DataBuf& data, std::ostream& out, bool bTrace, u } } -void BmffImage::setComment(std::string_view /*comment*/) { +void BmffImage::setComment(const std::string&) { // bmff files are read-only throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "BMFF")); } diff --git a/src/bmpimage.cpp b/src/bmpimage.cpp index 63e684b2..c47932b3 100644 --- a/src/bmpimage.cpp +++ b/src/bmpimage.cpp @@ -35,7 +35,7 @@ void BmpImage::setIptcData(const IptcData& /*iptcData*/) { throw(Error(ErrorCode::kerInvalidSettingForImage, "IPTC metadata", "BMP")); } -void BmpImage::setComment(std::string_view /*comment*/) { +void BmpImage::setComment(const std::string&) { throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "BMP")); } diff --git a/src/cr2image.cpp b/src/cr2image.cpp index d3bc13cd..d5bed61b 100644 --- a/src/cr2image.cpp +++ b/src/cr2image.cpp @@ -49,7 +49,7 @@ void Cr2Image::printStructure(std::ostream& out, Exiv2::PrintStructureOption opt printTiffStructure(io(), out, option, depth - 1); } -void Cr2Image::setComment(std::string_view /*comment*/) { +void Cr2Image::setComment(const std::string&) { // not supported throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "CR2")); } diff --git a/src/epsimage.cpp b/src/epsimage.cpp index 1d1c987d..4f657c4b 100644 --- a/src/epsimage.cpp +++ b/src/epsimage.cpp @@ -1099,7 +1099,7 @@ std::string EpsImage::mimeType() const { return "application/postscript"; } -void EpsImage::setComment(std::string_view /*comment*/) { +void EpsImage::setComment(const std::string&) { throw Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "EPS"); } diff --git a/src/futils.cpp b/src/futils.cpp index 1952120d..5ee3defe 100644 --- a/src/futils.cpp +++ b/src/futils.cpp @@ -79,7 +79,7 @@ char from_hex(char ch) { return isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10; } -std::string urlencode(std::string_view str) { +std::string urlencode(const std::string& str) { std::string encoded; encoded.reserve(str.size() * 3); for (uint8_t c : str) { diff --git a/src/gifimage.cpp b/src/gifimage.cpp index caa79479..f9a9cbae 100644 --- a/src/gifimage.cpp +++ b/src/gifimage.cpp @@ -29,7 +29,7 @@ void GifImage::setIptcData(const IptcData& /*iptcData*/) { throw(Error(ErrorCode::kerInvalidSettingForImage, "IPTC metadata", "GIF")); } -void GifImage::setComment(std::string_view /*comment*/) { +void GifImage::setComment(const std::string&) { // not supported throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "GIF")); } diff --git a/src/image.cpp b/src/image.cpp index b2e10e5a..edf05d81 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -591,7 +591,7 @@ void Image::clearComment() { comment_.erase(); } -void Image::setComment(std::string_view comment) { +void Image::setComment(const std::string& comment) { comment_ = comment; } diff --git a/src/jp2image.cpp b/src/jp2image.cpp index 25e6e70d..380828da 100644 --- a/src/jp2image.cpp +++ b/src/jp2image.cpp @@ -123,7 +123,7 @@ std::string Jp2Image::mimeType() const { return "image/jp2"; } -void Jp2Image::setComment(std::string_view /*comment*/) { +void Jp2Image::setComment(const std::string&) { throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "JP2")); } diff --git a/src/mrwimage.cpp b/src/mrwimage.cpp index 2fc23b42..da73d6dc 100644 --- a/src/mrwimage.cpp +++ b/src/mrwimage.cpp @@ -48,7 +48,7 @@ void MrwImage::setIptcData(const IptcData& /*iptcData*/) { throw(Error(ErrorCode::kerInvalidSettingForImage, "IPTC metadata", "MRW")); } -void MrwImage::setComment(std::string_view /*comment*/) { +void MrwImage::setComment(const std::string&) { // not supported throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "MRW")); } diff --git a/src/orfimage.cpp b/src/orfimage.cpp index a284c5fc..a8473cf0 100644 --- a/src/orfimage.cpp +++ b/src/orfimage.cpp @@ -46,7 +46,7 @@ uint32_t OrfImage::pixelHeight() const { return 0; } -void OrfImage::setComment(std::string_view /*comment*/) { +void OrfImage::setComment(const std::string&) { // not supported throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "ORF")); } diff --git a/src/psdimage.cpp b/src/psdimage.cpp index b5e132e7..da62a70f 100644 --- a/src/psdimage.cpp +++ b/src/psdimage.cpp @@ -107,7 +107,7 @@ std::string PsdImage::mimeType() const { return "image/x-photoshop"; } -void PsdImage::setComment(std::string_view /*comment*/) { +void PsdImage::setComment(const std::string&) { // not supported throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "Photoshop")); } diff --git a/src/rafimage.cpp b/src/rafimage.cpp index 8d8c097d..22373146 100644 --- a/src/rafimage.cpp +++ b/src/rafimage.cpp @@ -52,7 +52,7 @@ void RafImage::setIptcData(const IptcData& /*iptcData*/) { throw(Error(ErrorCode::kerInvalidSettingForImage, "IPTC metadata", "RAF")); } -void RafImage::setComment(std::string_view /*comment*/) { +void RafImage::setComment(const std::string&) { // not supported throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "RAF")); } diff --git a/src/rw2image.cpp b/src/rw2image.cpp index f1f2d859..4147698a 100644 --- a/src/rw2image.cpp +++ b/src/rw2image.cpp @@ -56,7 +56,7 @@ void Rw2Image::setIptcData(const IptcData& /*iptcData*/) { throw(Error(ErrorCode::kerInvalidSettingForImage, "IPTC metadata", "RW2")); } -void Rw2Image::setComment(std::string_view /*comment*/) { +void Rw2Image::setComment(const std::string&) { // not supported throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "RW2")); } diff --git a/src/tgaimage.cpp b/src/tgaimage.cpp index 20d015f6..5cde039e 100644 --- a/src/tgaimage.cpp +++ b/src/tgaimage.cpp @@ -31,7 +31,7 @@ void TgaImage::setIptcData(const IptcData& /*iptcData*/) { throw(Error(ErrorCode::kerInvalidSettingForImage, "IPTC metadata", "TGA")); } -void TgaImage::setComment(std::string_view /*comment*/) { +void TgaImage::setComment(const std::string&) { // not supported throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "TGA")); } diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp index 518bd5b8..72ad9109 100644 --- a/src/tiffimage.cpp +++ b/src/tiffimage.cpp @@ -119,7 +119,7 @@ uint32_t TiffImage::pixelHeight() const { return pixelHeightPrimary_; } -void TiffImage::setComment(std::string_view /*comment*/) { +void TiffImage::setComment(const std::string&) { // not supported throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "TIFF")); } diff --git a/src/webpimage.cpp b/src/webpimage.cpp index c658b080..53387cce 100644 --- a/src/webpimage.cpp +++ b/src/webpimage.cpp @@ -84,7 +84,7 @@ void WebPImage::setIptcData(const IptcData& /*iptcData*/) { // throw(Error(ErrorCode::kerInvalidSettingForImage, "IPTC metadata", "WebP")); } -void WebPImage::setComment(std::string_view /*comment*/) { +void WebPImage::setComment(const std::string&) { // not supported throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "WebP")); } diff --git a/src/xmpsidecar.cpp b/src/xmpsidecar.cpp index ecb95027..23139957 100644 --- a/src/xmpsidecar.cpp +++ b/src/xmpsidecar.cpp @@ -33,7 +33,7 @@ std::string XmpSidecar::mimeType() const { return "application/rdf+xml"; } -void XmpSidecar::setComment(std::string_view /*comment*/) { +void XmpSidecar::setComment(const std::string&) { // not supported throw(Error(ErrorCode::kerInvalidSettingForImage, "Image comment", "XMP")); }