diff --git a/src/OpenFOAM/primitives/strings/word/wordIOList.C b/src/OpenFOAM/primitives/strings/word/wordIOList.C index dc85ced879..ede987af53 100644 --- a/src/OpenFOAM/primitives/strings/word/wordIOList.C +++ b/src/OpenFOAM/primitives/strings/word/wordIOList.C @@ -37,4 +37,42 @@ namespace Foam defineTemplateTypeNameAndDebugWithName(wordListIOList, "wordListList", 0); } + +void Foam::printTable(const List& wll, Ostream& os) +{ + if (!wll.size()) return; + + // Find the maximum word length for each column + List columnWidth(wll[0].size(), string::size_type(0)); + forAll(columnWidth, j) + { + forAll(wll, i) + { + columnWidth[j] = max(columnWidth[j], wll[i][j].size()); + } + } + + // Print the rows adding spacing for the columns + forAll(wll, i) + { + forAll(wll[i], j) + { + os << wll[i][j]; + for + ( + string::size_type k=0; + k wordIOList; typedef IOList wordListIOList; + + // Print word list list as a table + void printTable(const List&, Ostream&); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //