Closed jief666 closed 6 years ago
@jief666 extern int mustbreak; ??
A debug leftover, sorry. I always use this kind of things to conditionally break, for example in HFSBTreeNode::traverseTree, when a condition was true in another method, for example in HFSCatalogBTree::stat (path==[somthing]).
To find a record, it may be needed to traverse node forward link like HFSBTree::findLeafNodes does.
HFSCatalogBTree::stat now follow the same logic (logic that was moved in HFSCatalogBTree::findHFSPlusCatalogFileOrFolderForParentIdAndName), HFSCatalogBTree::findLeafNodes, then looking for record in all these leaves and checking that no more than one is found.
To avoid memory problem like I had, I switched to return std::shared_ptr instead of HFSBTreeNode, and std::shared_ptr instead of HFSPlusCatalogFileOrFolder (these shared ptr retain the node while exposing the record).
This also avoid a lot of copy constructor.