* \brief Return the folder the Aspect is contained in or 0 if there is none. * * The returned folder may be the aspect itself if it inherits Folder. */
| 470 | * The returned folder may be the aspect itself if it inherits Folder. |
| 471 | */ |
| 472 | Folder* AbstractAspect::folder() { |
| 473 | if (inherits(AspectType::Folder)) |
| 474 | return static_cast<class Folder*>(this); |
| 475 | AbstractAspect* parent_aspect = parentAspect(); |
| 476 | while (parent_aspect && !parent_aspect->inherits(AspectType::Folder)) |
| 477 | parent_aspect = parent_aspect->parentAspect(); |
| 478 | return static_cast<class Folder*>(parent_aspect); |
| 479 | } |
| 480 | |
| 481 | /** |
| 482 | * \brief Return whether the there is a path upwards to the given aspect |
no test coverage detected