40 const char* delimiter=
" ";
42 G4String::size_type pos0= str.find_first_not_of(delimiter);
43 G4String::size_type
pos = str.find_first_of(delimiter, pos0);
45 while (pos != G4String::npos || pos0 != G4String::npos) {
46 if (str[pos0] ==
'\"') {
47 pos = str.find_first_of(
"\"", pos0+1);
48 if(pos != G4String::npos) pos++;
50 if (str[pos0] ==
'\'') {
51 pos = str.find_first_of(
"\'", pos0+1);
52 if(pos != G4String::npos) pos++;
55 tokens.push_back(str.substr(pos0, pos-pos0));
56 pos0 = str.find_first_not_of(delimiter, pos);
57 pos = str.find_first_of(delimiter, pos0);
70 previousSession(prevSession), isOpened(
false)
75 G4cerr <<
"ERROR: Can not open a macro file <"
76 << fileName <<
">. Set macro path with \"/control/macroPath\" if needed."
101 const char ctrM = 0x0d;
112 while ((nb= cmdline.find(
'\t',nb)) != G4String::npos) {
121 if(!qcontinued && cmdline.size()==0)
continue;
124 if(cmdline[(
size_t)0]==
'#')
return cmdline;
127 std::vector<G4String> tokens;
130 for (
G4int i=0; i<
G4int(tokens.size()); i++) {
132 if(tokens[i][(
size_t)0] ==
'#' )
break;
134 if(tokens[i] ==
'\\' || tokens[i] ==
'_' ) {
137 if( i !=
G4int(tokens.size())-1) {
140 "unexpected character after line continuation character");
144 cmdtotal+= tokens[i];
148 if(qcontinued)
continue;
150 if(cmdtotal.size() != 0)
break;
171 G4int rc= UI-> ApplyCommand(command);
177 G4cerr <<
"***** COMMAND NOT FOUND <"
178 << command <<
"> *****" <<
G4endl;
181 G4cerr <<
"***** Illegal application state <"
182 << command <<
"> *****" <<
G4endl;
186 G4cerr <<
"***** Illegal parameter (" << pn <<
") <"
187 << command <<
"> *****" <<
G4endl;
203 if(newCommand ==
"exit") {
208 if( newCommand[(
size_t)0] ==
'#') {
232 G4cout <<
"Pause session <" << Prompt <<
"> start." <<
G4endl;
236 G4cout <<
"Pause session <" << Prompt <<
"> Terminate." <<
G4endl;