
Definition at line 146 of file treebuilders.cpp.
Public Member Functions | |
| MusicFieldTreeBuilder (const QString &paths) | |
| ~MusicFieldTreeBuilder () | |
| void | makeTree (MusicNode *root, const MetadataPtrList &metas) |
Create a tree using the list of Metadata objects and add them to the given root. | |
Protected Member Functions | |
| MusicNode * | createNode (const QString &title) |
Allocates and returns a new MusicNode. | |
| bool | isLeafDone (Metadata *) |
Determine is a Metadata should be track at the current depth. | |
| QString | getField (Metadata *meta) |
Get the field value for the given Metadata at the current depth. | |
Private Member Functions | |
| QString | getSplitField (Metadata *meta, const QString &field) |
Private Attributes | |
| QStringList | m_paths |
| QMap< QChar, QString > | m_split_map |
| MusicFieldTreeBuilder::MusicFieldTreeBuilder | ( | const QString & | paths | ) | [inline] |
Definition at line 149 of file treebuilders.cpp.
| MusicFieldTreeBuilder::~MusicFieldTreeBuilder | ( | ) | [inline] |
Definition at line 154 of file treebuilders.cpp.
| void MusicFieldTreeBuilder::makeTree | ( | MusicNode * | root, | |
| const MetadataPtrList & | metas | |||
| ) | [inline, virtual] |
Create a tree using the list of Metadata objects and add them to the given root.
This method will recurse and operate of the list the metadata objects in metas. It's implementation may and probably will differ depending on the subclass of builder you've obtained, depending on the kind of tree it builds.
It relies heavily on subclasses implementing MusicTreeBuilder::isLeafDone and MusicTreeBuilder::getField for operation, and for performance, the subclasses should cache computed data in these methods as efficiently as possible.
Reimplemented from MusicTreeBuilder.
Definition at line 158 of file treebuilders.cpp.
| MusicNode* MusicFieldTreeBuilder::createNode | ( | const QString & | title | ) | [inline, protected, virtual] |
Allocates and returns a new MusicNode.
Implemented by the subclass. This method should allocate and a return a MusicNode with the approriate "level" set.
Implements MusicTreeBuilder.
Definition at line 170 of file treebuilders.cpp.
Determine is a Metadata should be track at the current depth.
Ie. the directory builder will return true if the given Metadata's path at the current depth is the filename.
Gets called repeatedly from MusicTreeBuilder::makeTree during tree creation and should only get called once pr. depth pr. Metadata.
Implements MusicTreeBuilder.
Definition at line 175 of file treebuilders.cpp.
| QString MusicFieldTreeBuilder::getField | ( | Metadata * | m | ) | [inline, protected, virtual] |
Get the field value for the given Metadata at the current depth.
Ie. the field builder will call Metadata::getField with the appropriate field name for the current dept.
Gets called repeatedly from MusicTreeBuilder::makeTree during tree creation and may get called multiple times at the same depth for the same Metadata.
Implements MusicTreeBuilder.
Definition at line 180 of file treebuilders.cpp.
| QString MusicFieldTreeBuilder::getSplitField | ( | Metadata * | meta, | |
| const QString & | field | |||
| ) | [inline, private] |
Definition at line 199 of file treebuilders.cpp.
QStringList MusicFieldTreeBuilder::m_paths [private] |
Definition at line 196 of file treebuilders.cpp.
QMap<QChar, QString> MusicFieldTreeBuilder::m_split_map [private] |
Definition at line 197 of file treebuilders.cpp.
1.5.5