Implementation of the MnaIO codecs — UTF-8 JSON for .mna files and CBOR (prefixed with the "MNX1" four-byte magic) for .mnx files.
More...
#include "mna_io.h"#include <QFile>#include <QFileInfo>#include <QJsonDocument>#include <QJsonObject>#include <QCborValue>#include <QCborMap>#include <QDebug>
Go to the source code of this file.
Implementation of the MnaIO codecs — UTF-8 JSON for .mna files and CBOR (prefixed with the "MNX1" four-byte magic) for .mnx files.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
The read / write entry points dispatch on the file extension and delegate to the four private helpers. The CBOR writer emits the MNX1 magic up-front so the reader can fast-fail on a mismatched binary before attempting to decode the payload; the JSON writer pretty-prints with indentation so .mna files remain diff- and human-friendly under version control. All four helpers share a strict error-handling policy: file or parse errors surface as empty projects with a warning on qWarning so callers cannot silently confuse load failures with empty input.
Definition in file mna_io.cpp.