EleFits  5.3.0
A modern C++ API on top of CFITSIO
Loading...
Searching...
No Matches

◆ write() [2/2]

void write ( const std::string k,
v,
const std::string u = "",
const std::string c = "" 
) const

Write a record.

Template Parameters
ModeThe write mode
TThe record value type (automatically deduced)
Parameters
recordThe record to be written

Methods to write records may have different behaviors, according to the template parameter Mode. It specifies what to do if a keyword already exists (update or throw) and if a keyword does not exist (write or throw).

Example usages:

h.write(record);
h.write<RecordMode::CreateNew>(record);
h.write("KEY", 0);
h.write<RecordMode::CreateNew>("KEY", 0);
@ CreateNew
Create a new record, even if keyword already exists.

where h is a Header and record is a Record<T>.

See also
RecordMode