std::uint64_t sumChildren( File* aFile ) { std::uint64_t size = 0; size += aFile->m_FileInfo.m_size; for ( auto& aChild : aFile->m_children ) { if ( aChild->m_type == IT_FILE ) { size += aChild->m_FileInfo.m_size; } else { size += sumChildren( aChild.get( ) ); } } return size; }
| 282 | // return size; |
| 283 | // } |
| 284 | std::uint64_t File::CountDepth( ) { |
| 285 | std::uint64_t depth = 0; |
| 286 | auto parent = m_parent; |
| 287 | if ( parent != NULL ) { |
| 288 | return parent->CountDepth( ) + 1; |
| 289 | } |
| 290 | return depth; |
| 291 | } |
| 292 | |
| 293 | void printTree( File* treeRoot ) { |
| 294 | auto depth = treeRoot->CountDepth( ); |