ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4UItcsh Class Reference

#include <geant4/tree/geant4-10.6-release/source/interfaces/basic/include/G4UItcsh.hh>

+ Inheritance diagram for G4UItcsh:
+ Collaboration diagram for G4UItcsh:

Public Member Functions

 G4UItcsh (const G4String &prompt="%s> ", G4int maxhist=100)
 
 ~G4UItcsh ()
 
void SetLsColor (TermColorIndex dirColor, TermColorIndex cmdColor)
 
virtual G4String GetCommandLineString (const char *msg=0)
 
virtual void ResetTerminal ()
 
- Public Member Functions inherited from G4VUIshell
 G4VUIshell (const G4String &prompt="> ")
 
virtual ~G4VUIshell ()
 
void SetNColumn (G4int ncol)
 
void SetPrompt (const G4String &prompt)
 
void SetCurrentDirectory (const G4String &ccd)
 
virtual void ShowCurrentDirectory () const
 
virtual void ListCommand (const G4String &input, const G4String &candidate="") const
 

Protected Member Functions

virtual void MakePrompt (const char *msg=0)
 
G4bool IsCursorLast () const
 
void InitializeCommandLine ()
 
G4String ReadLine ()
 
void InsertCharacter (char cc)
 
void BackspaceCharacter ()
 
void DeleteCharacter ()
 
void ClearLine ()
 
void ClearAfterCursor ()
 
void ClearScreen ()
 
void ForwardCursor ()
 
void BackwardCursor ()
 
void MoveCursorTop ()
 
void MoveCursorEnd ()
 
void NextCommand ()
 
void PreviousCommand ()
 
void ListMatchedCommand ()
 
void CompleteCommand ()
 
G4String GetFirstMatchedString (const G4String &str1, const G4String &str2) const
 
void StoreHistory (G4String aCommand)
 
G4String RestoreHistory (G4int index)
 
void SetTermToInputMode ()
 
void RestoreTerm ()
 
- Protected Member Functions inherited from G4VUIshell
G4UIcommandTreeGetCommandTree (const G4String &dir) const
 
G4String GetAbsCommandDirPath (const G4String &apath) const
 
G4String GetCommandPathTail (const G4String &apath) const
 

Protected Attributes

G4String commandLine
 
G4int cursorPosition
 
G4String commandLineBuf
 
std::vector< G4StringcommandHistory
 
G4int maxHistory
 
G4int currentHistoryNo
 
G4int relativeHistoryIndex
 
termios tios
 
G4String clearString
 
- Protected Attributes inherited from G4VUIshell
G4String promptSetting
 
G4String promptString
 
G4int nColumn
 
G4bool lsColorFlag
 
TermColorIndex directoryColor
 
TermColorIndex commandColor
 
G4String currentCommandDir
 

Detailed Description

Definition at line 70 of file G4UItcsh.hh.

View newest version in sPHENIX GitHub at line 70 of file G4UItcsh.hh

Constructor & Destructor Documentation

G4UItcsh::G4UItcsh ( const G4String prompt = "%s> ",
G4int  maxhist = 100 
)

Definition at line 65 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 65 of file G4UItcsh.cc

References G4String::both, BUFSIZE, test::fname, historyFileName, in, StoreHistory(), G4String::strip(), and tios.

+ Here is the call graph for this function:

G4UItcsh::~G4UItcsh ( )

Definition at line 98 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 98 of file G4UItcsh.cc

References currentHistoryNo, test::fname, G4endl, historyFileName, maxHistory, and RestoreHistory().

+ Here is the call graph for this function:

Member Function Documentation

void G4UItcsh::BackspaceCharacter ( )
protected

Definition at line 219 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 219 of file G4UItcsh.cc

References AsciiBS, commandLine, cursorPosition, G4cout, and IsCursorLast().

Referenced by ReadLine().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4UItcsh::BackwardCursor ( )
protected

Definition at line 325 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 325 of file G4UItcsh.cc

References AsciiBS, cursorPosition, and G4cout.

Referenced by ReadLine().

+ Here is the caller graph for this function:

void G4UItcsh::ClearAfterCursor ( )
protected

Definition at line 284 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 284 of file G4UItcsh.cc

References AsciiBS, commandLine, cursorPosition, G4cout, and IsCursorLast().

Referenced by ReadLine().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4UItcsh::ClearLine ( )
protected

Definition at line 268 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 268 of file G4UItcsh.cc

References AsciiBS, commandLine, cursorPosition, and G4cout.

Referenced by NextCommand(), and PreviousCommand().

+ Here is the caller graph for this function:

void G4UItcsh::ClearScreen ( )
protected

Definition at line 301 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 301 of file G4UItcsh.cc

References AsciiBS, clearString, commandLine, cursorPosition, G4cout, and G4VUIshell::promptString.

void G4UItcsh::CompleteCommand ( )
protected

Definition at line 438 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 438 of file G4UItcsh.cc

References AsciiBS, commandLine, G4VUIshell::currentCommandDir, cursorPosition, G4cout, G4VUIshell::GetAbsCommandDirPath(), G4VUIshell::GetCommandPathTail(), G4VUIshell::GetCommandTree(), GetFirstMatchedString(), G4String::index(), G4String::last(), G4String::leading, G4String::remove(), and G4String::strip().

Referenced by ReadLine().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4UItcsh::DeleteCharacter ( )
protected

Definition at line 247 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 247 of file G4UItcsh.cc

References AsciiBS, commandLine, cursorPosition, G4cout, and IsCursorLast().

Referenced by ReadLine().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4UItcsh::ForwardCursor ( )
protected

Definition at line 315 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 315 of file G4UItcsh.cc

References commandLine, cursorPosition, G4cout, and IsCursorLast().

Referenced by ReadLine().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4String G4UItcsh::GetCommandLineString ( const char *  msg = 0)
virtual

Implements G4VUIshell.

Definition at line 647 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 647 of file G4UItcsh.cc

References G4String::append(), FALSE, G4cout, G4endl, MakePrompt(), G4VUIshell::promptString, ReadLine(), relativeHistoryIndex, G4String::remove(), RestoreTerm(), SetTermToInputMode(), StoreHistory(), and TRUE.

+ Here is the call graph for this function:

G4String G4UItcsh::GetFirstMatchedString ( const G4String str1,
const G4String str2 
) const
protected

Definition at line 687 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 687 of file G4UItcsh.cc

Referenced by CompleteCommand().

+ Here is the caller graph for this function:

void G4UItcsh::InitializeCommandLine ( )
protected

Definition at line 187 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 187 of file G4UItcsh.cc

References commandLine, and cursorPosition.

Referenced by ReadLine().

+ Here is the caller graph for this function:

void G4UItcsh::InsertCharacter ( char  cc)
protected

Definition at line 195 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 195 of file G4UItcsh.cc

References AsciiBS, AsciiPrintableMin, commandLine, cursorPosition, G4cout, and IsCursorLast().

Referenced by ReadLine().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4bool G4UItcsh::IsCursorLast ( ) const
inlineprotected

Definition at line 133 of file G4UItcsh.hh.

View newest version in sPHENIX GitHub at line 133 of file G4UItcsh.hh

References commandLine, cursorPosition, FALSE, and TRUE.

Referenced by BackspaceCharacter(), ClearAfterCursor(), DeleteCharacter(), ForwardCursor(), InsertCharacter(), and ReadLine().

+ Here is the caller graph for this function:

void G4UItcsh::ListMatchedCommand ( )
protected

Definition at line 397 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 397 of file G4UItcsh.cc

References commandLine, G4VUIshell::currentCommandDir, G4cout, G4endl, G4VUIshell::GetAbsCommandDirPath(), G4String::last(), G4String::leading, G4VUIshell::ListCommand(), G4VUIshell::promptString, G4String::remove(), and G4String::strip().

Referenced by ReadLine().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4UItcsh::MakePrompt ( const char *  msg = 0)
protectedvirtual

Reimplemented from G4VUIshell.

Definition at line 122 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 122 of file G4UItcsh.cc

References G4String::append(), G4VUIshell::currentCommandDir, currentHistoryNo, G4StateManager::GetCurrentState(), G4StateManager::GetStateManager(), G4VUIshell::promptSetting, and G4VUIshell::promptString.

Referenced by GetCommandLineString().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4UItcsh::MoveCursorEnd ( )
protected

Definition at line 346 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 346 of file G4UItcsh.cc

References commandLine, cursorPosition, and G4cout.

Referenced by ReadLine().

+ Here is the caller graph for this function:

void G4UItcsh::MoveCursorTop ( )
protected

Definition at line 335 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 335 of file G4UItcsh.cc

References AsciiBS, cursorPosition, and G4cout.

Referenced by ReadLine().

+ Here is the caller graph for this function:

void G4UItcsh::NextCommand ( )
protected

Definition at line 377 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 377 of file G4UItcsh.cc

References ClearLine(), commandLine, commandLineBuf, currentHistoryNo, cursorPosition, G4cout, maxHistory, relativeHistoryIndex, and RestoreHistory().

Referenced by ReadLine().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4UItcsh::PreviousCommand ( )
protected

Definition at line 357 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 357 of file G4UItcsh.cc

References ClearLine(), commandLine, commandLineBuf, currentHistoryNo, cursorPosition, G4cout, maxHistory, relativeHistoryIndex, and RestoreHistory().

Referenced by ReadLine().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4String G4UItcsh::ReadLine ( )
protected

Definition at line 547 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 547 of file G4UItcsh.cc

References AsciiBS, AsciiCtrA, AsciiCtrB, AsciiCtrC, AsciiCtrD, AsciiCtrE, AsciiCtrF, AsciiCtrK, AsciiCtrL, AsciiCtrN, AsciiCtrP, AsciiCtrQ, AsciiCtrS, AsciiCtrZ, AsciiDEL, AsciiESC, AsciiTAB, BackspaceCharacter(), BackwardCursor(), ClearAfterCursor(), commandLine, CompleteCommand(), DeleteCharacter(), ForwardCursor(), G4cin, InitializeCommandLine(), InsertCharacter(), IsCursorLast(), ListMatchedCommand(), MoveCursorEnd(), MoveCursorTop(), NextCommand(), and PreviousCommand().

Referenced by GetCommandLineString().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4UItcsh::ResetTerminal ( )
virtual

Reimplemented from G4VUIshell.

Definition at line 176 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 176 of file G4UItcsh.cc

References RestoreTerm().

+ Here is the call graph for this function:

G4String G4UItcsh::RestoreHistory ( G4int  index)
protected

Definition at line 723 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 723 of file G4UItcsh.cc

References commandHistory, currentHistoryNo, and maxHistory.

Referenced by NextCommand(), PreviousCommand(), and ~G4UItcsh().

+ Here is the caller graph for this function:

void G4UItcsh::RestoreTerm ( )
protected

Definition at line 754 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 754 of file G4UItcsh.cc

References tios.

Referenced by GetCommandLineString(), and ResetTerminal().

+ Here is the caller graph for this function:

void G4UItcsh::SetLsColor ( TermColorIndex  dirColor,
TermColorIndex  cmdColor 
)
inlinevirtual

Reimplemented from G4VUIshell.

Definition at line 139 of file G4UItcsh.hh.

View newest version in sPHENIX GitHub at line 139 of file G4UItcsh.hh

References G4VUIshell::commandColor, G4VUIshell::directoryColor, G4VUIshell::lsColorFlag, and TRUE.

void G4UItcsh::SetTermToInputMode ( )
protected

Definition at line 738 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 738 of file G4UItcsh.cc

References tios.

Referenced by GetCommandLineString().

+ Here is the caller graph for this function:

void G4UItcsh::StoreHistory ( G4String  aCommand)
protected

Definition at line 712 of file G4UItcsh.cc.

View newest version in sPHENIX GitHub at line 712 of file G4UItcsh.cc

References commandHistory, currentHistoryNo, and maxHistory.

Referenced by G4UItcsh(), and GetCommandLineString().

+ Here is the caller graph for this function:

Member Data Documentation

G4String G4UItcsh::clearString
protected

Definition at line 116 of file G4UItcsh.hh.

View newest version in sPHENIX GitHub at line 116 of file G4UItcsh.hh

Referenced by ClearScreen().

std::vector<G4String> G4UItcsh::commandHistory
protected

Definition at line 105 of file G4UItcsh.hh.

View newest version in sPHENIX GitHub at line 105 of file G4UItcsh.hh

Referenced by RestoreHistory(), and StoreHistory().

G4String G4UItcsh::commandLineBuf
protected

Definition at line 76 of file G4UItcsh.hh.

View newest version in sPHENIX GitHub at line 76 of file G4UItcsh.hh

Referenced by NextCommand(), and PreviousCommand().

G4int G4UItcsh::currentHistoryNo
protected

Definition at line 107 of file G4UItcsh.hh.

View newest version in sPHENIX GitHub at line 107 of file G4UItcsh.hh

Referenced by MakePrompt(), NextCommand(), PreviousCommand(), RestoreHistory(), StoreHistory(), and ~G4UItcsh().

G4int G4UItcsh::maxHistory
protected

Definition at line 106 of file G4UItcsh.hh.

View newest version in sPHENIX GitHub at line 106 of file G4UItcsh.hh

Referenced by NextCommand(), PreviousCommand(), RestoreHistory(), StoreHistory(), and ~G4UItcsh().

G4int G4UItcsh::relativeHistoryIndex
protected

Definition at line 108 of file G4UItcsh.hh.

View newest version in sPHENIX GitHub at line 108 of file G4UItcsh.hh

Referenced by GetCommandLineString(), NextCommand(), and PreviousCommand().

termios G4UItcsh::tios
protected

Definition at line 115 of file G4UItcsh.hh.

View newest version in sPHENIX GitHub at line 115 of file G4UItcsh.hh

Referenced by G4UItcsh(), RestoreTerm(), and SetTermToInputMode().


The documentation for this class was generated from the following files: