Import Geant4 11.3.0 source tree
This commit is contained in:
@@ -61,7 +61,7 @@ class G4VInteractiveSession
|
||||
virtual void ClearMenu();
|
||||
virtual void UpdateSceneTree(const G4SceneTreeItem&);
|
||||
void AddInteractor(G4String, G4Interactor);
|
||||
G4Interactor GetInteractor(G4String);
|
||||
G4Interactor GetInteractor(const G4String&);
|
||||
const std::map<G4String, OutputStyle>& GetOutputStyles() const;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -254,7 +254,7 @@ G4bool GetValues(G4String newValue, G4int paramn, G4String* params)
|
||||
return false;
|
||||
}
|
||||
|
||||
params[i] = token;
|
||||
params[i] = std::move(token);
|
||||
|
||||
tok = strtok(nullptr, " ");
|
||||
}
|
||||
|
||||
@@ -550,7 +550,7 @@ void G4UItcsh::CompleteCommand()
|
||||
input += (vpath + stream);
|
||||
if (nMatch == 0) input += strtail;
|
||||
|
||||
commandLine = input;
|
||||
commandLine = std::move(input);
|
||||
cursorPosition = G4int(commandLine.length() + 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ G4String G4UIterminal::GetCommand(const char* msg)
|
||||
//////////////////////////////////////////////////
|
||||
{
|
||||
G4String newCommand = shell->GetCommandLineString(msg);
|
||||
G4String nullString = "";
|
||||
const G4String& nullString = "";
|
||||
|
||||
G4String nC = G4StrUtil::lstrip_copy(newCommand);
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ G4VBasicShell::~G4VBasicShell() = default;
|
||||
|
||||
G4String G4VBasicShell::ModifyToFullPathCommand(const char* aCommandLine) const
|
||||
{
|
||||
G4String rawCommandLine = aCommandLine;
|
||||
const G4String& rawCommandLine = aCommandLine;
|
||||
if (rawCommandLine.empty() || rawCommandLine[0] == '\0') return rawCommandLine;
|
||||
G4String commandLine = G4StrUtil::strip_copy(rawCommandLine);
|
||||
const G4String& commandLine = G4StrUtil::strip_copy(rawCommandLine);
|
||||
G4String commandString;
|
||||
G4String parameterString;
|
||||
size_t i = commandLine.find(' ');
|
||||
@@ -66,7 +66,7 @@ G4String G4VBasicShell::GetCurrentWorkingDirectory() const { return currentDirec
|
||||
|
||||
G4bool G4VBasicShell::ChangeDirectory(const char* newDir)
|
||||
{
|
||||
G4String newPrefix = G4StrUtil::strip_copy(newDir);
|
||||
const G4String& newPrefix = G4StrUtil::strip_copy(newDir);
|
||||
|
||||
G4String newDirectory = ModifyPath(newPrefix);
|
||||
if (newDirectory.back() != '/') {
|
||||
@@ -75,7 +75,7 @@ G4bool G4VBasicShell::ChangeDirectory(const char* newDir)
|
||||
if (FindDirectory(newDirectory.c_str()) == nullptr) {
|
||||
return false;
|
||||
}
|
||||
currentDirectory = newDirectory;
|
||||
currentDirectory = std::move(newDirectory);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -105,10 +105,10 @@ G4UIcommandTree* G4VBasicShell::FindDirectory(const char* dirName) const
|
||||
|
||||
G4UIcommand* G4VBasicShell::FindCommand(const char* commandName) const
|
||||
{
|
||||
G4String commandLine = G4StrUtil::strip_copy(commandName);
|
||||
const G4String& commandLine = G4StrUtil::strip_copy(commandName);
|
||||
|
||||
G4String commandString;
|
||||
size_t i = commandLine.find(' ');
|
||||
std::size_t i = commandLine.find(' ');
|
||||
if (i != std::string::npos) {
|
||||
commandString = commandLine.substr(0, i);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ G4UIcommand* G4VBasicShell::FindCommand(const char* commandName) const
|
||||
commandString = commandLine;
|
||||
}
|
||||
|
||||
G4String targetCom = ModifyPath(commandString);
|
||||
const G4String& targetCom = ModifyPath(commandString);
|
||||
return G4UImanager::GetUIpointer()->GetTree()->FindPath(targetCom);
|
||||
}
|
||||
|
||||
@@ -181,10 +181,10 @@ G4String G4VBasicShell::ModifyPath(const G4String& tempPath) const
|
||||
////////////////////////////////////////////
|
||||
G4String G4VBasicShell::Complete(const G4String& commandName)
|
||||
{
|
||||
G4String rawCommandLine = commandName;
|
||||
G4String commandLine = G4StrUtil::strip_copy(rawCommandLine);
|
||||
const G4String& rawCommandLine = commandName;
|
||||
const G4String& commandLine = G4StrUtil::strip_copy(rawCommandLine);
|
||||
|
||||
size_t i = commandLine.find(' ');
|
||||
std::size_t i = commandLine.find(' ');
|
||||
if (i != std::string::npos)
|
||||
return rawCommandLine; // Already entering parameters,
|
||||
// assume command path is correct.
|
||||
@@ -322,7 +322,7 @@ void G4VBasicShell::ChangeDirectoryCommand(const G4String& newCommand)
|
||||
prefix = "/";
|
||||
}
|
||||
else {
|
||||
G4String aNewPrefix = newCommand.substr(3, newCommand.length() - 3);
|
||||
const G4String& aNewPrefix = newCommand.substr(3, newCommand.length() - 3);
|
||||
prefix = G4StrUtil::strip_copy(aNewPrefix);
|
||||
}
|
||||
if (! ChangeDirectory(prefix)) {
|
||||
@@ -337,7 +337,7 @@ void G4VBasicShell::ListDirectory(const G4String& newCommand) const
|
||||
targetDir = GetCurrentWorkingDirectory();
|
||||
}
|
||||
else {
|
||||
G4String newPrefix = newCommand.substr(3, newCommand.length() - 3);
|
||||
const G4String& newPrefix = newCommand.substr(3, newCommand.length() - 3);
|
||||
targetDir = G4StrUtil::strip_copy(newPrefix);
|
||||
}
|
||||
G4UIcommandTree* commandTree = FindDirectory(targetDir);
|
||||
|
||||
@@ -70,7 +70,7 @@ void G4VInteractiveSession::AddInteractor(G4String a_name, G4Interactor a_intera
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
G4Interactor G4VInteractiveSession::GetInteractor(G4String a_name)
|
||||
G4Interactor G4VInteractiveSession::GetInteractor(const G4String& a_name)
|
||||
{
|
||||
G4interactor_map::iterator it;
|
||||
if ((it = interactors.find(a_name)) == interactors.end()) return nullptr;
|
||||
|
||||
@@ -247,9 +247,9 @@ void G4VUIshell::ListCommand(const G4String& dir, const G4String& candidate) con
|
||||
}
|
||||
|
||||
// check "vcmd" is directory?
|
||||
G4String inputpath = vpath + vcmd;
|
||||
const G4String& inputpath = vpath + vcmd;
|
||||
if (! vcmd.empty()) {
|
||||
G4String tmpstr = inputpath + "/";
|
||||
const G4String& tmpstr = inputpath + "/";
|
||||
if (GetCommandTree(tmpstr) != nullptr) {
|
||||
vpath = tmpstr;
|
||||
vcmd = "";
|
||||
|
||||
Reference in New Issue
Block a user