casacore
|
Do checks for a new (non-existent) file. More...
#include <NewFile.h>
Public Member Functions | |
NewFile (Bool deleteIfExists=True) | |
Currently the deleteIfExists argument has no affect. More... | |
NewFile (const NewFile &other) | |
Copy constructor (copy semantics) More... | |
NewFile & | operator= (const NewFile &other) |
Assignment (copy semantics) More... | |
~NewFile () | |
Destructor. More... | |
Bool | valueOK (const String &value, String &error) const |
Indicates whether the specified string is a valid new file, invoking the choice GUI. More... | |
Private Attributes | |
Bool | delete_p |
Do checks for a new (non-existent) file.
Public interface
Use this if you want a New File.
NewFile is a class checking if a new file already exists. If the file exists, then the user is asked via Choice::choice whether or not he or she wants to delete the file before using it.
NewFile validFile; String newFileName("bigone"), error; Bool ok = validFile.valueOK(newFileName, error); if (!ok) { cout << error << endl; }
Output file names are fairly common parameters, this consolidates the error checking and "remove if it already exists" logic.
Currently the deleteIfExists argument has no affect.
casacore::NewFile::NewFile | ( | const NewFile & | other | ) |
Copy constructor (copy semantics)
casacore::NewFile::~NewFile | ( | ) |
Destructor.
Indicates whether the specified string is a valid new file, invoking the choice GUI.
If it returns False, an error message is returned.