Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4UIbatch.cc File Reference
#include "G4UIbatch.hh"
#include "G4UImanager.hh"
#include <vector>
#include <string>
Include dependency graph for G4UIbatch.cc:

Go to the source code of this file.

Functions

static void Tokenize (const G4String &str, std::vector< G4String > &tokens)
 

Function Documentation

static void Tokenize ( const G4String str,
std::vector< G4String > &  tokens 
)
static

Definition at line 38 of file G4UIbatch.cc.

40 {
41  const char* delimiter= " ";
42 
43  G4String::size_type pos0= str.find_first_not_of(delimiter);
44  G4String::size_type pos = str.find_first_of(delimiter, pos0);
45 
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 
56  tokens.push_back(str.substr(pos0, pos-pos0));
57  pos0 = str.find_first_not_of(delimiter, pos);
58  pos = str.find_first_of(delimiter, pos0);
59  }
60 }
static const G4double pos

Here is the caller graph for this function: