#include <G4UIcsh.hh>
Inheritance diagram for G4UIcsh:
Public Member Functions | |
G4UIcsh (const G4String &prompt="%s >") | |
~G4UIcsh () | |
virtual G4String | GetCommandLine (const char *msg=0) |
|
Definition at line 34 of file G4UIcsh.cc.
00035 : G4VUIshell(prompt) 00037 { 00038 } |
|
Definition at line 41 of file G4UIcsh.cc.
00043 { 00044 } |
|
Implements G4VUIshell. Definition at line 48 of file G4UIcsh.cc. References G4VUIshell::MakePrompt(), and G4VUIshell::promptString.
00050 { 00051 MakePrompt(msg); 00052 G4cout << promptString << std::flush; 00053 00054 G4String newCommand; 00055 newCommand.readLine(G4cin, FALSE); 00056 if (!G4cin.good()) { 00057 G4cin.clear(); 00058 newCommand= "exit"; 00059 return newCommand; 00060 } 00061 newCommand = newCommand.strip(1,'\r'); // fix for odd behavior on Windows 00062 00063 // multi-line 00064 while( (newCommand.length() > 0) && 00065 (newCommand[newCommand.length()-1] == '_') ) { 00066 G4String newLine; 00067 newCommand.remove(newCommand.length()-1); 00068 newLine.readLine(G4cin, FALSE); 00069 if (!G4cin.good()) { 00070 G4cin.clear(); 00071 newCommand= "exit"; 00072 return newCommand; 00073 } 00074 newCommand.append(newLine); 00075 } 00076 00077 return newCommand; 00078 } |
Here is the call graph for this function: