From fd4923b0df677f9bfe3789934e002e6dd9aa3102 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Mon, 20 May 2024 12:54:29 +0200 Subject: [PATCH] Replace outdated (std::ios_base::)open_mode with openmode Otherwise we'll get a compile error on C++17. --- src/tmpfstream.hpp | 22 +++++++++++----------- src/tmpfstream_impl.hpp | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/tmpfstream.hpp b/src/tmpfstream.hpp index f3f5eb0..d6516c6 100644 --- a/src/tmpfstream.hpp +++ b/src/tmpfstream.hpp @@ -93,12 +93,12 @@ public: * @param tmpnametemplate Path of the temporary file to be opened. * The last 6 characters must be XXXXXX and they * will be replaced with something random. - * @param mode std::ios_base::open_mode to open the file with + * @param mode std::ios_base::openmode to open the file with * @param buffer_size The size of any buffers that need to be allocated * @param buffer_size The size of the putback buffer, relevant only for fstream */ tmpfstreamTempl(const std::string& tmpnametemplate, - std::ios_base::open_mode mode = std::ios_base::out, + std::ios_base::openmode mode = std::ios_base::out, int buffer_size = -1 , int pback_size = -1) : bio::stream() , unlinked(false) @@ -108,7 +108,7 @@ public: } bool open(const std::string& tmpnametemplate, - std::ios_base::open_mode mode = std::ios_base::out, + std::ios_base::openmode mode = std::ios_base::out, int buffer_size = -1 , int pback_size = -1); /** @@ -201,12 +201,12 @@ public: * The temporary file will be in the same directory with .tmp.XXXXXX appended. * * @param filename The original filename which will be replaced on close - * @param mode std::ios_base::open_mode to open the file with + * @param mode std::ios_base::openmode to open the file with * @param buffer_size The size of any buffers that need to be allocated * @param buffer_size The size of the putback buffer, relevant only for fstream */ tmpfcopystreamTempl(const std::string& filename, - std::ios_base::open_mode mode = std::ios_base::out, + std::ios_base::openmode mode = std::ios_base::out, int buffer_size = -1 , int pback_size = -1) : tmpfstreamTempl(filename+default_template_suffix,mode,buffer_size,pback_size) , originalfilename(filename) @@ -225,13 +225,13 @@ public: * @param tmpnametemplate Path of the temporary file to be opened. * The last 6 characters must be XXXXXX and they * will be replaced with something random. - * @param mode std::ios_base::open_mode to open the file with + * @param mode std::ios_base::openmode to open the file with * @param buffer_size The size of any buffers that need to be allocated * @param buffer_size The size of the putback buffer, relevant only for fstream */ tmpfcopystreamTempl(const std::string& filename, const std::string& tmpnametemplate, - std::ios_base::open_mode mode = std::ios_base::out, + std::ios_base::openmode mode = std::ios_base::out, int buffer_size = -1 , int pback_size = -1) : tmpfstreamTempl(tmpnametemplate,mode,buffer_size,pback_size) , originalfilename(filename) @@ -250,13 +250,13 @@ public: * The temporary file will be in the same directory with .tmp.XXXXXX appended. * * @param filename The original filename which will be replaced on close - * @param mode std::ios_base::open_mode to open the file with + * @param mode std::ios_base::openmode to open the file with * @param buffer_size The size of any buffers that need to be allocated * @param buffer_size The size of the putback buffer, relevant only for fstream * @retval true if successful */ bool open(const std::string& filename, - std::ios_base::open_mode mode = std::ios_base::out, + std::ios_base::openmode mode = std::ios_base::out, int buffer_size = -1 , int pback_size = -1) { originalfilename=filename; @@ -273,14 +273,14 @@ public: * @param tmpnametemplate Path of the temporary file to be opened. * The last 6 characters must be XXXXXX and they * will be replaced with something random. - * @param mode std::ios_base::open_mode to open the file with + * @param mode std::ios_base::openmode to open the file with * @param buffer_size The size of any buffers that need to be allocated * @param buffer_size The size of the putback buffer, relevant only for fstream * @retval true if successful */ bool open(const std::string& filename, const std::string& tmpnametemplate, - std::ios_base::open_mode mode = std::ios_base::out, + std::ios_base::openmode mode = std::ios_base::out, int buffer_size = -1 , int pback_size = -1) { originalfilename=filename; diff --git a/src/tmpfstream_impl.hpp b/src/tmpfstream_impl.hpp index a87e693..31ea9d6 100644 --- a/src/tmpfstream_impl.hpp +++ b/src/tmpfstream_impl.hpp @@ -55,14 +55,14 @@ namespace I2n * @param tmpnametemplate Path of the temporary file to be opened. * The last 6 characters must be XXXXXX and they * will be replaced with something random. -* @param mode std::ios_base::open_mode to open the file with +* @param mode std::ios_base::openmode to open the file with * @param buffer_size The size of any buffers that need to be allocated * @param buffer_size The size of the putback buffer, relevant only for fstream * @retval true if successful */ template< typename Device, typename Tr, typename Alloc > bool tmpfstreamTempl::open(const std::string& tmpnametemplate, - std::ios_base::open_mode mode, + std::ios_base::openmode mode, int buffer_size, int pback_size) { if (tmpfstreamTempl::is_open()) -- 1.7.1