v2.0.0
Loading...
Searching...
No Matches
fiff_dir_node.h
Go to the documentation of this file.
1//=============================================================================================================
36
37#ifndef FIFF_DIR_NODE_H
38#define FIFF_DIR_NODE_H
39
40//=============================================================================================================
41// INCLUDES
42//=============================================================================================================
43
44#include "fiff_global.h"
45#include "fiff_constants.h"
46#include "fiff_types.h"
47#include "fiff_dir_entry.h"
48#include "fiff_id.h"
49
50//=============================================================================================================
51// QT INCLUDES
52//=============================================================================================================
53
54#include <QList>
55#include <QSharedPointer>
56#include <QStringList>
57#include <memory>
58
59//=============================================================================================================
60// DEFINE NAMESPACE FIFFLIB
61//=============================================================================================================
62
63namespace FIFFLIB
64{
65
66class FiffStream;
67class FiffTag;
68
69//=============================================================================================================
76public:
77 using SPtr = QSharedPointer<FiffDirNode>;
78 using ConstSPtr = QSharedPointer<const FiffDirNode>;
79 using UPtr = std::unique_ptr<FiffDirNode>;
80 using ConstUPtr = std::unique_ptr<const FiffDirNode>;
81
82 //=========================================================================================================
87
88 //=========================================================================================================
94 FiffDirNode(const FiffDirNode* p_FiffDirTree);
95
96 //=========================================================================================================
100 ~FiffDirNode();
101
102 //=========================================================================================================
113 static bool copy_tree(QSharedPointer<FiffStream>& p_pStreamIn, const FiffId& in_id, const QList< QSharedPointer<FiffDirNode> >& p_Nodes, QSharedPointer<FiffStream>& p_pStreamOut);
114
115 //=========================================================================================================
121 inline bool isEmpty() const
122 {
123 return this->type < 0;
124 }
125
126 //=========================================================================================================
134 QList<FiffDirNode::SPtr> dir_tree_find(fiff_int_t p_kind) const;
135
136 //=========================================================================================================
150 inline bool find_tag(QSharedPointer<FiffStream>& p_pStream, fiff_int_t findkind, std::unique_ptr<FiffTag>& p_pTag) const;
151
152 //=========================================================================================================
166 bool find_tag(FiffStream* p_pStream, fiff_int_t findkind, std::unique_ptr<FiffTag>& p_pTag) const;
167
168 //=========================================================================================================
176 bool has_tag(fiff_int_t findkind);
177
178 //=========================================================================================================
186 bool has_kind(fiff_int_t p_kind) const;
187
188 //=========================================================================================================
194 void print(int indent) const;
195
196 //=========================================================================================================
202 static void explain_block(int kind);
203
204 //=========================================================================================================
210 static void explain (int kind);
211
212 //=========================================================================================================
220 static const char *get_tag_explanation (int kind);
221
222 //=========================================================================================================
228 fiff_int_t nent() const;
229
230 //=========================================================================================================
236 fiff_int_t nchild() const;
237
238public:
241 QList<FiffDirEntry::SPtr> dir;
242// fiff_int_t nent; /**< Number of entries in this node. */
243 QList<FiffDirEntry::SPtr> dir_tree;
248 QList<FiffDirNode::SPtr> children;
249// fiff_int_t nchild; /**< Number of child nodes. */ -> use nchild() instead
250
251};
252
253//=============================================================================================================
254// INLINE DEFINITIONS
255//=============================================================================================================
256
257inline bool FiffDirNode::find_tag(QSharedPointer<FiffStream> &p_pStream, fiff_int_t findkind, std::unique_ptr<FiffTag> &p_pTag) const
258{
259 return find_tag(p_pStream.data(), findkind, p_pTag);
260}
261} // NAMESPACE
262
263#endif // FIFF_DIR_NODE_H
Fiff library export/import macros.
#define FIFFSHARED_EXPORT
Definition fiff_global.h:52
Fiff constants.
FiffDirEntry class declaration.
FiffId class declaration.
Old fiff_type declarations - replace them.
FIFF file I/O and data structures (raw, epochs, evoked, covariance, forward).
qint32 fiff_int_t
Definition fiff_types.h:89
fiff_int_t nchild() const
QList< FiffDirNode::SPtr > children
bool find_tag(FiffStream *p_pStream, fiff_int_t findkind, std::unique_ptr< FiffTag > &p_pTag) const
std::unique_ptr< const FiffDirNode > ConstUPtr
static void explain(int kind)
FiffDirNode::SPtr parent
QSharedPointer< FiffDirNode > SPtr
static void explain_block(int kind)
fiff_int_t nent() const
static const char * get_tag_explanation(int kind)
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
QList< FiffDirEntry::SPtr > dir_tree
std::unique_ptr< FiffDirNode > UPtr
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)
QSharedPointer< const FiffDirNode > ConstSPtr
Universally unique identifier.
Definition fiff_id.h:68
FIFF File I/O routines.
FIFF data tag.
Definition fiff_tag.h:153