File tree Expand file tree Collapse file tree
include/seqan3/io/sequence_file Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,12 +146,14 @@ class sequence_file_output
146146 * See the section on \link io_compression compression and decompression \endlink for more information.
147147 */
148148 sequence_file_output (std::filesystem::path filename,
149- selected_field_ids const & SEQAN3_DOXYGEN_ONLY (fields_tag) = selected_field_ids{}) :
149+ selected_field_ids const & SEQAN3_DOXYGEN_ONLY (fields_tag) = selected_field_ids{},
150+ sequence_file_output_options output_options = sequence_file_output_options{}) :
151+ options{std::move (output_options)},
150152 primary_stream{new std::ofstream{}, stream_deleter_default}
151153 {
152154 primary_stream->rdbuf ()->pubsetbuf (stream_buffer.data (), stream_buffer.size ());
153155 static_cast <std::basic_ofstream<char > *>(primary_stream.get ())
154- ->open (filename, std::ios_base::out | std::ios::binary);
156+ ->open (filename, (options. append ? std::ios_base::app : std::ios_base:: out) | std::ios::binary);
155157
156158 if (!primary_stream->good ())
157159 throw file_open_error{" Could not open file " + filename.string () + " for writing." };
Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ struct sequence_file_output_options
4040
4141 // !\brief Complete header given for embl or genbank
4242 bool embl_genbank_complete_header = false ;
43+
44+ // !\brief Whether to open the file in append mode.
45+ bool append = false ;
4346};
4447
4548} // namespace seqan3
You can’t perform that action at this time.
0 commit comments