Ignore:
Timestamp:
Apr 22, 2009, 12:38:42 PM (15 years ago)
Author:
garnier
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/intercoms/src/G4UIbatch.cc

    r850 r1016  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UIbatch.cc,v 1.16 2007/08/10 09:46:10 kmura 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 $
    2828//
    2929// ====================================================================
     
    4545 
    4646  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
    4756    tokens.push_back(str.substr(pos0, pos-pos0));
    48 
    4957    pos0 = str.find_first_not_of(delimiter, pos);
    5058    pos = str.find_first_of(delimiter, pos0);
     
    110118    if(!qcontinued && cmdline.size()==0) continue;
    111119
     120    // '#' is treated as echoing something
     121    if(cmdline[(size_t)0]=='#') return cmdline;
     122
    112123    // tokenize...
    113124    std::vector<G4String> tokens;
     
    115126    qcontinued= false;
    116127    for (G4int i=0; i< G4int(tokens.size()); i++) {
     128      // string after '#" is ignored
     129      if(tokens[i][(size_t)0] == '#' ) break;
    117130      // '\' or '_' is treated as continued line.
    118131      if(tokens[i] == '\\' || tokens[i] == '_' ) {
     
    129142    }
    130143
    131     if(qcontinued) continue; // read` the next line
     144    if(qcontinued) continue; // read the next line
    132145
    133146    if(cmdtotal.size() != 0) break;
     
    137150  // strip again
    138151  cmdtotal= cmdtotal.strip(G4String::both);
    139 
    140   // '#' is treated as echoing something
    141   if(cmdtotal[(size_t)0]=='#') return cmdtotal;
    142 
    143   // normally something after # is treated just as comment and ignored
    144   str_size ic= cmdtotal.find_first_of('#');
    145   if(ic != G4String::npos) {
    146     cmdtotal= cmdtotal(0, ic);
    147   }
    148152
    149153  // finally,
     
    153157
    154158  return cmdtotal;
    155 
    156159}
    157160
Note: See TracChangeset for help on using the changeset viewer.