EleFits  4.0.1
A modern C++ API on top of CFitsIO

◆ write() [2/2]

template<RecordMode Mode = RecordMode::CreateOrUpdate, typename T >
void Euclid::Fits::Header::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);

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

See also
RecordMode