#include <G4UIterminal.hh>
Definition at line 71 of file G4UIterminal.hh.
◆ G4UIterminal()
Definition at line 91 of file G4UIterminal.cc.
95 UI-> SetSession(
this);
96 UI-> SetCoutDestination(
this);
101 if(aShell)
shell= aShell;
static G4ThreadLocal G4VUIshell * theshell
static void SignalHandler(G4int)
static G4UImanager * GetUIpointer()
◆ ~G4UIterminal()
G4UIterminal::~G4UIterminal |
( |
| ) |
|
Definition at line 114 of file G4UIterminal.cc.
120 UI-> SetSession(NULL);
121 UI-> SetCoutDestination(NULL);
static G4UImanager * GetUIpointer()
◆ ExecuteCommand()
void G4UIterminal::ExecuteCommand |
( |
const G4String & |
aCommand | ) |
|
|
privatevirtual |
Reimplemented from G4VBasicShell.
Definition at line 161 of file G4UIterminal.cc.
164 if(aCommand.length()<2)
return;
166 G4int returnVal =
UI-> ApplyCommand(aCommand);
168 G4int paramIndex = returnVal % 100;
171 G4int commandStatus = returnVal - paramIndex;
177 switch(commandStatus) {
182 if( aCommand.
index(
"@@") != G4String::npos) {
187 G4cerr <<
"illegal application state -- command refused" <<
G4endl;
199 G4cerr <<
"Parameter is out of candidate list (index " << paramIndex <<
")" <<
G4endl;
203 G4cerr <<
"Parameter is wrong type and/or is not omittable (index " << paramIndex <<
")" <<
G4endl;
207 G4cerr <<
"command refused (" << commandStatus <<
")" <<
G4endl;
G4UIcommand * FindCommand(const char *commandName) const
G4UIparameter * GetParameter(G4int i) const
str_size index(const char *, G4int pos=0) const
G4GLOB_DLL std::ostream G4cout
G4String GetParameterCandidates() const
G4String SolveAlias(const char *aCmd)
G4GLOB_DLL std::ostream G4cerr
◆ ExitHelp()
void G4UIterminal::ExitHelp |
( |
| ) |
const |
|
privatevirtual |
◆ GetCommand()
G4String G4UIterminal::GetCommand |
( |
const char * |
msg = 0 | ) |
|
|
private |
Definition at line 212 of file G4UIterminal.cc.
218 newCommand=
shell-> GetCommandLineString(msg);
221 if( nC.length() == 0 ) {
222 newCommand= nullString;
224 }
else if( nC(0) ==
'#' ) {
226 newCommand= nullString;
228 }
else if(nC==
"ls" || nC.substr(0,3)==
"ls " ) {
230 newCommand= nullString;
232 }
else if(nC==
"lc" || nC.substr(0,3)==
"lc " ) {
234 newCommand= nullString;
236 }
else if(nC ==
"pwd") {
237 G4cout <<
"Current Command Directory : " 239 newCommand= nullString;
241 }
else if(nC ==
"cwd") {
242 shell-> ShowCurrentDirectory();
243 newCommand= nullString;
245 }
else if(nC ==
"cd" || nC.substr(0,3) ==
"cd ") {
248 newCommand= nullString;
250 }
else if(nC ==
"help" || nC.substr(0,5) ==
"help ") {
252 newCommand= nullString;
254 }
else if(nC(0) ==
'?') {
256 newCommand= nullString;
258 }
else if(nC ==
"hist" || nC ==
"history") {
259 G4int nh=
UI-> GetNumberOfHistory();
260 for (
G4int i=0; i<nh; i++) {
263 newCommand= nullString;
265 }
else if(nC(0) ==
'!') {
269 std::istringstream is(tt);
271 G4int nh=
UI-> GetNumberOfHistory();
273 newCommand=
UI-> GetPreviousCommand(vl);
276 G4cerr <<
"history " << vl <<
" is not found." <<
G4endl;
277 newCommand= nullString;
280 }
else if(nC ==
"exit") {
283 G4cout <<
"Please abort it using \"/run/abort\" command first" <<
G4endl;
284 G4cout <<
" and use \"continue\" command until the application" 289 newCommand= nullString;
292 }
else if( nC ==
"cont" || nC ==
"continue"){
294 newCommand= nullString;
296 }
else if( nC.empty() ){
297 newCommand= nullString;
void ChangeDirectoryCommand(const G4String &)
void TerminalHelp(const G4String &)
G4String & remove(str_size)
G4String strip(G4int strip_Type=trailing, char c=' ')
void ShowCurrent(const G4String &) const
G4String GetCurrentWorkingDirectory() const
G4GLOB_DLL std::ostream G4cout
G4String ModifyToFullPathCommand(const char *aCommandLine) const
void ListDirectory(const G4String &) const
G4String GetPreviousCommand(G4int i) const
G4GLOB_DLL std::ostream G4cerr
◆ GetHelpChoice()
◆ PauseSessionStart()
void G4UIterminal::PauseSessionStart |
( |
const G4String & |
msg | ) |
|
|
virtual |
Implements G4VBasicShell.
Definition at line 148 of file G4UIterminal.cc.
G4String GetCommand(const char *msg=0)
virtual void ExecuteCommand(const G4String &aCommand)
◆ ReceiveG4cerr()
◆ ReceiveG4cout()
◆ SessionStart()
Implements G4VBasicShell.
Definition at line 134 of file G4UIterminal.cc.
G4String GetCommand(const char *msg=0)
virtual void ExecuteCommand(const G4String &aCommand)
◆ SetPrompt()
void G4UIterminal::SetPrompt |
( |
const G4String & |
prompt | ) |
|
◆ iCont
◆ iExit
◆ shell
◆ UI
The documentation for this class was generated from the following files: