* Convert the data from a Table into a string. * * This method will convert all of the Table's records and fields into a * string but will not serialze any label information. See TableRecord::toString * for how the records are converted into a string. * * @param table The Table to serialize * @param fieldDelimiter The delimiter to use between fields * * @return @b QStrin
| 545 | * @return @b QString The Table data as a string |
| 546 | */ |
| 547 | QString Table::toString(Table table, QString fieldDelimiter) { |
| 548 | QString tableValues; |
| 549 | // add the first record with header, the given delimiter, and a new line after each record |
| 550 | tableValues += TableRecord::toString(table[0], fieldDelimiter, true, true); |
| 551 | // add remaining records without header, the same delimeter, and new line after each record |
| 552 | for (int recordIndex = 1; recordIndex < table.Records(); recordIndex++) { |
| 553 | tableValues += TableRecord::toString(table[recordIndex], fieldDelimiter); |
| 554 | } |
| 555 | return tableValues; |
| 556 | } |
| 557 | |
| 558 | } |