#include <GoofyMessenger.h>
Public Member Functions | |
GoofyMessenger (Goofy *v) | |
~GoofyMessenger () | |
void | SetNewValue (G4UIcommand *command, G4String newValues) |
G4String | GetCurrentValue (G4UIcommand *command) |
Private Attributes | |
Goofy * | rm |
G4UIcommand * | shell |
G4UIcommand * | echo |
G4UIcommand * | edit |
G4UIcommand * | load |
G4UIcommand * | unload |
G4UIcommand * | quit |
Definition at line 10 of file GoofyMessenger.h.
GoofyMessenger::GoofyMessenger | ( | Goofy * | v | ) |
Definition at line 9 of file GoofyMessenger.cpp.
References echo, edit, load, quit, rm, shell, unload, and v.
00010 { 00011 rm=v; 00012 00013 shell=new G4UIcommand("/shell",this); 00014 shell->SetGuidance("Invokes a shell command"); 00015 G4UIparameter* parameter; 00016 G4bool omitable; 00017 parameter = new G4UIparameter ("Command", 's', omitable = false); 00018 shell->SetParameter(parameter); 00019 00020 echo=new G4UIcommand("/echo",this); 00021 echo->SetGuidance("Echoes a string"); 00022 echo->SetParameter(parameter); 00023 00024 edit=new G4UIcommand("/edit",this); 00025 edit->SetGuidance("Invokes the chosen editor"); 00026 parameter = new G4UIparameter ("File to be edited", 's', omitable = false); 00027 edit->SetParameter(parameter); 00028 00029 quit=new G4UIcommand("/quit",this); 00030 quit->SetGuidance("quits the application"); 00031 00032 load=new G4UIcommand("/load",this); 00033 load->SetGuidance("Dynamically loads a shared library"); 00034 parameter = new G4UIparameter ("Library to be loaded", 's', omitable = false); 00035 load->SetParameter(parameter); 00036 00037 unload=new G4UIcommand("/unload",this); 00038 unload->SetGuidance("Drops a shared library"); 00039 parameter = new G4UIparameter ("Library to be dropped", 's', omitable = false); 00040 unload->SetParameter(parameter); 00041 }
GoofyMessenger::~GoofyMessenger | ( | ) |
G4String GoofyMessenger::GetCurrentValue | ( | G4UIcommand * | command | ) |
Definition at line 101 of file GoofyMessenger.cpp.
References s.
00102 { 00103 G4String s="Undefined"; 00104 return s; 00105 }
void GoofyMessenger::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValues | |||
) |
Definition at line 53 of file GoofyMessenger.cpp.
References echo, edit, genRecEmupikp::i, load, RealDBUtil::npos, quit, s, Goofy::Shell(), shell, deljobs::string, subSeperate::temp, test, and unload.
00054 { 00055 if (command==shell) 00056 { 00057 std::string temp(newValues); 00058 unsigned int i=temp.find_first_not_of ('"'); 00059 if (i != std::string::npos) 00060 { 00061 if (i>0) temp = temp.substr (i); 00062 i = temp.find_last_not_of ('"'); 00063 if (i < temp.size ()) temp = temp.substr (0, i + 1); 00064 } 00065 i=Goofy::Shell(temp); 00066 } 00067 else if (command==echo) 00068 { 00069 std::string temp(newValues); 00070 unsigned int i=temp.find_first_not_of ('"'); 00071 if (i != std::string::npos) 00072 { 00073 if (i>0) temp = temp.substr (i); 00074 i = temp.find_last_not_of ('"'); 00075 if (i < temp.size ()) temp = temp.substr (0, i + 1); 00076 } 00077 i=Goofy::Shell("echo "+temp); 00078 } 00079 else if (command==quit) 00080 { 00081 G4UImanager *man=G4UImanager::GetUIpointer(); 00082 man->ApplyCommand("/exit"); 00083 } 00084 else if (command==edit) 00085 { 00086 std::string s="$GOOFY_EDITOR "+newValues+" &"; 00087 Goofy::Shell(s); 00088 } 00089 else if (command==load) 00090 { 00091 PackageLoader a(newValues.c_str()); 00092 } 00093 else if (command==unload) 00094 { 00095 bool test; 00096 PackageLoader a; 00097 test=a.unload(newValues); 00098 } 00099 }
G4UIcommand* GoofyMessenger::echo [private] |
Definition at line 14 of file GoofyMessenger.h.
Referenced by GoofyMessenger(), SetNewValue(), and ~GoofyMessenger().
G4UIcommand* GoofyMessenger::edit [private] |
Definition at line 15 of file GoofyMessenger.h.
Referenced by GoofyMessenger(), SetNewValue(), and ~GoofyMessenger().
G4UIcommand* GoofyMessenger::load [private] |
Definition at line 16 of file GoofyMessenger.h.
Referenced by GoofyMessenger(), SetNewValue(), and ~GoofyMessenger().
G4UIcommand* GoofyMessenger::quit [private] |
Definition at line 18 of file GoofyMessenger.h.
Referenced by GoofyMessenger(), SetNewValue(), and ~GoofyMessenger().
Goofy* GoofyMessenger::rm [private] |
G4UIcommand* GoofyMessenger::shell [private] |
Definition at line 13 of file GoofyMessenger.h.
Referenced by GoofyMessenger(), SetNewValue(), and ~GoofyMessenger().
G4UIcommand* GoofyMessenger::unload [private] |
Definition at line 17 of file GoofyMessenger.h.
Referenced by GoofyMessenger(), SetNewValue(), and ~GoofyMessenger().