56,
id(p_FiffDirTree->
id)
79 if(p_Nodes.size() <= 0)
84 for(k = 0; k < p_Nodes.size(); ++k)
86 p_pStreamOut->start_block(p_Nodes[k]->
type);
87 if (p_Nodes[k]->
id.version != -1)
95 for (p = 0; p < p_Nodes[k]->nent(); ++p)
106 if (!p_pStreamIn->device()->seek(p_Nodes[k]->dir[p]->pos))
108 qWarning(
"Could not seek to the tag\n");
113 auto tag = std::make_unique<FiffTag>();
116 in->setByteOrder(QDataStream::BigEndian);
133 in->readRawData(tag->data(), tag->size());
141 out->setByteOrder(QDataStream::BigEndian);
143 *out << (qint32)tag->kind;
144 *out << (qint32)tag->type;
145 *out << (qint32)tag->size();
148 out->writeRawData(tag->data(),tag->size());
150 for(p = 0; p < p_Nodes[k]->nchild(); ++p)
152 QList<FiffDirNode::SPtr> childList;
153 childList << p_Nodes[k]->children[p];
156 p_pStreamOut->end_block(p_Nodes[k]->
type);
165 QList<FiffDirNode::SPtr> nodes;
166 if(this->
type == p_kind)
169 QList<FiffDirNode::SPtr>::const_iterator i;
170 for (i = this->
children.begin(); i != this->children.end(); ++i)
171 nodes.append((*i)->dir_tree_find(p_kind));
180 for (qint32 p = 0; p < this->
nent(); ++p)
182 if (this->
dir[p]->kind == findkind)
198 for(qint32 p = 0; p < this->
nent(); ++p)
199 if(this->
dir.at(p)->kind == findkind)
208 if(this->
type == p_kind)
211 QList<FiffDirNode::SPtr>::const_iterator i;
212 for(i = this->
children.begin(); i != this->children.end(); ++i)
213 if((*i)->has_kind(p_kind))
223 int j, prev_kind,count;
224 QList<FiffDirEntry::SPtr> dentry = this->
dir;
226 for (
int k = 0; k < indent; k++)
234 for (j = 0, prev_kind = -1, count = 0; j < this->
nent(); j++) {
235 if (dentry[j]->kind != prev_kind) {
237 qDebug(
" [%d]\n",count);
240 for (
int k = 0; k < indent+2; k++)
243 prev_kind = dentry[j]->kind;
248 prev_kind = dentry[j]->kind;
251 qDebug(
" [%d]\n",count);
254 for (j = 0; j < this->
nchild(); j++)
256 for (
int k = 0; k < indent; k++)
265 for (
int k = 0; _fiff_block_explanations[k].kind >= 0; k++) {
266 if (_fiff_block_explanations[k].kind == kind) {
267 qDebug(
"%d = %s",kind,_fiff_block_explanations[k].text);
271 qWarning(
"Cannot explain: %d",kind);
279 for (k = 0; _fiff_explanations[k].kind >= 0; k++) {
280 if (_fiff_explanations[k].kind == kind) {
281 qDebug(
"%d = %s",kind,_fiff_explanations[k].text);
285 qWarning(
"Cannot explain: %d",kind);
293 for (k = 0; _fiff_explanations[k].kind >= 0; k++) {
294 if (_fiff_explanations[k].kind == kind)
295 return _fiff_explanations[k].text;
Static lookup table mapping every documented FIFF tag kind to a fixed-width human-readable label,...
Recursive node of the parsed FIFF block tree (FIFFB_* hierarchy with directory entries and children).
#define FIFF_PARENT_BLOCK_ID
#define FIFF_PARENT_FILE_ID
FIFF tag: the 16-byte tag header (kind, type, size, next) plus its decoded payload.
FIFF binary tag-stream layer: wraps a QIODevice to read and write FIFF tags, directories,...
FIFF file I/O, in-memory data structures and high-level readers/writers.
fiff_int_t nchild() const
QList< FiffDirNode::SPtr > children
static void explain(int kind)
QSharedPointer< FiffDirNode > SPtr
static void explain_block(int kind)
static const char * get_tag_explanation(int kind)
QList< FiffDirNode::SPtr > dir_tree_find(fiff_int_t p_kind) const
void print(int indent) const
bool has_kind(fiff_int_t p_kind) const
bool has_tag(fiff_int_t findkind)
QList< FiffDirEntry::SPtr > dir
bool find_tag(QSharedPointer< FiffStream > &p_pStream, fiff_int_t findkind, std::unique_ptr< FiffTag > &p_pTag) const
static bool copy_tree(QSharedPointer< FiffStream > &p_pStreamIn, const FiffId &in_id, const QList< QSharedPointer< FiffDirNode > > &p_Nodes, QSharedPointer< FiffStream > &p_pStreamOut)
128-bit FIFF identifier: hardware machine ID plus creation time, stamped on every file and block.
FIFF tag-stream reader/writer: wraps a QIODevice and exposes typed read_* / write_* methods for every...
QSharedPointer< FiffStream > SPtr
bool read_tag(std::unique_ptr< FiffTag > &p_pTag, fiff_long_t pos=-1)
std::unique_ptr< FiffTag > UPtr