]> granicus.if.org Git - taglib/commitdiff
Allow ScopedFileCopy to be const.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Mon, 31 Oct 2016 01:29:13 +0000 (10:29 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Mon, 31 Oct 2016 01:29:13 +0000 (10:29 +0900)
tests/utils.h

index 7cfe9a8d6f245782f82e1d88f696c7cba8b8d829..30afaf3b0435c4f72fcb3fffc9379a0e9eb06a3d 100644 (file)
@@ -106,10 +106,10 @@ inline bool fileEqual(const string &filename1, const string &filename2)
 class ScopedFileCopy
 {
 public:
-  ScopedFileCopy(const string &filename, const string &ext, bool deleteFile=true)
+  ScopedFileCopy(const string &filename, const string &ext, bool deleteFile=true) :
+    m_deleteFile(deleteFile),
+    m_filename(copyFile(filename, ext))
   {
-    m_deleteFile = deleteFile;
-    m_filename = copyFile(filename, ext);
   }
 
   ~ScopedFileCopy()
@@ -118,12 +118,12 @@ public:
       deleteFile(m_filename);
   }
 
-  string fileName()
+  string fileName() const
   {
     return m_filename;
   }
 
 private:
-  bool m_deleteFile;
-  string m_filename;
+  const bool m_deleteFile;
+  const string m_filename;
 };