MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / AddDeclTypeToTree

Method AddDeclTypeToTree

neo/tools/decl/DialogDeclBrowser.cpp:128–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void DialogDeclBrowser::AddDeclTypeToTree( declType_t type, const char *root, CPathTreeCtrl &tree ) {
129 int i;
130 idList<const idDecl*> decls;
131 idPathTreeStack stack;
132 idStr rootStr, declName;
133
134 decls.SetNum( declManager->GetNumDecls( type ) );
135 for ( i = 0; i < decls.Num(); i++ ) {
136 decls[i] = declManager->DeclByIndex( type, i, false );
137 }
138 decls.Sort( idListDeclSortCompare );
139
140 rootStr = root;
141 rootStr += "/";
142
143 stack.PushRoot( NULL );
144
145 for ( i = 0; i < decls.Num(); i++) {
146 declName = rootStr + decls[i]->GetName();
147
148 declName.BackSlashesToSlashes();
149 declName.Strip(' ');
150
151 tree.AddPathToTree( declName, GetIdFromTypeAndIndex( type, decls[i]->Index() ), stack );
152 }
153}
154
155/*
156================

Callers

nothing calls this directly

Calls 10

GetNumDeclsMethod · 0.80
DeclByIndexMethod · 0.80
PushRootMethod · 0.80
StripMethod · 0.80
AddPathToTreeMethod · 0.80
SetNumMethod · 0.45
NumMethod · 0.45
SortMethod · 0.45
GetNameMethod · 0.45
IndexMethod · 0.45

Tested by

no test coverage detected