Make wxTemp[F]File classes non default ctor explicit

There should really be no reason to ever implicitly convert a string to
a file.
This commit is contained in:
Vadim Zeitlin
2020-02-21 14:56:06 +01:00
parent 3e0780e811
commit ebc0f056c0
4 changed files with 4 additions and 4 deletions

View File

@@ -118,7 +118,7 @@ public:
// default // default
wxTempFFile() { } wxTempFFile() { }
// associates the temp file with the file to be replaced and opens it // associates the temp file with the file to be replaced and opens it
wxTempFFile(const wxString& strName); explicit wxTempFFile(const wxString& strName);
// open the temp file (strName is the name of file to be replaced) // open the temp file (strName is the name of file to be replaced)
bool Open(const wxString& strName); bool Open(const wxString& strName);

View File

@@ -147,7 +147,7 @@ public:
// default // default
wxTempFile() { } wxTempFile() { }
// associates the temp file with the file to be replaced and opens it // associates the temp file with the file to be replaced and opens it
wxTempFile(const wxString& strName); explicit wxTempFile(const wxString& strName);
// open the temp file (strName is the name of file to be replaced) // open the temp file (strName is the name of file to be replaced)
bool Open(const wxString& strName); bool Open(const wxString& strName);

View File

@@ -54,7 +54,7 @@ public:
@warning @warning
You should use IsOpened() to verify that the constructor succeeded. You should use IsOpened() to verify that the constructor succeeded.
*/ */
wxTempFFile(const wxString& strName); explicit wxTempFFile(const wxString& strName);
/** /**
Destructor calls Discard() if temporary file is still open. Destructor calls Discard() if temporary file is still open.

View File

@@ -52,7 +52,7 @@ public:
@warning @warning
You should use IsOpened() to verify that the constructor succeeded. You should use IsOpened() to verify that the constructor succeeded.
*/ */
wxTempFile(const wxString& strName); explicit wxTempFile(const wxString& strName);
/** /**
Destructor calls Discard() if temporary file is still open. Destructor calls Discard() if temporary file is still open.