#include <G4UIArrayString.hh>
Definition at line 40 of file G4UIArrayString.hh.
◆ G4UIArrayString()
G4UIArrayString::G4UIArrayString |
( |
const G4String & |
stream | ) |
|
Definition at line 35 of file G4UIArrayString.cc.
37{
38 nElement=0;
39 nColumn=5;
40
43
44
46 while(1) {
48 nElement++;
49 if(jc ==
G4int(G4String::npos))
break;
50 jc++;
51 for(; jc<
G4int(astream.length()); ) {
52 if(astream[(size_t)(jc)]==' ') jc++;
53 else break;
54 }
55 indx= jc;
56 }
57
58
60
61
62 indx=0;
63 for(
G4int i=0; i<nElement; i++){
65 if(jc !=
G4int(G4String::npos))
66 stringArray[i]= astream(indx, jc-indx);
67 else {
68 jc= astream.length()+1;
69 stringArray[i]= astream(indx, jc-indx);
70 }
71 for(
G4int j=1; jc+j<
G4int(astream.length()); j++ ) {
72 if(astream(jc+j)==' ') jc++;
73 else break;
74 }
75 indx= jc+1;
76 }
77}
str_size index(const char *, G4int pos=0) const
G4String strip(G4int strip_Type=trailing, char c=' ')
◆ ~G4UIArrayString()
G4UIArrayString::~G4UIArrayString |
( |
| ) |
|
◆ Show()
void G4UIArrayString::Show |
( |
G4int |
ncol | ) |
|
Definition at line 154 of file G4UIArrayString.cc.
156{
157
158 while( CalculateColumnWidth()< ncol ) {
159 nColumn++;
160 }
161 while( CalculateColumnWidth()> ncol && nColumn>1 ) {
162 nColumn--;
163 }
164
165 for(
G4int iy=1; iy<= GetNRow(1); iy++) {
167 if(iy == GetNRow(1)) {
168 nc= nElement%nColumn;
169 if(nc==0) nc= nColumn;
170 }
171 for(
G4int ix=1; ix<=nc; ix++) {
172 G4String word= GetElement(ix,iy)-> data();
173
174
176
177
178 const char tgt = word[(size_t)0];
179 if(strESC == tgt) {
180 colorWord= word(0,5);
181 word.erase(0,5);
182 }
183 if(!colorWord.empty())
G4cout << colorWord << std::flush;
184
185 G4cout << std::setiosflags(std::ios::left) << std::setw(GetNField(ix))
186 << word.c_str() << std::flush;
187
188 if(ix != nc)
G4cout <<
" " << std::flush;
190 }
191 }
192}
G4GLOB_DLL std::ostream G4cout
Referenced by G4VUIshell::ListCommand().
The documentation for this class was generated from the following files: