# class cogs::io::DataBlock

## Overview

Definition of required interface for derived data blocks. More…

    #include <DataBlock.h>

    class DataBlock {
    public:
        // fields

        const DataBlockIndex INDEX;

        // construction

        DataBlock(DataBlockIndex index);

        // methods

        virtual DataBlockType GetType() const = 0;
        virtual uint8_t GetExportVersion() const = 0;
        virtual bool IsImportVersionSupported(uint8_t version) const = 0;
        virtual bool Import(std::istream& in_s, uint8_t version) = 0;
        virtual bool Export(std::ostream& out_s) = 0;
    };

## Detailed Documentation

Definition of required interface for derived data blocks.

### Methods

    virtual DataBlockType GetType() const = 0

Returns unique identifier of class. Usually class name.

    virtual uint8_t GetExportVersion() const = 0

Version of export function.

    virtual bool IsImportVersionSupported(uint8_t version) const = 0

Checks if specified version is supported by import function.

    virtual bool Import(std::istream& in_s, uint8_t version) = 0

Executes import form specified stream.

    virtual bool Export(std::ostream& out_s) = 0

Executes export to specified stream.