From dcab8ed90e14a1cc4b8458aa2078733fa5517be9 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Mon, 31 Oct 2016 10:29:13 +0900 Subject: [PATCH] Allow ScopedFileCopy to be const. --- tests/utils.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/utils.h b/tests/utils.h index 7cfe9a8d..30afaf3b 100644 --- a/tests/utils.h +++ b/tests/utils.h @@ -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; }; -- 2.40.0