Reader and writer for MNA project containers — .mna (JSON, human-editable) and .mnx (CBOR, compact binary with "MNX1" magic).
More...


Go to the source code of this file.
Classes | |
| class | MNALIB::MnaIO |
Namespaces | |
| namespace | MNALIB |
| MNE Analysis Container Format (mna/mnx). | |
Reader and writer for MNA project containers — .mna (JSON, human-editable) and .mnx (CBOR, compact binary with "MNX1" magic).
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
MNALIB::MnaIO is the single dispatch point between an on-disk project file and an in-memory MNALIB::MnaProject. The public MnaIO::read and MnaIO::write helpers pick the right codec by extension so callers never have to branch: .mna routes to a UTF-8 JSON serialiser intended for diff-friendly version control and hand editing, while .mnx routes to a CBOR stream prefixed with the four-byte "MNX1" magic for fast loading of large projects with thousands of file references.
Both codecs are lossless and symmetric: a JSON project written, read back, re-serialised as CBOR and read again must yield the same MNALIB::MnaProject, including unknown keys preserved via extras on every nested struct. That guarantee is what lets collaborators on different MNALIB versions exchange projects without silently dropping fields.
Definition in file mna_io.h.