#include <G4VBasicShell.hh>
Definition at line 52 of file G4VBasicShell.hh.
G4VBasicShell::G4VBasicShell |
( |
| ) |
|
G4VBasicShell::~G4VBasicShell |
( |
| ) |
|
|
virtual |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition at line 227 of file G4VBasicShell.cc.
239 if( command(0) ==
'#' ) {
243 }
else if( command ==
"ls" || command(0,3) ==
"ls " ) {
247 }
else if( command ==
"pwd" ) {
249 G4cout <<
"Current Working Directory : "
252 }
else if( command ==
"cd" || command(0,3) ==
"cd ") {
256 }
else if( command ==
"help" || command(0,5) ==
"help ") {
260 }
else if( command(0) ==
'?' ) {
264 }
else if( command ==
"hist" || command ==
"history") {
267 for(
G4int i=0;i<nh;i++) {
271 }
else if( command(0) ==
'!' ) {
273 G4String ss = command(1,command.length()-1);
276 std::istringstream is(tt);
284 G4cerr <<
"history " << vl <<
" is not found." <<
G4endl;
287 }
else if( command ==
"exit" ) {
289 if( exitPause ==
false) {
291 G4cout <<
"Please abort it using \"/run/abort\" command first" <<
G4endl;
292 G4cout <<
" and use \"continue\" command until the application" <<
G4endl;
298 }
else if( command ==
"cont" || command ==
"continue"){
G4int GetNumberOfHistory() const
G4String GetPreviousCommand(G4int i) const
void ChangeDirectoryCommand(const G4String &)
void TerminalHelp(const G4String &)
G4String strip(G4int strip_Type=trailing, char c=' ')
static G4UImanager * GetUIpointer()
G4GLOB_DLL std::ostream G4cout
virtual void ExecuteCommand(const G4String &)
G4String ModifyToFullPathCommand(const char *aCommandLine) const
void ShowCurrent(const G4String &) const
void ListDirectory(const G4String &) const
G4String GetCurrentWorkingDirectory() const
G4GLOB_DLL std::ostream G4cerr
G4bool G4VBasicShell::ChangeDirectory |
( |
const char * |
newDir | ) |
|
|
protected |
Definition at line 75 of file G4VBasicShell.cc.
79 G4String newDirectory = ModifyPath( newPrefix );
80 if( newDirectory( newDirectory.length() - 1 ) !=
'/' )
81 { newDirectory +=
"/"; }
84 currentDirectory = newDirectory;
G4UIcommandTree * FindDirectory(const char *dirName) const
G4String strip(G4int strip_Type=trailing, char c=' ')
void G4VBasicShell::ChangeDirectoryCommand |
( |
const G4String & |
newCommand | ) |
|
|
protected |
Definition at line 321 of file G4VBasicShell.cc.
324 if( newCommand.length() <= 3 ) {
327 G4String aNewPrefix = newCommand.substr(3, newCommand.length()-3);
331 G4cout <<
"directory <" << prefix <<
"> not found." <<
G4endl;
G4String strip(G4int strip_Type=trailing, char c=' ')
G4GLOB_DLL std::ostream G4cout
G4bool ChangeDirectory(const char *newDir)
Definition at line 176 of file G4VBasicShell.cc.
178 G4String rawCommandLine = commandName;
180 size_t i = commandLine.
index(
" ");
181 if( i != std::string::npos )
return rawCommandLine;
183 G4String commandString = commandLine;
184 G4String targetCom = ModifyPath(commandString);
187 if(value==
"")
return rawCommandLine;
G4String strip(G4int strip_Type=trailing, char c=' ')
G4String FindMatchingPath(G4UIcommandTree *, const G4String &)
static G4UImanager * GetUIpointer()
str_size index(const char *, G4int pos=0) const
const XML_Char int const XML_Char * value
G4UIcommandTree * GetTree() const
void G4VBasicShell::ExecuteCommand |
( |
const G4String & |
aCommand | ) |
|
|
protectedvirtual |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Definition at line 201 of file G4VBasicShell.cc.
206 if(aCommand.length()<2)
return;
210 switch(commandStatus) {
214 G4cerr <<
"command not found: " <<
"\"" << aCommand <<
"\"" <<
G4endl;
217 G4cerr <<
"illegal application state -- command refused:" <<
"\"" << aCommand <<
"\"" <<
G4endl;
223 G4cerr <<
"command refused (" << commandStatus <<
"):" <<
"\"" << aCommand <<
"\"" <<
G4endl;
static G4UImanager * GetUIpointer()
G4int ApplyCommand(const char *aCommand)
G4GLOB_DLL std::ostream G4cerr
virtual void G4VBasicShell::ExitHelp |
( |
| ) |
const |
|
protectedpure virtual |
G4UIcommand * G4VBasicShell::FindCommand |
( |
const char * |
commandName | ) |
const |
|
protected |
Definition at line 110 of file G4VBasicShell.cc.
112 G4String rawCommandLine = commandName;
115 size_t i = commandLine.
index(
" ");
116 if( i != std::string::npos )
117 { commandString = commandLine(0,i); }
119 { commandString = commandLine; }
121 G4String targetCom = ModifyPath(commandString);
G4UIcommand * FindPath(const char *commandPath) const
G4String strip(G4int strip_Type=trailing, char c=' ')
static G4UImanager * GetUIpointer()
str_size index(const char *, G4int pos=0) const
G4UIcommandTree * GetTree() const
G4UIcommandTree * G4VBasicShell::FindDirectory |
( |
const char * |
dirName | ) |
const |
|
protected |
Definition at line 88 of file G4VBasicShell.cc.
92 G4String targetDir = ModifyPath( theDir );
93 if( targetDir( targetDir.length()-1 ) !=
'/' )
96 if( targetDir ==
"/" )
99 while( idx < targetDir.length()-1 )
101 size_t i = targetDir.
index(
"/",idx);
102 comTree = comTree->
GetTree(targetDir.substr(0,i+1).c_str());
103 if( comTree == NULL )
G4String strip(G4int strip_Type=trailing, char c=' ')
static G4UImanager * GetUIpointer()
str_size index(const char *, G4int pos=0) const
G4UIcommandTree * GetTree(G4int i)
G4UIcommandTree * GetTree() const
Definition at line 191 of file G4VBasicShell.cc.
194 return aTree-> CompleteCommandPath(aCommandPath);
G4String G4VBasicShell::GetCurrentWorkingDirectory |
( |
| ) |
const |
|
protected |
virtual G4bool G4VBasicShell::GetHelpChoice |
( |
G4int & |
| ) |
|
|
protectedpure virtual |
void G4VBasicShell::ListDirectory |
( |
const G4String & |
newCommand | ) |
const |
|
protected |
Definition at line 335 of file G4VBasicShell.cc.
338 if( newCommand.length() <= 3 ) {
341 G4String newPrefix = newCommand.substr(3, newCommand.length()-3);
345 if( commandTree == NULL ) {
346 G4cout <<
"Directory <" << targetDir <<
"> is not found." <<
G4endl;
G4UIcommandTree * FindDirectory(const char *dirName) const
G4String strip(G4int strip_Type=trailing, char c=' ')
G4GLOB_DLL std::ostream G4cout
G4String GetCurrentWorkingDirectory() const
G4String G4VBasicShell::ModifyToFullPathCommand |
( |
const char * |
aCommandLine | ) |
const |
|
protected |
Definition at line 48 of file G4VBasicShell.cc.
50 G4String rawCommandLine = aCommandLine;
51 if(rawCommandLine.
isNull()||rawCommandLine(0)==
'\0')
return rawCommandLine;
55 size_t i = commandLine.
index(
" ");
56 if( i != std::string::npos )
58 commandString = commandLine(0,i);
59 parameterString =
" ";
60 parameterString += commandLine(i+1,commandLine.length()-(i+1));
63 { commandString = commandLine; }
66 = ModifyPath( commandString )+parameterString;
67 return fullPathCommandLine;
G4String strip(G4int strip_Type=trailing, char c=' ')
str_size index(const char *, G4int pos=0) const
virtual void G4VBasicShell::PauseSessionStart |
( |
const G4String & |
Prompt | ) |
|
|
pure virtual |
void G4VBasicShell::ShowCurrent |
( |
const G4String & |
newCommand | ) |
const |
|
protected |
Definition at line 309 of file G4VBasicShell.cc.
313 G4String comString = newCommand.substr(1,newCommand.length()-1);
317 G4cout <<
"Current value(s) of the parameter(s) : " << curV <<
G4endl;
static G4UImanager * GetUIpointer()
G4GLOB_DLL std::ostream G4cout
G4String GetCurrentValues(const char *aCommand)
G4String ModifyToFullPathCommand(const char *aCommandLine) const
void G4VBasicShell::TerminalHelp |
( |
const G4String & |
newCommand | ) |
|
|
protected |
Definition at line 351 of file G4VBasicShell.cc.
356 size_t i = newCommand.
index(
" ");
357 if( i != std::string::npos )
359 G4String newValue = newCommand.substr(i+1, newCommand.length()-(i+1));
363 if( theCommand != NULL )
370 G4cout <<
"Command <" << newValue <<
" is not found." <<
G4endl;
378 size_t prefixIndex = 1;
380 while( prefixIndex < prefix.length()-1 )
382 size_t ii = prefix.
index(
"/",prefixIndex);
395 G4cout << G4endl <<
"Not a number, once more" <<
G4endl;
398 if( iFloor < (
size_t)-j ) iFloor = 0;
410 if( j <= n_tree + floor[iFloor]->GetCommandEntry() )
417 floor[iFloor+1] = floor[iFloor]->
GetTree(j);
virtual G4bool GetHelpChoice(G4int &)=0
virtual void ExitHelp() const =0
G4UIcommand * FindPath(const char *commandPath) const
G4String strip(G4int strip_Type=trailing, char c=' ')
G4UIcommand * GetCommand(G4int i)
G4int GetTreeEntry() const
static G4UImanager * GetUIpointer()
G4GLOB_DLL std::ostream G4cout
str_size index(const char *, G4int pos=0) const
G4UIcommandTree * GetTree(G4int i)
void ListCurrentWithNum() const
G4String ModifyToFullPathCommand(const char *aCommandLine) const
G4UIcommandTree * GetTree() const
G4String GetCurrentWorkingDirectory() const
The documentation for this class was generated from the following files: