Changeset 1016 for trunk/source/intercoms/src/G4UIbatch.cc
- Timestamp:
- Apr 22, 2009, 12:38:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/intercoms/src/G4UIbatch.cc
r850 r1016 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4UIbatch.cc,v 1.1 6 2007/08/10 09:46:10kmura Exp $27 // GEANT4 tag $Name: HEAD$26 // $Id: G4UIbatch.cc,v 1.17 2008/11/21 10:54:16 kmura Exp $ 27 // GEANT4 tag $Name: geant4-09-02 $ 28 28 // 29 29 // ==================================================================== … … 45 45 46 46 while (pos != G4String::npos || pos0 != G4String::npos) { 47 if (str[pos0] == '\"') { 48 pos = str.find_first_of("\"", pos0+1); 49 if(pos != G4String::npos) pos++; 50 } 51 if (str[pos0] == '\'') { 52 pos = str.find_first_of("\'", pos0+1); 53 if(pos != G4String::npos) pos++; 54 } 55 47 56 tokens.push_back(str.substr(pos0, pos-pos0)); 48 49 57 pos0 = str.find_first_not_of(delimiter, pos); 50 58 pos = str.find_first_of(delimiter, pos0); … … 110 118 if(!qcontinued && cmdline.size()==0) continue; 111 119 120 // '#' is treated as echoing something 121 if(cmdline[(size_t)0]=='#') return cmdline; 122 112 123 // tokenize... 113 124 std::vector<G4String> tokens; … … 115 126 qcontinued= false; 116 127 for (G4int i=0; i< G4int(tokens.size()); i++) { 128 // string after '#" is ignored 129 if(tokens[i][(size_t)0] == '#' ) break; 117 130 // '\' or '_' is treated as continued line. 118 131 if(tokens[i] == '\\' || tokens[i] == '_' ) { … … 129 142 } 130 143 131 if(qcontinued) continue; // read `the next line144 if(qcontinued) continue; // read the next line 132 145 133 146 if(cmdtotal.size() != 0) break; … … 137 150 // strip again 138 151 cmdtotal= cmdtotal.strip(G4String::both); 139 140 // '#' is treated as echoing something141 if(cmdtotal[(size_t)0]=='#') return cmdtotal;142 143 // normally something after # is treated just as comment and ignored144 str_size ic= cmdtotal.find_first_of('#');145 if(ic != G4String::npos) {146 cmdtotal= cmdtotal(0, ic);147 }148 152 149 153 // finally, … … 153 157 154 158 return cmdtotal; 155 156 159 } 157 160
Note: See TracChangeset
for help on using the changeset viewer.