Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
+65 -56
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UIterminal.cc,v 1.2 1999/04/13 01:26:28 yhajime Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4UIterminal.cc,v 1.4.4.1.2.1 1999/12/07 20:49:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "G4UIterminal.hh"
@@ -86,7 +86,9 @@ G4int G4UIterminal::ReceiveG4cerr(G4String cerrString)
void G4UIterminal::ExecuteCommand(G4String aCommand)
{
if(aCommand.length()<2) return;
int commandStatus = UI->ApplyCommand(aCommand);
switch(commandStatus)
{
@@ -94,7 +96,7 @@ void G4UIterminal::ExecuteCommand(G4String aCommand)
break;
case fCommandNotFound:
G4cerr << "command <" << aCommand << "> not found" << endl;
if ( aCommand.index("@@") != RW_NPOS) {
if ( aCommand.index("@@") != G4std::string::npos) {
G4cout << "@@G4UIterminal" << endl;
}
break;
@@ -116,8 +118,11 @@ G4String G4UIterminal::GetCommand()
{
G4cout << promptCharacter;
G4cout.flush();
newCommand.readLine( cin );
newCommand.readLine( cin, FALSE );
if (!cin.good()) { cin.clear(); newCommand = nullString; iExit=false; break; }
newCommand = newCommand.strip(G4String::leading);
if( newCommand.length() < 1 ) { break; }
while( newCommand(newCommand.length()-1) == '_' )
{
G4String newLine;
@@ -128,72 +133,76 @@ G4String G4UIterminal::GetCommand()
}
G4String nC = newCommand.strip(G4String::leading);
// -------------------- nC.toUpper();
if( nC.length() < 1 ){ break; }
if( nC(0) == '#' )
{ G4cout << nC << endl; }
{ G4cout << nC << endl; }
else if( nC == "ls" || nC(0,3) == "ls " )
{ ListDirectory( nC ); }
{ ListDirectory( nC ); }
else if( nC == "pwd" )
{
G4cout << "Current Working Directory : "
<< GetCurrentWorkingDirectory() << endl;
}
{
G4cout << "Current Working Directory : "
<< GetCurrentWorkingDirectory() << endl;
}
else if( nC == "cd" || nC(0,3) == "cd " )
{ ChangeDirectoryCommand( nC ); }
{ ChangeDirectoryCommand( nC ); }
else if( nC == "help" || nC(0,5) == "help " )
{ TerminalHelp( nC ); }
{ TerminalHelp( nC ); }
else if( nC(0) == '?' )
{ ShowCurrent( nC ); }
{ ShowCurrent( nC ); }
else if( nC == "hist" || nC == "history" )
{
G4int nh = UI->GetNumberOfHistory();
for(int i=0;i<nh;i++)
{ G4cout << i << ": " << UI->GetPreviousCommand(i) << endl; }
}
{
G4int nh = UI->GetNumberOfHistory();
for(int i=0;i<nh;i++)
{ G4cout << i << ": " << UI->GetPreviousCommand(i) << endl; }
}
else if( nC(0) == '!' )
{
G4String ss = nC(1,nC.length()-1);
G4int vl;
const char* tt = ss;
istrstream is((char*)tt);
is >> vl;
G4int nh = UI->GetNumberOfHistory();
if(vl>=0 && vl<nh)
{
newCommand = UI->GetPreviousCommand(vl);
G4cout << newCommand << endl;
break;
}
else
{ G4cerr << "history " << vl << " is not found." << endl; }
}
{
G4String ss = nC(1,nC.length()-1);
G4int vl;
const char* tt = ss;
istrstream is((char*)tt);
is >> vl;
G4int nh = UI->GetNumberOfHistory();
if(vl>=0 && vl<nh)
{
newCommand = UI->GetPreviousCommand(vl);
G4cout << newCommand << endl;
break;
}
else
{ G4cerr << "history " << vl << " is not found." << endl; }
}
else if( nC == "exit" )
{
if( iCont )
{
G4cout << "You are now processing RUN." << endl;
G4cout << "Please abort it using \"/run/abort\" command first" << endl;
G4cout << " and use \"continue\" command until the application" << endl;
G4cout << " becomes to Idle." << endl;
}
else
{
iExit = false;
newCommand = nullString;
break;
}
}
{
if( iCont )
{
G4cout << "You are now processing RUN." << endl;
G4cout << "Please abort it using \"/run/abort\" command first" << endl;
G4cout << " and use \"continue\" command until the application" << endl;
G4cout << " becomes to Idle." << endl;
}
else
{
iExit = false;
newCommand = nullString;
break;
}
}
else if( nC == "cont" || nC == "continue" )
{
iCont = false;
newCommand = nullString;
break;
}
{
iCont = false;
newCommand = nullString;
break;
}
else
{ break; }
{ break; }
}
return ModifyToFullPathCommand(newCommand);
}
G4bool G4UIterminal::GetHelpChoice(G4int& aInt){
cin >> aInt;
if(!cin.good()){