13 shell=
new G4UIcommand(
"/shell",
this);
14 shell->SetGuidance(
"Invokes a shell command");
15 G4UIparameter* parameter;
17 parameter =
new G4UIparameter (
"Command",
's', omitable =
false);
18 shell->SetParameter(parameter);
20 echo=
new G4UIcommand(
"/echo",
this);
21 echo->SetGuidance(
"Echoes a string");
22 echo->SetParameter(parameter);
24 edit=
new G4UIcommand(
"/edit",
this);
25 edit->SetGuidance(
"Invokes the chosen editor");
26 parameter =
new G4UIparameter (
"File to be edited",
's', omitable =
false);
27 edit->SetParameter(parameter);
29 quit=
new G4UIcommand(
"/quit",
this);
30 quit->SetGuidance(
"quits the application");
32 load=
new G4UIcommand(
"/load",
this);
33 load->SetGuidance(
"Dynamically loads a shared library");
34 parameter =
new G4UIparameter (
"Library to be loaded",
's', omitable =
false);
35 load->SetParameter(parameter);
37 unload=
new G4UIcommand(
"/unload",
this);
38 unload->SetGuidance(
"Drops a shared library");
39 parameter =
new G4UIparameter (
"Library to be dropped",
's', omitable =
false);
40 unload->SetParameter(parameter);
57 std::string temp(newValues);
58 unsigned int i=temp.find_first_not_of (
'"');
59 if (i != std::string::npos)
61 if (i>0) temp = temp.substr (i);
62 i = temp.find_last_not_of (
'"');
63 if (i < temp.size ()) temp = temp.substr (0, i + 1);
67 else if (command==echo)
69 std::string temp(newValues);
70 unsigned int i=temp.find_first_not_of (
'"');
71 if (i != std::string::npos)
73 if (i>0) temp = temp.substr (i);
74 i = temp.find_last_not_of (
'"');
75 if (i < temp.size ()) temp = temp.substr (0, i + 1);
79 else if (command==quit)
81 G4UImanager *man=G4UImanager::GetUIpointer();
82 man->ApplyCommand(
"/exit");
84 else if (command==edit)
86 std::string
s=
"$GOOFY_EDITOR "+newValues+
" &";
89 else if (command==load)
91 PackageLoader a(newValues.c_str());
93 else if (command==unload)
97 test=a.unload(newValues);