Replace outdated (std::ios_base::)open_mode with openmode
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 20 May 2024 10:54:29 +0000 (12:54 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Thu, 1 Aug 2024 12:41:15 +0000 (14:41 +0200)
Otherwise we'll get a compile error on C++17.

src/tmpfstream.hpp
src/tmpfstream_impl.hpp

index f3f5eb0..d6516c6 100644 (file)
@@ -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<Device, Tr, Alloc>()
         , 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<Device, Tr, Alloc>(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<Device, Tr, Alloc>(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; 
index a87e693..31ea9d6 100644 (file)
@@ -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<Device,Tr,Alloc>::open(const std::string& tmpnametemplate, 
-               std::ios_base::open_mode mode,
+               std::ios_base::openmode mode,
                int buffer_size, int pback_size)
 {
     if (tmpfstreamTempl<Device,Tr,Alloc>::is_open())