Loading...
Searching...
No Matches
casacore::NewFile Class Reference
tables package (libcasa_tables) » LogTables_module

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

## Detailed Description

Do checks for a new (non-existent) file.

### Intended use:

Public interface

### Review Status

Date Reviewed:
  yyyy/mm/dd

### Etymology

Use this if you want a New File.

### Synopsis

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.

### Example

NewFile validFile; String newFileName("bigone"), error; Bool ok = validFile.valueOK(newFileName, error); if (!ok) { cout << error << endl; }

### Motivation

Output file names are fairly common parameters, this consolidates the error checking and "remove if it already exists" logic.

### To Do

- We should probably make sure that the file is writable

Definition at line 71 of file NewFile.h.

## Constructor & Destructor Documentation

## NewFile() [1/2]

casacore::NewFile::NewFile | ( | Bool | deleteIfExists = True | ) |

Currently the deleteIfExists argument has no affect.

References casacore::True.

Referenced by NewFile(), and operator=().

## NewFile() [2/2]

casacore::NewFile::NewFile | ( | const NewFile & | other | ) |

Copy constructor (copy semantics).

References NewFile().

## ~NewFile()

casacore::NewFile::~NewFile | ( |  | ) |

Destructor.

## Member Function Documentation

## operator=()

NewFile & casacore::NewFile::operator= | ( | const NewFile & | other | ) |

Assignment (copy semantics).

References NewFile().

## valueOK()

Bool casacore::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.

References casacore::NewDelAllocator< T >::value.

## Member Data Documentation

## delete_p

Bool casacore::NewFile::delete_p

private

Definition at line 92 of file NewFile.h.

The documentation for this class was generated from the following file:

- tables/LogTables/NewFile.h