casa
$Rev:20696$
|
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. | |
NewFile (const NewFile &other) | |
Copy constructor (copy semantics) | |
NewFile & | operator= (const NewFile &other) |
Assignment (copy semantics) | |
~NewFile () | |
Destructor. | |
Bool | valueOK (const String &value, String &error) const |
Indicates whether the specified string is a valid new file, invoking the choice GUI. | |
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.
casa::NewFile::NewFile | ( | Bool | deleteIfExists = True | ) |
Currently the deleteIfExists argument has no affect.
casa::NewFile::NewFile | ( | const NewFile & | other | ) |
Copy constructor (copy semantics)
Destructor.
Bool casa::NewFile::valueOK | ( | const String & | value, |
String & | error | ||
) | const |
Indicates whether the specified string is a valid new file, invoking the choice GUI.
If it returns False, an error message is returned.
Bool casa::NewFile::delete_p [private] |