|
libodsstream
Library for mass spectrometry
|
#include <tsvdirectorywriter.h>
Public Member Functions | |
| TsvDirectoryWriter (const QDir &directory) | |
| virtual | ~TsvDirectoryWriter () |
| virtual void | close () override |
| virtual void | writeSheet (const QString &sheetName) override |
| open a new sheet | |
| void | writeLine () override |
| open a new line | |
| void | writeCell (const char *) override |
| write a text cell | |
| void | writeCell (const QString &) override |
| write a text cell | |
| void | writeEmptyCell () override |
| write an empty cell | |
| void | writeCell (std::size_t) override |
| write an unsigned integer in a cell | |
| void | writeCell (int) override |
| write an integer in a cell | |
| void | writeCell (float) override |
| write a float in a cell | |
| void | writeCell (double) override |
| write a double in a cell | |
| void | writeCellPercentage (double value) override |
| write a double as a percentage | |
| void | writeCell (bool) override |
| write a boolean in a cell | |
| void | writeCell (const QDate &) override |
| write a date in a cell | |
| void | writeCell (const QDateTime &) override |
| write a timestamp in a cell | |
| void | writeCell (const QUrl &, const QString &) override |
| write a text cell with an URL link | |
| void | setCellAnnotation (const QString &annotation) override |
| set annotation to write in the next cell | |
| void | setSeparator (TsvSeparator separator) |
| sets the separator to use between values (cells) | |
| TsvSeparator | getSeparator () const |
| get the separator used between values (cells) | |
| bool | setQuoteStrings (bool quote_strings) |
| set a flag to quote strings | |
| bool | isQuoteStrings () const |
| tells if the quote string flag is enabled | |
| bool | setFlushLines (bool flushOk) |
| enable a physical flush on device at each new line enables this if you want to ensure that each line is written. This costs a little overhead | |
| bool | isFlushLines () const |
| tells if the flush lines flag is enabled | |
Public Member Functions inherited from CalcWriterInterface | |
| virtual | ~CalcWriterInterface () |
| virtual OdsTableCellStyleRef | getTableCellStyleRef (const OdsTableCellStyle &style) |
| virtual void | setTableCellStyleRef (OdsTableCellStyleRef style_ref) |
| void | clearTableCellStyleRef () |
| virtual void | addColorScale (const OdsColorScale &ods_color_scale) |
| apply solor scale conditional format on a cell range | |
| virtual QString | getOdsCellCoordinate () |
| get the last written cell coordinate in ODS coordinate format get the coordinate of the last written cell or an empty string if the writer is not an OdsDocWriter | |
| virtual void | setCurrentOdsTableSettings (const OdsTableSettings &settings) |
| set ODS table settings of the current sheet (table) | |
| virtual void | writeCellVariant (const QVariant &var) |
| write a cell for a given QVariant | |
Protected Member Functions | |
| TsvDirectoryWriter () | |
| void | writeRawCell (const QString &text) |
| void | initializeSheet () |
Protected Attributes | |
| QString | m_separator = "\t" |
| QString | _end_of_line = "\n" |
| QTextStream * | mpa_otxtstream = nullptr |
| unsigned int | numFloatPrecision = 12 |
Private Member Functions | |
| void | ensureSheet () |
Private Attributes | |
| const QDir | _directory |
| QString | _file_extension = ".tsv" |
| bool | m_quoteStrings = false |
| bool | m_flushLines = false |
| TsvSeparator | m_tsvSeparatorEnum = TsvSeparator::tab |
| bool | _tableRowStart = true |
| bool | _startingSheet = false |
| QFile * | mpa_ofile = nullptr |
Definition at line 32 of file tsvdirectorywriter.h.
| TsvDirectoryWriter::TsvDirectoryWriter | ( | const QDir & | directory | ) |
Definition at line 30 of file tsvdirectorywriter.cpp.
References _directory.
|
virtual |
|
protected |
Definition at line 26 of file tsvdirectorywriter.cpp.
|
overridevirtual |
Implements CalcWriterInterface.
Reimplemented in TsvOutputStream, and ZipTsvOutputStream.
Definition at line 72 of file tsvdirectorywriter.cpp.
References _end_of_line, mpa_ofile, and mpa_otxtstream.
Referenced by ~TsvDirectoryWriter(), ZipTsvOutputStream::close(), and writeSheet().
|
private |
Definition at line 125 of file tsvdirectorywriter.cpp.
References mpa_otxtstream, and writeSheet().
Referenced by writeCell(), writeEmptyCell(), writeLine(), and writeRawCell().
| TsvSeparator TsvDirectoryWriter::getSeparator | ( | ) | const |
get the separator used between values (cells)
Definition at line 293 of file tsvdirectorywriter.cpp.
References m_tsvSeparatorEnum.
|
protected |
Definition at line 116 of file tsvdirectorywriter.cpp.
References _startingSheet, and _tableRowStart.
Referenced by writeSheet(), and ZipTsvOutputStream::writeSheet().
| bool TsvDirectoryWriter::isFlushLines | ( | ) | const |
tells if the flush lines flag is enabled
Definition at line 280 of file tsvdirectorywriter.cpp.
References m_flushLines.
| bool TsvDirectoryWriter::isQuoteStrings | ( | ) | const |
tells if the quote string flag is enabled
Definition at line 274 of file tsvdirectorywriter.cpp.
References m_quoteStrings.
|
inlineoverridevirtual |
set annotation to write in the next cell
| annotation | any comment on this cell |
Implements CalcWriterInterface.
Definition at line 55 of file tsvdirectorywriter.h.
| bool TsvDirectoryWriter::setFlushLines | ( | bool | flushOk | ) |
enable a physical flush on device at each new line enables this if you want to ensure that each line is written. This costs a little overhead
| bool | if true, lines will be flushed, choose false otherwise |
Definition at line 286 of file tsvdirectorywriter.cpp.
References m_flushLines.
| bool TsvDirectoryWriter::setQuoteStrings | ( | bool | quote_strings | ) |
set a flag to quote strings
| bool | if true, strings will be quoted, choose false otherwise |
Definition at line 267 of file tsvdirectorywriter.cpp.
References m_quoteStrings.
| void TsvDirectoryWriter::setSeparator | ( | TsvSeparator | separator | ) |
sets the separator to use between values (cells)
| TsvSeparator | enumeration to choose between possible choices |
Definition at line 52 of file tsvdirectorywriter.cpp.
References comma, m_separator, m_tsvSeparatorEnum, semicolon, and tab.
|
overridevirtual |
write a boolean in a cell
| true_or_false | boolean to write |
Implements CalcWriterInterface.
Definition at line 237 of file tsvdirectorywriter.cpp.
References writeRawCell().
|
overridevirtual |
write a text cell
| cell_text | cell text |
Implements CalcWriterInterface.
Definition at line 151 of file tsvdirectorywriter.cpp.
References writeCell().
Referenced by writeCell(), writeCell(), and writeCellPercentage().
|
overridevirtual |
write a date in a cell
| date | date to write |
Implements CalcWriterInterface.
Definition at line 249 of file tsvdirectorywriter.cpp.
References writeRawCell().
|
overridevirtual |
write a timestamp in a cell
| datetime | timestamp to write |
Implements CalcWriterInterface.
Definition at line 254 of file tsvdirectorywriter.cpp.
References writeRawCell().
|
overridevirtual |
write a text cell
| cell_text | cell text |
Implements CalcWriterInterface.
Definition at line 156 of file tsvdirectorywriter.cpp.
References _end_of_line, _startingSheet, _tableRowStart, ensureSheet(), m_quoteStrings, m_separator, and mpa_otxtstream.
|
overridevirtual |
write a text cell with an URL link
| url_link | URL link |
| text | text to write |
Implements CalcWriterInterface.
Definition at line 259 of file tsvdirectorywriter.cpp.
References writeCell().
|
overridevirtual |
write a double in a cell
| number | double to write |
Implements CalcWriterInterface.
Definition at line 226 of file tsvdirectorywriter.cpp.
References numFloatPrecision, and writeRawCell().
|
overridevirtual |
write a float in a cell
| number | float to write |
Implements CalcWriterInterface.
Definition at line 221 of file tsvdirectorywriter.cpp.
References numFloatPrecision, and writeRawCell().
|
overridevirtual |
write an integer in a cell
| number | integer to write |
Implements CalcWriterInterface.
Definition at line 216 of file tsvdirectorywriter.cpp.
References writeRawCell().
|
overridevirtual |
write an unsigned integer in a cell
| number | integer to write |
Implements CalcWriterInterface.
Definition at line 211 of file tsvdirectorywriter.cpp.
References writeRawCell().
|
overridevirtual |
write a double as a percentage
| number | double to write must be a ratio (0.5 == 50%) |
Implements CalcWriterInterface.
Definition at line 232 of file tsvdirectorywriter.cpp.
References writeCell().
|
overridevirtual |
write an empty cell
Implements CalcWriterInterface.
Definition at line 200 of file tsvdirectorywriter.cpp.
References _startingSheet, _tableRowStart, ensureSheet(), m_separator, and mpa_otxtstream.
|
overridevirtual |
open a new line
Implements CalcWriterInterface.
Definition at line 134 of file tsvdirectorywriter.cpp.
References _end_of_line, _startingSheet, _tableRowStart, ensureSheet(), m_flushLines, and mpa_otxtstream.
|
protected |
Definition at line 188 of file tsvdirectorywriter.cpp.
References _startingSheet, _tableRowStart, ensureSheet(), m_separator, and mpa_otxtstream.
Referenced by writeCell(), writeCell(), writeCell(), writeCell(), writeCell(), writeCell(), and writeCell().
|
overridevirtual |
open a new sheet
| sheetName | the sheet name |
Implements CalcWriterInterface.
Reimplemented in TsvOutputStream, and ZipTsvOutputStream.
Definition at line 92 of file tsvdirectorywriter.cpp.
References _directory, close(), initializeSheet(), mpa_ofile, and mpa_otxtstream.
Referenced by ensureSheet().
|
private |
Definition at line 109 of file tsvdirectorywriter.h.
Referenced by TsvDirectoryWriter(), and writeSheet().
|
protected |
Definition at line 104 of file tsvdirectorywriter.h.
Referenced by close(), writeCell(), writeLine(), and TsvOutputStream::writeSheet().
|
private |
Definition at line 111 of file tsvdirectorywriter.h.
|
private |
Definition at line 118 of file tsvdirectorywriter.h.
Referenced by initializeSheet(), writeCell(), writeEmptyCell(), writeLine(), and writeRawCell().
|
private |
Definition at line 117 of file tsvdirectorywriter.h.
Referenced by initializeSheet(), writeCell(), writeEmptyCell(), writeLine(), and writeRawCell().
|
private |
Definition at line 114 of file tsvdirectorywriter.h.
Referenced by isFlushLines(), setFlushLines(), and writeLine().
|
private |
Definition at line 113 of file tsvdirectorywriter.h.
Referenced by isQuoteStrings(), setQuoteStrings(), and writeCell().
|
protected |
Definition at line 103 of file tsvdirectorywriter.h.
Referenced by setSeparator(), writeCell(), writeEmptyCell(), and writeRawCell().
|
private |
Definition at line 115 of file tsvdirectorywriter.h.
Referenced by getSeparator(), and setSeparator().
|
private |
Definition at line 120 of file tsvdirectorywriter.h.
Referenced by close(), and writeSheet().
|
protected |
Definition at line 105 of file tsvdirectorywriter.h.
Referenced by TsvOutputStream::TsvOutputStream(), TsvOutputStream::~TsvOutputStream(), close(), TsvOutputStream::close(), ZipTsvOutputStream::closeCurrentZipSheet(), ensureSheet(), writeCell(), writeEmptyCell(), writeLine(), writeRawCell(), writeSheet(), TsvOutputStream::writeSheet(), and ZipTsvOutputStream::writeSheet().
|
protected |
Definition at line 106 of file tsvdirectorywriter.h.
Referenced by writeCell(), and writeCell().