MCPcopy Create free account
hub / github.com/audacity/audacity / PathComponents

Function PathComponents

src/JournalWindowPaths.cpp:85–105  ·  view source on GitHub ↗

Find array of window names, starting with a top-level window and ending with the given window, or an empty array if the conditions fail for uniqueness of names.

Source from the content-addressed store, hash-verified

83// with the given window, or an empty array if the conditions fail for
84// uniqueness of names.
85void PathComponents( const wxWindow &window, wxArrayStringEx &components )
86{
87 if ( dynamic_cast<const wxTopLevelWindow*>( &window ) ) {
88 if ( HasUniqueNameAmongPeers( window, wxTopLevelWindows ) ) {
89 components.push_back( window.GetName() );
90 return;
91 }
92 }
93 else if ( auto pParent = window.GetParent() ) {
94 // Recur
95 PathComponents( *pParent, components );
96 if ( !components.empty() &&
97 HasUniqueNameAmongPeers( window, pParent->GetChildren() ) ) {
98 components.push_back( window.GetName() );
99 return;
100 }
101 }
102
103 // Failure
104 components.clear();
105}
106
107}
108

Callers 1

FindPathFunction · 0.85

Calls 7

HasUniqueNameAmongPeersFunction · 0.85
GetChildrenMethod · 0.80
push_backMethod · 0.45
GetNameMethod · 0.45
GetParentMethod · 0.45
emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected