#include <G4Tokenizer.hh>
Definition at line 41 of file G4Tokenizer.hh.
◆ G4Tokenizer()
G4Tokenizer::G4Tokenizer |
( |
const G4String & | stn | ) |
|
|
inline |
Definition at line 44 of file G4Tokenizer.hh.
45 : string2tokenize(stn)
46 , actual(0)
47 {}
◆ operator()()
G4String G4Tokenizer::operator() |
( |
const char * | str = " \t\n", |
|
|
std::size_t | l = 0 ) |
|
inline |
Definition at line 49 of file G4Tokenizer.hh.
50 {
51 std::size_t i, j, tmp;
53 if(l == 0)
54 l = strlen(str);
55
56
57 while(actual < string2tokenize.size())
58 {
59 for(i = 0; i < l; ++i)
60 {
61 if(string2tokenize[(
G4int)actual] == str[i])
62 hasws = true;
63 }
64 if(hasws)
65 {
66 ++actual;
67 hasws = false;
68 }
69 else
70 break;
71 }
72
73 for(j = actual; j < string2tokenize.size(); ++j)
74 {
75 for(i = 0; i < l; ++i)
76 if(string2tokenize[(
G4int)j] == str[i])
77 break;
78 if(i < l)
79 break;
80 }
81 if(j != string2tokenize.size())
82 {
83 tmp = actual;
84 actual = j + 1;
85 return string2tokenize.substr(tmp, j - tmp);
86 }
87 else
88 {
89 tmp = actual;
90 actual = j;
91 return string2tokenize.substr(tmp, j - tmp);
92 }
93 }
The documentation for this class was generated from the following file: