# Spec FormattedFileOut
Base class for writing formatted files.

Extends | FormattedFile
All Extended | FormattedFile
All Subcl's | BamFileOut, BedFileOut, GffFileOut, RoiFileOut, SeqFileOut, SimpleIntervalsFileInOut, UcscFileOut, VcfFileOut
Defined in | <seqan/stream.h>
Signature | `typedef FormattedFile<TFileFormat, Output, TSpec> FormattedFileOut;`

## Member Function Overview

### Member Functions Inherited From FormattedFile

- `getFileExtensions`
- `operatorTDependentContext`

## Interface Function Overview

- `void writeHeader(fileOut, header);`
  Write one FormattedFileHeaderConcept to a FormattedFileOut object.
- `void writeRecord(fileOut, record);`
  Write one FormattedFileRecordConcept to a FormattedFileOut object.

### Interface Functions Inherited From FormattedFile

- `atEnd`
- `close`
- `context`
- `format`
- `FormattedFile`
- `getFileExtensions`
- `guessFormat`
- `open`
- `setFormat`

## Interface Metafunction Overview

### Interface Metafunctions Inherited From FormattedFile

- `FileFormat`
- `FormattedFileContext`

## Detailed Description

A formatted output file can write Header and Records.

## Interface Functions Detail

### `void writeHeader(fileOut, header);`

Write one FormattedFileHeaderConcept to a FormattedFileOut object.

#### Parameters

`fileOut` | The FormattedFileOut object to write into.
`header` | The FormattedFileHeaderConcept to write.

#### Thrown Exceptions

`IOError` | On low-level I/O errors.
`ParseError` | On high-level file format errors.

#### Data Races

Thread safety unknown!

### `void writeRecord(fileOut, record);`

Write one FormattedFileRecordConcept to a FormattedFileOut object.

#### Parameters

`fileOut` | The FormattedFileOut object to write into.
`record` | The FormattedFileRecordConcept to write.

#### Thrown Exceptions

`IOError` | On low-level I/O errors.
`ParseError` | On high-level file format errors.

#### Data Races

Thread safety unknown!

#### Dox Sources

    /*!
     * @class FormattedFileOut
     *
     * @extends FormattedFile
     *
     * @headerfile <seqan/stream.h>
     *
     * @brief Base class for writing formatted files.
     *
     * @signature typedef FormattedFile<TFileFormat, Output, TSpec>
     *            FormattedFileOut;
     *
     * A formatted output file can write @link FormattedFileHeaderConcept Header
     * @endlink and @link FormattedFileRecordConcept Records @endlink.
     *
     * @fn FormattedFileOut#writeHeader
     *
     * @brief Write one @link FormattedFileHeaderConcept @endlink to a @link
     *        FormattedFileOut @endlink object.
     *
     * @signature void writeHeader(fileOut, header);
     *
     * @param[in,out] fileOut The @link FormattedFileOut @endlink object to write
     *                        into.
     * @param[in] header The @link FormattedFileHeaderConcept @endlink to write.
     *
     * @throw IOError On low-level I/O errors.
     * @throw ParseError On high-level file format errors.
     *
     * @fn FormattedFileOut#writeRecord
     *
     * @brief Write one @link FormattedFileRecordConcept @endlink to a @link
     *        FormattedFileOut @endlink object.
     *
     * @signature void writeRecord(fileOut, record);
     *
     * @param[in,out] fileOut The @link FormattedFileOut @endlink object to write
     *                        into.
     * @param[in] record The @link FormattedFileRecordConcept @endlink to write.
     *
     * @throw IOError On low-level I/O errors.
     * @throw ParseError On high-level file format errors.
     */