v2.0.0
Loading...
Searching...
No Matches
mna_io.h File Reference

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

#include "mna_global.h"
#include "mna_project.h"
#include <QString>
Include dependency graph for mna_io.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MNALIB::MnaIO

Namespaces

namespace  MNALIB
 MNE Analysis Container Format (mna/mnx).

Detailed Description

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

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.2.0
Date
April 2026

MnaIO is the single dispatch point between an on-disk project file and an in-memory 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 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.