/////////////////////////////////////// Method used for command completion ////// ///////////////////////////////////////
| 180 | // Method used for command completion ////// |
| 181 | //////////////////////////////////////////// |
| 182 | G4String 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 | |
| 199 | G4String G4VBasicShell::FindMatchingPath(G4UIcommandTree* aTree, const G4String& aCommandPath) |
| 200 | { |
no test coverage detected