Default constructor, see class IOFormat for the meaning of the parameters */
| 54 | { |
| 55 | /** Default constructor, see class IOFormat for the meaning of the parameters */ |
| 56 | IOFormat(int _precision = StreamPrecision, int _flags = 0, |
| 57 | const std::string& _coeffSeparator = " ", |
| 58 | const std::string& _rowSeparator = "\n", const std::string& _rowPrefix="", const std::string& _rowSuffix="", |
| 59 | const std::string& _matPrefix="", const std::string& _matSuffix="", const char _fill=' ') |
| 60 | : matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator), |
| 61 | rowSpacer(""), coeffSeparator(_coeffSeparator), fill(_fill), precision(_precision), flags(_flags) |
| 62 | { |
| 63 | // TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline |
| 64 | // don't add rowSpacer if columns are not to be aligned |
| 65 | if((flags & DontAlignCols)) |
| 66 | return; |
| 67 | int i = int(matSuffix.length())-1; |
| 68 | while (i>=0 && matSuffix[i]!='\n') |
| 69 | { |
| 70 | rowSpacer += ' '; |
| 71 | i--; |
| 72 | } |
| 73 | } |
| 74 | std::string matPrefix, matSuffix; |
| 75 | std::string rowPrefix, rowSuffix, rowSeparator, rowSpacer; |
| 76 | std::string coeffSeparator; |