MCPcopy Create free account
hub / github.com/Geant4/geant4 / Complete

Method Complete

source/interfaces/core/src/G4VBasicShell.cc:182–197  ·  view source on GitHub ↗

/////////////////////////////////////// Method used for command completion ////// ///////////////////////////////////////

Source from the content-addressed store, hash-verified

180// Method used for command completion //////
181////////////////////////////////////////////
182G4String G4VBasicShell::Complete(const G4String& commandName)
183{
184 const G4String& rawCommandLine = commandName;
185 const G4String& commandLine = G4StrUtil::strip_copy(rawCommandLine);
186
187 std::size_t i = commandLine.find(' ');
188 if (i != std::string::npos)
189 return rawCommandLine; // Already entering parameters,
190 // assume command path is correct.
191 G4String commandString = commandLine;
192 G4String targetCom = ModifyPath(commandString);
193 G4UIcommandTree* tree = G4UImanager::GetUIpointer()->GetTree();
194 G4String value = FindMatchingPath(tree, targetCom);
195 if (value.empty()) return rawCommandLine;
196 return value;
197}
198
199G4String G4VBasicShell::FindMatchingPath(G4UIcommandTree* aTree, const G4String& aCommandPath)
200{

Callers 1

keyHandlerMethod · 0.80

Calls 3

findMethod · 0.45
GetTreeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected