Import Geant4 11.2.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2023-06-30 09:09:57 +02:00
parent aef78ca386
commit dd1f179cda
3780 changed files with 212808 additions and 142780 deletions
@@ -0,0 +1,57 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
#ifndef G4InteractorMessenger_h
#define G4InteractorMessenger_h 1
#include "G4UImessenger.hh"
class G4VInteractiveSession;
class G4UIdirectory;
class G4UIcommand;
class G4InteractorMessenger : public G4UImessenger
{
public:
G4InteractorMessenger(G4VInteractiveSession* session);
~G4InteractorMessenger() override;
void SetNewValue(G4UIcommand* command, G4String newValue) override;
private:
G4VInteractiveSession* session;
G4UIdirectory* interactorDirectory;
G4UIcommand* addMenu;
G4UIcommand* addButton;
G4UIcommand* addIcon;
G4UIcommand* defaultIcons;
G4UIcommand* sys;
G4UIcommand* outputStyle;
G4UIcommand* nativeMenu;
G4UIcommand* clearMenu;
};
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
#ifndef G4UIArrayString_h
#define G4UIArrayString_h
#include "globals.hh"
//
// Description:
// This class is a utility class for listing commands like
// UNIX "ls" command.
//
class G4UIArrayString
{
public:
G4UIArrayString(const G4String& stream);
~G4UIArrayString();
void Show(G4int ncol);
private:
G4String* GetElement(G4int icol, G4int irow) const;
// #rows in a column
G4int GetNRow(G4int icol) const;
// max field width of a column
G4int GetNField(G4int icol) const;
// calculate total column width
G4int CalculateColumnWidth() const;
G4String* stringArray;
G4int nElement;
G4int nColumn;
};
#endif
+48
View File
@@ -0,0 +1,48 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
#ifndef G4UIcsh_h
#define G4UIcsh_h
#include "G4VUIshell.hh"
//
// Description:
// This class gives csh-like shell. (same as dumb terminal)
//
class G4UIcsh : public G4VUIshell
{
public:
G4UIcsh(const G4String& prompt = "%s> ");
~G4UIcsh() override;
G4String GetCommandLineString(const char* msg = nullptr) override;
};
#endif
+174
View File
@@ -0,0 +1,174 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
#ifndef G4UItcsh_h
#define G4UItcsh_h 1
#if ! (defined(WIN32) || defined(__MINGW32__))
# include "G4UIcommand.hh"
# include "G4UIcommandTree.hh"
# include "G4VUIshell.hh"
# include <termios.h>
# include <vector>
// ====================================================================
// Description:
// This class gives tcsh-like shell.
//
// If your terminal supports color code, colored strings are available
// in ListCommand(). For activating color support,
// e.g.
// tcsh-> SetLsColor(GREEN, CYAN); // (dir, command) color
//
// [key binding]
// ^A ... move cursor to the top
// ^B ... backward cursor ([LEFT])
// ^D ... delete/exit/show matched list
// ^E ... move cursor to the end
// ^F ... forward cursor ([RIGHT])
// ^K ... clear after the cursor
// ^L ... clear screen (not implemented)
// ^N ... next command ([DOWN])
// ^P ... previous command ([UP])
// TAB... command completion
// DEL... backspace
// BS ... backspace
//
// [prompt string substitution]
// %s ... current application status
// %/ ... current working directory
// %h ... history# (different from G4 history#)
//
// ====================================================================
class G4UItcsh : public G4VUIshell
{
public:
G4UItcsh(const G4String& prompt = "%s> ", G4int maxhist = 100);
~G4UItcsh() override;
void SetLsColor(TermColorIndex dirColor, TermColorIndex cmdColor) override;
G4String GetCommandLineString(const char* msg = nullptr) override;
void ResetTerminal() override;
protected:
void MakePrompt(const char* msg = nullptr) override;
// Is cursor position at the last of command line ?
G4bool IsCursorLast() const;
void InitializeCommandLine();
G4String ReadLine();
// insert character
void InsertCharacter(char cc);
// backspace character
void BackspaceCharacter();
// delete character
void DeleteCharacter();
// clear command line
void ClearLine();
// clear after the cursor
void ClearAfterCursor();
// clear screen
void ClearScreen();
// move cursor forward
void ForwardCursor();
// move cursor backward
void BackwardCursor();
// move cursor to the top
void MoveCursorTop();
// move cursor to the end
void MoveCursorEnd();
// next command
void NextCommand();
// previous command
void PreviousCommand();
// list matched commands
void ListMatchedCommand();
// complete command
void CompleteCommand();
// utilities...
G4String GetFirstMatchedString(const G4String& str1, const G4String& str2) const;
void StoreHistory(G4String aCommand);
// index is global history#
G4String RestoreHistory(G4int index);
void SetTermToInputMode();
void RestoreTerm();
G4String commandLine; // command line string;
G4int cursorPosition; // cursor position
G4String commandLineBuf; // temp. command line;
// history functionality (history# is managed in itself)
std::vector<G4String> commandHistory;
G4int maxHistory; // max# of histories stored
G4int currentHistoryNo; // global
G4int relativeHistoryIndex; // local index relative to current history#
// (re)set termios
termios tios; // terminal mode (prestatus)
G4String clearString; // "clear code (^L)"
};
// ====================================================================
// inline functions
// ====================================================================
inline G4bool G4UItcsh::IsCursorLast() const
{
return cursorPosition == G4int(commandLine.length() + 1);
}
inline void G4UItcsh::SetLsColor(TermColorIndex dirColor, TermColorIndex cmdColor)
{
lsColorFlag = true;
directoryColor = dirColor;
commandColor = cmdColor;
}
#endif
#endif
@@ -0,0 +1,103 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// ====================================================================
// G4UIterminal.cc
//
// Description:
//
// This class inherits the class G4UIsession.
// This is the class to use a character-terminal sesion.
//
// Usage:
// G4UIsession* terminalSession = new G4UIterminal;
// or G4UIsession* terminalSession = new G4UIterminal(new your-shell);
//
// A character-terminal session "terminalSession" is instantiated.
// G4cout stream is redirected by default to the constructed instance.
//
// terminalSession-> SessionStart(); // "terminalSession" is started.
// delete terminalSession; // "terminalSession" is deleted.
//
//
// In default(no arguments are given), csh-like shell is instantiated.
// If you want to use another shell (e.g. tcsh-like), you can give
// your favorite shell in an argument of the constructor.
//
// Which shell? / How to define your own shell?
// Currently two kinds of shells,
// G4UIcsh / G4UItcsh
// , are presented.
// They inherit the abstract base class, G4VUIshell.
// In order to define your own shell,
// - Define your own shell class derived from G4VUIshell.
// - Implement GetCommandLine() method (pure virtual).
// - Add more functionality, if need.
//
// For more detail, see source codes.
// ====================================================================
#ifndef G4UIterminal_h
#define G4UIterminal_h 1
#include "G4UImanager.hh"
#include "G4VBasicShell.hh"
#include "G4VUIshell.hh"
#include <fstream>
class G4UIterminal : public G4VBasicShell
{
public:
G4UIterminal(G4VUIshell* aShell = nullptr, G4bool qsig = true);
~G4UIterminal() override;
void SetPrompt(const G4String& prompt);
// These methods are implementation of corresponding virtual methods
// of G4UIsession class.
G4UIsession* SessionStart() override;
void PauseSessionStart(const G4String& msg) override;
G4int ReceiveG4debug(const G4String& debugString) override;
G4int ReceiveG4cout(const G4String& coutString) override;
G4int ReceiveG4cerr(const G4String& cerrString) override;
private:
void ExecuteCommand(const G4String& aCommand) override;
G4bool GetHelpChoice(G4int& aInt) override;
void ExitHelp() const override;
G4String GetCommand(const char* msg = nullptr);
private:
G4UImanager* UI;
// shell
G4VUIshell* shell;
// program states
G4bool iExit;
G4bool iCont;
};
#endif
@@ -0,0 +1,106 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
#ifndef G4VBasicShell_H
#define G4VBasicShell_H 1
class G4UIcommandTree;
class G4UIcommand;
#include "G4UIsession.hh"
#include "globals.hh"
// Class description :
//
// G4VBasicShell : a base class to extract common things to various
// sessions.
//
// It handles "seek" completion logic, help logic.
// VBasicShell handles also commands like "cd, ls, pwd"
// without passing by a Geant4 "intercom" command. This feature,
// which is similar to a UNIX shell one, had given.
// its name to the class.
//
// Class description - end :
class G4VBasicShell : public G4UIsession
{
public:
G4VBasicShell();
~G4VBasicShell() override;
G4UIsession* SessionStart() override = 0;
// null should be returned for interactive session
void PauseSessionStart(const G4String& Prompt) override = 0;
// Prompt string can be ignored
protected:
// convert "BeamOn 10" to "/run/BeamOn 10" if the
// current working directory is "/run/"
G4String ModifyToFullPathCommand(const char* aCommandLine) const;
// directory string starts with '/' and ends with '/'
G4String GetCurrentWorkingDirectory() const;
// change directory to newDir
// false will be returned if the target directory doesn't exist
G4bool ChangeDirectory(const char* newDir);
// find G4UIcommandTree object
// null returned if the taregt does not exist
G4UIcommandTree* FindDirectory(const char* dirName) const;
// find G4UIcommand object
// null returned if the target does not exist
G4UIcommand* FindCommand(const char* commandName) const;
// command completion
G4String Complete(const G4String&);
G4String FindMatchingPath(G4UIcommandTree*, const G4String&);
/////////////////////////////////////////////
// Methods involving an interactive G4cout //
/////////////////////////////////////////////
virtual void ExecuteCommand(const G4String&);
virtual G4bool GetHelpChoice(G4int&) = 0;
virtual void ExitHelp() const = 0;
void ApplyShellCommand(const G4String&, G4bool&, G4bool&);
void ShowCurrent(const G4String&) const;
void ChangeDirectoryCommand(const G4String&);
void ListDirectory(const G4String&) const;
void TerminalHelp(const G4String&);
private:
G4String ModifyPath(const G4String& tempPath) const;
G4String currentDirectory;
};
#endif
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
#ifndef G4VInteractiveSession_H
#define G4VInteractiveSession_H 1
#include "G4VInteractorManager.hh"
#include <map>
class G4UImessenger;
class G4SceneTreeItem;
// Class description :
//
// G4VInteractiveSession is a base class to isolate common things
// to various graphical "basic" G4UI sessions ; AddMenu, AddButton,
// a dictionnary for widgets.
// The word "interactor" is for "piece of user interface" or "widget".
class G4VInteractiveSession
{
public: // with description
struct OutputStyle
{
G4bool fixed, bold, highlight;
};
G4VInteractiveSession();
virtual ~G4VInteractiveSession();
virtual void AddMenu(const char*, const char*);
virtual void AddButton(const char*, const char*, const char*);
virtual void AddIcon(const char*, const char*, const char*, const char*);
virtual void DefaultIcons(bool);
virtual void SetOutputStyle(const char*, const char*);
virtual void NativeMenu(bool);
virtual void ClearMenu();
virtual void UpdateSceneTree(const G4SceneTreeItem&);
void AddInteractor(G4String, G4Interactor);
G4Interactor GetInteractor(G4String);
const std::map<G4String, OutputStyle>& GetOutputStyles() const;
protected:
void SetStyleUtility(const G4String& destination, const G4String& style);
// clang-format off
std::map<G4String,OutputStyle> fOutputStyles {
{"cout",{true,false,true}},
{"cerr",{true,true,true}},
{"warn",{true,false,true}},
{"error",{true,true,true}},
{"debug",{true,false,true}}};
// clang-format on
private:
G4UImessenger* messenger;
using G4interactor_map = std::map<G4String, G4Interactor, std::less<G4String>>;
G4interactor_map interactors;
};
#endif
@@ -0,0 +1,105 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
// G.Barrand
#ifndef G4VINTERACTORMANAGER_HH
#define G4VINTERACTORMANAGER_HH
#include "globals.hh"
#include <vector>
using G4Interactor = void*;
using G4DispatchFunction = G4bool (*)(void*);
using G4SecondaryLoopAction = void (*)();
// Class description :
//
// G4VInteractorManager : a base class to isolate common things
// to various GUI "toolkits" like WIndows, Xt.
// The word "interactor" is for "piece of user interface" or
// "widget" (which means nothing). Then a GUI "toolkit" could be
// defined as a manager of interactors.
//
// Class description - end :
class G4VInteractorManager
{
public:
G4VInteractorManager();
virtual ~G4VInteractorManager();
void SetArguments(int, char**);
char** GetArguments(int*);
void SetMainInteractor(G4Interactor);
G4Interactor GetMainInteractor();
void AddDispatcher(G4DispatchFunction);
void RemoveDispatcher(G4DispatchFunction);
void AddSecondaryLoopPreAction(G4SecondaryLoopAction);
void AddSecondaryLoopPostAction(G4SecondaryLoopAction);
void AddShell(G4Interactor);
void RemoveShell(G4Interactor);
void EnableSecondaryLoop();
void DisableSecondaryLoop();
void SecondaryLoopPreActions();
void SecondaryLoopPostActions();
void RequireExitSecondaryLoop(int);
void DispatchEvent(void*);
virtual void SecondaryLoop();
int GetExitSecondaryLoopCode();
void PutStringInResourceDatabase(char*);
virtual G4bool Inited() = 0;
virtual void* GetEvent() = 0;
virtual void FlushAndWaitExecution() = 0;
void SetParentInteractor(G4Interactor);
G4Interactor GetParentInteractor();
void SetCreatedInteractor(G4Interactor);
G4Interactor GetCreatedInteractor();
void SetCreationString(char*);
char* GetCreationString();
private:
int argc;
char** argv;
G4Interactor mainInteractor;
std::vector<G4DispatchFunction> dispatchers;
std::vector<G4SecondaryLoopAction> preActions;
std::vector<G4SecondaryLoopAction> postActions;
std::vector<G4Interactor> shells;
G4bool secondaryLoopEnabled;
G4bool alreadyInSecondaryLoop;
int exitSecondaryLoop;
G4Interactor parentInteractor;
G4Interactor createdInteractor;
char* creationString;
};
#define OGL_EXIT_CODE 1
#define OIV_EXIT_CODE 2
#define XO_EXIT_CODE 3
#endif
@@ -0,0 +1,129 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
#ifndef G4VUIshell_h
#define G4VUIshell_h 1
#include "globals.hh"
// ====================================================================
// Description:
// This class is the abstract base class for various UI shells.
//
// GetCommadLineString() (virtual) returns a command string input from
// a commad line.
//
// Two pre-inplemented shell commands(still virtual) are also included,
// (somewhat differnt flavor from ones provided by G4VBasicShell)
// ShowCurrentDirectory() ... show current directory
// ListCommand() ... list commands
//
// [prompt string substitution] (default)
// %s ... current application status
// %/ ... current working directory
//
// ====================================================================
// terminal color index
enum TermColorIndex
{
BLACK = 0,
RED,
GREEN,
YELLOW,
BLUE,
PURPLE,
CYAN,
WHITE
};
class G4UIcommandTree;
class G4VUIshell
{
public:
G4VUIshell(const G4String& prompt = "> ");
virtual ~G4VUIshell();
void SetNColumn(G4int ncol);
void SetPrompt(const G4String& prompt);
void SetCurrentDirectory(const G4String& ccd);
virtual void SetLsColor(TermColorIndex, TermColorIndex);
// shell commands
virtual void ShowCurrentDirectory() const;
// "candidate" is specified with full path.
virtual void ListCommand(const G4String& input, const G4String& candidate = "") const;
// get command string from a command line
virtual G4String GetCommandLineString(const char* msg = nullptr) = 0;
virtual void ResetTerminal();
protected:
// make prompt string
virtual void MakePrompt(const char* msg = nullptr);
// get tree node
G4UIcommandTree* GetCommandTree(const G4String& dir) const;
// absolute path name (ignore command)
G4String GetAbsCommandDirPath(const G4String& apath) const;
// tail of path ( xxx/xxx/zzz -> zzz, trancated //// -> /)
G4String GetCommandPathTail(const G4String& apath) const;
G4String promptSetting; // including %-directive
G4String promptString;
G4int nColumn; // column size of terminal (default=80)
// color code support (effective if your terminal supports color code.)
// default setting is off.
G4bool lsColorFlag; // color flag for list command
TermColorIndex directoryColor;
TermColorIndex commandColor;
// for treating G4 command tree...
G4String currentCommandDir; // current command directory (absolute path)
};
// ====================================================================
// inline functions
// ====================================================================
inline void G4VUIshell::SetNColumn(G4int ncol) { nColumn = ncol; }
inline void G4VUIshell::SetPrompt(const G4String& prompt) { promptSetting = prompt; }
inline void G4VUIshell::SetCurrentDirectory(const G4String& dir) { currentCommandDir = dir; }
inline void G4VUIshell::SetLsColor(TermColorIndex, TermColorIndex) {}
inline void G4VUIshell::ShowCurrentDirectory() const { G4cout << currentCommandDir << G4endl; }
#endif