/////////////////////////////////
| 157 | |
| 158 | ////////////////////////////////////// |
| 159 | void G4UIArrayString::Show(G4int ncol) |
| 160 | ////////////////////////////////////// |
| 161 | { |
| 162 | // calculate #colums in need... |
| 163 | while (CalculateColumnWidth() < ncol) { |
| 164 | nColumn++; |
| 165 | } |
| 166 | while (CalculateColumnWidth() > ncol && nColumn > 1) { |
| 167 | nColumn--; |
| 168 | } |
| 169 | |
| 170 | for (G4int iy = 1; iy <= GetNRow(1); iy++) { |
| 171 | G4int nc = (G4int)nColumn; |
| 172 | if (iy == GetNRow(1)) { // last row |
| 173 | nc = G4int(nElement % nColumn); |
| 174 | if (nc == 0) nc = (G4int)nColumn; |
| 175 | } |
| 176 | for (G4int ix = 1; ix <= nc; ++ix) { |
| 177 | G4String word = GetElement(ix, iy)->data(); |
| 178 | |
| 179 | // care for color code |
| 180 | G4String colorWord; |
| 181 | const char tgt = word[(std::size_t)0]; |
| 182 | if (strESC == tgt) { |
| 183 | colorWord = word.substr(0, 5); |
| 184 | word.erase(0, 5); |
| 185 | } |
| 186 | if (! colorWord.empty()) G4cout << colorWord << std::flush; |
| 187 | |
| 188 | G4cout << std::setiosflags(std::ios::left) << std::setw(GetNField(ix)) << word.c_str() |
| 189 | << std::flush; |
| 190 | // against problem w/ g++ iostream |
| 191 | if (ix != nc) |
| 192 | G4cout << " " << std::flush; |
| 193 | else |
| 194 | G4cout << G4endl; |
| 195 | } |
| 196 | } |
| 197 | } |
no test coverage detected