#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
42
43
44 std::size_t indx=0;
45 while(1) {
46 std::size_t jc= astream.find(" ", indx);
47 nElement++;
48 if(jc == G4String::npos) break;
49 jc++;
50 for(; jc< astream.length(); ) {
51 if(astream[(
G4int)jc]==
' ') jc++;
52 else break;
53 }
54 indx= jc;
55 }
56
57
59
60
61 indx=0;
62 for(
G4int i=0; i<nElement; ++i){
63 std::size_t jc= astream.find(" ", indx);
64 if(jc != G4String::npos)
65 stringArray[i]= astream.substr(indx, jc-indx);
66 else {
67 jc= astream.length()+1;
68 stringArray[i]= astream.substr(indx, jc-indx);
69 }
70 for(std::size_t j=1; jc+j< astream.length(); ++j ) {
71 if(astream[
G4int(jc+j)]==
' ') jc++;
72 else break;
73 }
74 indx= jc+1;
75 }
76}
G4String strip_copy(G4String str, char ch=' ')
Return copy of string with leading and trailing characters removed.
◆ ~G4UIArrayString()
G4UIArrayString::~G4UIArrayString |
( |
| ) |
|
◆ Show()
void G4UIArrayString::Show |
( |
G4int |
ncol | ) |
|
Definition at line 152 of file G4UIArrayString.cc.
154{
155
156 while( CalculateColumnWidth()< ncol ) {
157 nColumn++;
158 }
159 while( CalculateColumnWidth()> ncol && nColumn>1 ) {
160 nColumn--;
161 }
162
163 for(
G4int iy=1; iy<= GetNRow(1); iy++) {
165 if(iy == GetNRow(1)) {
166 nc= nElement%nColumn;
167 if(nc==0) nc= nColumn;
168 }
169 for(
G4int ix=1; ix<=nc; ix++) {
170 G4String word= GetElement(ix,iy)-> data();
171
172
174 const char tgt = word[(std::size_t)0];
175 if(strESC == tgt) {
176 colorWord= word.substr(0,5);
177 word.erase(0,5);
178 }
179 if(!colorWord.empty())
G4cout << colorWord << std::flush;
180
181 G4cout << std::setiosflags(std::ios::left) << std::setw(GetNField(ix))
182 << word.c_str() << std::flush;
183
184 if(ix != nc)
G4cout <<
" " << std::flush;
186 }
187 }
188}
G4GLOB_DLL std::ostream G4cout
Referenced by G4VUIshell::ListCommand().
The documentation for this class was generated from the following files: