12 shell =
new G4UIcommand(
"/shell",
this );
13 shell->SetGuidance(
"Invokes a shell command" );
14 G4UIparameter* parameter;
16 parameter =
new G4UIparameter(
"Command",
's', omitable =
false );
17 shell->SetParameter( parameter );
19 echo =
new G4UIcommand(
"/echo",
this );
20 echo->SetGuidance(
"Echoes a string" );
21 echo->SetParameter( parameter );
23 edit =
new G4UIcommand(
"/edit",
this );
24 edit->SetGuidance(
"Invokes the chosen editor" );
25 parameter =
new G4UIparameter(
"File to be edited",
's', omitable =
false );
26 edit->SetParameter( parameter );
28 quit =
new G4UIcommand(
"/quit",
this );
29 quit->SetGuidance(
"quits the application" );
31 load =
new G4UIcommand(
"/load",
this );
32 load->SetGuidance(
"Dynamically loads a shared library" );
33 parameter =
new G4UIparameter(
"Library to be loaded",
's', omitable =
false );
34 load->SetParameter( parameter );
36 unload =
new G4UIcommand(
"/unload",
this );
37 unload->SetGuidance(
"Drops a shared library" );
38 parameter =
new G4UIparameter(
"Library to be dropped",
's', omitable =
false );
39 unload->SetParameter( parameter );
52 if ( command == shell )
54 std::string temp( newValues );
55 unsigned int i = temp.find_first_not_of(
'"' );
56 if ( i != std::string::npos )
58 if ( i > 0 ) temp = temp.substr( i );
59 i = temp.find_last_not_of(
'"' );
60 if ( i < temp.size() ) temp = temp.substr( 0, i + 1 );
64 else if ( command == echo )
66 std::string temp( newValues );
67 unsigned int i = temp.find_first_not_of(
'"' );
68 if ( i != std::string::npos )
70 if ( i > 0 ) temp = temp.substr( i );
71 i = temp.find_last_not_of(
'"' );
72 if ( i < temp.size() ) temp = temp.substr( 0, i + 1 );
76 else if ( command == quit )
78 G4UImanager* man = G4UImanager::GetUIpointer();
79 man->ApplyCommand(
"/exit" );
81 else if ( command == edit )
83 std::string
s =
"$GOOFY_EDITOR " + newValues +
" &";
86 else if ( command == load ) { PackageLoader a( newValues.c_str() ); }
87 else if ( command == unload )
91 test = a.unload( newValues );