Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

G4UIcsh Class Reference

#include <G4UIcsh.hh>

Inheritance diagram for G4UIcsh:

Inheritance graph
[legend]
Collaboration diagram for G4UIcsh:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 G4UIcsh (const G4String &prompt="%s >")
 ~G4UIcsh ()
virtual G4String GetCommandLine (const char *msg=0)

Constructor & Destructor Documentation

G4UIcsh::G4UIcsh const G4String &  prompt = "%s >"  ) 
 

Definition at line 34 of file G4UIcsh.cc.

00035  : G4VUIshell(prompt)
00037 {
00038 }

G4UIcsh::~G4UIcsh  ) 
 

Definition at line 41 of file G4UIcsh.cc.

00043 {
00044 }


Member Function Documentation

G4String G4UIcsh::GetCommandLine const char *  msg = 0  )  [virtual]
 

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:


The documentation for this class was generated from the following files:
Generated on Fri Jun 22 11:07:09 2007 by doxygen 1.3.4