Skip to main content

FiffDirEntry

Namespace: FIFFLIB  ·  Library: FIFF Library

#include <fiff/fiff_dir_entry.h>

class FIFFLIB::FiffDirEntry

Directory entry: tag kind + on-disk type + byte size + absolute file offset (16-byte record).

Exact memory image of the legacy fiffDirEntryRec record: kind (32-bit), type (32-bit), size (32-bit), pos (32-bit). The arrays of these records materialize the FIFF_DIR tag at the tail of every well-formed FIFF file and drive random-access tag lookup in FiffStream.

src/examples/ex_fiff_structure/main.cpp
QFile structureFile(rawPath);
FiffStream::SPtr stream(new FiffStream(&structureFile));
ok &= stream->open();
const QList<FiffDirEntry::SPtr>& directory = stream->dir(); // every tag (kind, type, size, position) + a kind -1 end
const FiffTime created = stream->id().time; // seconds and microseconds since 1970
stream->close();
src/examples/ex_fiff_structure/main.cpp
// The raw data directory: one FiffRawDir per data buffer, each pointing at its FiffDirEntry in the file.
int samples = 0;
for (const FiffRawDir& buffer : raw.rawdir)
samples += buffer.nsamp;
const FiffDirEntry::SPtr firstBuffer = raw.rawdir.first().ent;

Public Methods​

FiffDirEntry()​

Constructs the dir entry.


FiffDirEntry(p_FiffDirEntry)​

Copy constructor.

Parameters:

  • p_FiffDirEntry : const FiffDirEntry & Dir Entry which should be copied.

~FiffDirEntry()​

Destroys the dir entry.


Static Methods​

storageSize()​

Size of the old struct (fiffDirEntryRec) 4int = 44 = 16.

Returns:

  • qint32 — the size of the old struct fiffDirEntryRec.

Example​

Used in examples​

ex_fiff_structure​

FIFF library: fixed-length epochs, CTF compensation, the file directory and raw buffers, and handing.

src/examples/ex_fiff_structure/main.cpp, line 110
int samples = 0;
for (const FiffRawDir& buffer : raw.rawdir)
samples += buffer.nsamp;
const FiffDirEntry::SPtr firstBuffer = raw.rawdir.first().ent;
// mne.io.read_raw_fif: 2 buffers, 6007 samples from first_samp 12900; fiff_open lists 640 directory entries
ok &= expect(raw.rawdir.size() == 2 && samples == 6007 && raw.rawdir.first().first == 12900 && firstBuffer->kind == FIFF_DATA_BUFFER,
"FiffRawDir/FiffDirEntry: 2 data buffers cover the 6007 samples from sample 12900");

Authors of this file​